diff options
Diffstat (limited to 'runtime/doc/change.txt')
-rw-r--r-- | runtime/doc/change.txt | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index 0fa383bc67..42dc84e0de 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -371,8 +371,10 @@ CTRL-X Subtract [count] from the number or alphabetic character at or after the cursor. 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. +binary/octal/hexadecimal numbers and alphabetic characters. This +depends on the 'nrformats' option. +- When 'nrformats' includes "bin", Vim considers numbers starting with '0b' or + '0B' as 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. @@ -386,6 +388,10 @@ octal and hexadecimal numbers and alphabetic characters. This depends on the under or after the cursor. This is useful to make lists with an alphabetic index. +For decimals a leading negative sign is considered for incrementing or +decrementing, for binary and octal and hex values, it won't be considered. To +ignore the sign Visually select the number before using CTRL-A or CTRL-X. + For numbers with leading zeros (including all octal and hexadecimal numbers), Vim preserves the number of characters in the number when possible. CTRL-A on "0077" results in "0100", CTRL-X on "0x100" results in "0x0ff". @@ -397,6 +403,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. @@ -1602,7 +1612,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. @@ -1622,6 +1632,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 |