Mercurial > vim
comparison runtime/doc/change.txt @ 7447:ad432f8f68fb v7.4.1027
commit https://github.com/vim/vim/commit/887c1fea4a114e7170091942d0446c8882701b5b
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 2 17:56:35 2016 +0100
patch 7.4.1027
Problem: No support for binary numbers.
Solution: Add "bin" to nrformats. (Jason Schulz)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 02 Jan 2016 18:00:05 +0100 |
parents | ffad29dc7eee |
children | 05cf4cc72a9f |
comparison
equal
deleted
inserted
replaced
7446:a67ee44e5848 | 7447:ad432f8f68fb |
---|---|
414 character in the highlighted text. If several lines | 414 character in the highlighted text. If several lines |
415 are highlighted, each value will be decremented by an | 415 are highlighted, each value will be decremented by an |
416 additional [count] (so effectively creating a [count] | 416 additional [count] (so effectively creating a [count] |
417 decrementing sequence). {not in Vi} | 417 decrementing sequence). {not in Vi} |
418 | 418 |
419 The CTRL-A and CTRL-X commands work for (signed) decimal numbers, unsigned | 419 The CTRL-A and CTRL-X commands can work for: |
420 octal and hexadecimal numbers and alphabetic characters. This depends on the | 420 - signed and unsigned decimal numbers |
421 'nrformats' option. | 421 - unsigned binary, octal and hexadecimal numbers |
422 - alphabetic characters | |
423 | |
424 This depends on the 'nrformats' option: | |
425 - When 'nrformats' includes "bin", Vim assumes numbers starting with '0b' or | |
426 '0B' are binary. | |
422 - When 'nrformats' includes "octal", Vim considers numbers starting with a '0' | 427 - When 'nrformats' includes "octal", Vim considers numbers starting with a '0' |
423 to be octal, unless the number includes a '8' or '9'. Other numbers are | 428 to be octal, unless the number includes a '8' or '9'. Other numbers are |
424 decimal and may have a preceding minus sign. | 429 decimal and may have a preceding minus sign. |
425 If the cursor is on a number, the commands apply to that number; otherwise | 430 If the cursor is on a number, the commands apply to that number; otherwise |
426 Vim uses the number to the right of the cursor. | 431 Vim uses the number to the right of the cursor. |
444 leading zeros are removed to avoid that the result may be recognized as an | 449 leading zeros are removed to avoid that the result may be recognized as an |
445 octal number. | 450 octal number. |
446 | 451 |
447 Note that when 'nrformats' includes "octal", decimal numbers with leading | 452 Note that when 'nrformats' includes "octal", decimal numbers with leading |
448 zeros cause mistakes, because they can be confused with octal numbers. | 453 zeros cause mistakes, because they can be confused with octal numbers. |
454 | |
455 Note similarly, when 'nrformats' includes "bin", binary numbers with a leading | |
456 '0x' or '0X' can be interpreted as hexadecimal rather than binary since '0b' | |
457 are valid hexadecimal digits. | |
449 | 458 |
450 The CTRL-A command is very useful in a macro. Example: Use the following | 459 The CTRL-A command is very useful in a macro. Example: Use the following |
451 steps to make a numbered list. | 460 steps to make a numbered list. |
452 | 461 |
453 1. Create the first list entry, make sure it starts with a number. | 462 1. Create the first list entry, make sure it starts with a number. |
1734 | 1743 |
1735 Vim has a sorting function and a sorting command. The sorting function can be | 1744 Vim has a sorting function and a sorting command. The sorting function can be |
1736 found here: |sort()|, |uniq()|. | 1745 found here: |sort()|, |uniq()|. |
1737 | 1746 |
1738 *:sor* *:sort* | 1747 *:sor* *:sort* |
1739 :[range]sor[t][!] [i][u][r][n][x][o] [/{pattern}/] | 1748 :[range]sor[t][!] [i][u][r][n][x][o][b] [/{pattern}/] |
1740 Sort lines in [range]. When no range is given all | 1749 Sort lines in [range]. When no range is given all |
1741 lines are sorted. | 1750 lines are sorted. |
1742 | 1751 |
1743 With [!] the order is reversed. | 1752 With [!] the order is reversed. |
1744 | 1753 |
1752 number in the line (after or inside a {pattern} | 1761 number in the line (after or inside a {pattern} |
1753 match). A leading "0x" or "0X" is ignored. | 1762 match). A leading "0x" or "0X" is ignored. |
1754 One leading '-' is included in the number. | 1763 One leading '-' is included in the number. |
1755 | 1764 |
1756 With [o] sorting is done on the first octal number in | 1765 With [o] sorting is done on the first octal number in |
1766 the line (after or inside a {pattern} match). | |
1767 | |
1768 With [b] sorting is done on the first binary number in | |
1757 the line (after or inside a {pattern} match). | 1769 the line (after or inside a {pattern} match). |
1758 | 1770 |
1759 With [u] only keep the first of a sequence of | 1771 With [u] only keep the first of a sequence of |
1760 identical lines (ignoring case when [i] is used). | 1772 identical lines (ignoring case when [i] is used). |
1761 Without this flag, a sequence of identical lines | 1773 Without this flag, a sequence of identical lines |