summaryrefslogtreecommitdiff
path: root/runtime/doc/change.txt
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-01-02 17:56:35 +0100
committerBram Moolenaar <Bram@vim.org>2016-01-02 17:56:35 +0100
commit887c1fea4a114e7170091942d0446c8882701b5b (patch)
tree23173526918b54763e5eed1b26a7bdad3ac7884a /runtime/doc/change.txt
parentacf92d27c94811e3bd6b84cfd54246e91d44c355 (diff)
downloadvim-git-887c1fea4a114e7170091942d0446c8882701b5b.tar.gz
patch 7.4.1027v7.4.1027
Problem: No support for binary numbers. Solution: Add "bin" to nrformats. (Jason Schulz)
Diffstat (limited to 'runtime/doc/change.txt')
-rw-r--r--runtime/doc/change.txt20
1 files changed, 16 insertions, 4 deletions
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index d1fcb5d53..6ccf93dfa 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -416,9 +416,14 @@ CTRL-X Subtract [count] from the number or alphabetic
additional [count] (so effectively creating a [count]
decrementing sequence). {not in Vi}
-The CTRL-A and CTRL-X commands work for (signed) decimal numbers, unsigned
-octal and hexadecimal numbers and alphabetic characters. This depends on the
-'nrformats' option.
+The CTRL-A and CTRL-X commands can work for:
+- signed and unsigned decimal numbers
+- unsigned binary, octal and hexadecimal numbers
+- alphabetic characters
+
+This depends on the 'nrformats' option:
+- When 'nrformats' includes "bin", Vim assumes numbers starting with '0b' or
+ '0B' are binary.
- When 'nrformats' includes "octal", Vim considers numbers starting with a '0'
to be octal, unless the number includes a '8' or '9'. Other numbers are
decimal and may have a preceding minus sign.
@@ -447,6 +452,10 @@ octal number.
Note that when 'nrformats' includes "octal", decimal numbers with leading
zeros cause mistakes, because they can be confused with octal numbers.
+Note similarly, when 'nrformats' includes "bin", binary numbers with a leading
+'0x' or '0X' can be interpreted as hexadecimal rather than binary since '0b'
+are valid hexadecimal digits.
+
The CTRL-A command is very useful in a macro. Example: Use the following
steps to make a numbered list.
@@ -1736,7 +1745,7 @@ Vim has a sorting function and a sorting command. The sorting function can be
found here: |sort()|, |uniq()|.
*:sor* *:sort*
-:[range]sor[t][!] [i][u][r][n][x][o] [/{pattern}/]
+:[range]sor[t][!] [i][u][r][n][x][o][b] [/{pattern}/]
Sort lines in [range]. When no range is given all
lines are sorted.
@@ -1756,6 +1765,9 @@ found here: |sort()|, |uniq()|.
With [o] sorting is done on the first octal number in
the line (after or inside a {pattern} match).
+ With [b] sorting is done on the first binary number in
+ the line (after or inside a {pattern} match).
+
With [u] only keep the first of a sequence of
identical lines (ignoring case when [i] is used).
Without this flag, a sequence of identical lines