summaryrefslogtreecommitdiffstats
path: root/runtime/doc/change.txt
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-04-11 21:38:50 +0000
committerBram Moolenaar <Bram@vim.org>2006-04-11 21:38:50 +0000
commit4c3f536f472c7443ed4f672ae6d35a28805d7641 (patch)
tree18d0d8df6d45ff21449a017068aea2ba0931bd57 /runtime/doc/change.txt
parent779b74b2a23643aaac026341a4ed8bd6e04371e6 (diff)
updated for version 7.0d01v7.0d01
Diffstat (limited to 'runtime/doc/change.txt')
-rw-r--r--runtime/doc/change.txt43
1 files changed, 29 insertions, 14 deletions
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index e8e1caa6a1..4aebe30c8b 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -1,4 +1,4 @@
-*change.txt* For Vim version 7.0d. Last change: 2006 Apr 09
+*change.txt* For Vim version 7.0d. Last change: 2006 Apr 11
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1508,7 +1508,7 @@ Vim has a sorting function and a sorting command. The sorting function can be
found here: |sort()|.
*:sor* *:sort*
-:[range]sor[t][!] [i][u][n][x][o] [/{pattern}/]
+:[range]sor[t][!] [i][u][r][n][x][o] [/{pattern}/]
Sort lines in [range]. When no range is given all
lines are sorted.
@@ -1517,24 +1517,25 @@ found here: |sort()|.
With [i] case is ignored.
With [n] sorting is done on the first decimal number
- in the line (after a {pattern} match).
+ in the line (after or inside a {pattern} match).
With [x] sorting is done on the first hexadecimal
- number in the line (after a {pattern} match). A
- leading "0x" or "0X" is ignored.
+ number in the line (after or inside a {pattern}
+ match). A leading "0x" or "0X" is ignored.
With [o] sorting is done on the first octal number in
- the line (after a {pattern} match).
+ 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
+ will be kept in their original order.
Note that leading and trailing white space may cause
lines to be different.
- When /{pattern}/ is specified the text matched with
- {pattern} is skipped, so that you sort on what comes
- after the match. For lines without a match sorting
- starts in the first column (e.g., for empty lines).
+ When /{pattern}/ is specified and there is no [r] flag
+ the text matched with {pattern} is skipped, so that
+ you sort on what comes after the match.
Instead of the slash any non-letter can be used.
For example, to sort on the second comma-separated
field: >
@@ -1545,7 +1546,21 @@ found here: |sort()|.
< To sort on the first number in the line, no matter
what is in front of it: >
:sort /.*\ze\d/
-<
+
+< With [r] sorting is done on the matching {pattern}
+ instead of skipping past it as described above.
+ For example, to sort on only the first three letters
+ of each line: >
+ :sort /\a\a\a/ r
+
+< If a {pattern} is used, any lines which don't have a
+ match for {pattern} are kept in their current order,
+ but separate from the lines which do match {pattern}.
+ If you sorted in reverse, they will be in reverse
+ order after the sorted lines, otherwise they will be
+ in their original order, right before the sorted
+ lines.
+
Note that using ":sort" with ":global" doesn't sort the matching lines, it's
quite useless.
@@ -1553,8 +1568,8 @@ The details about sorting depend on the library function used. There is no
guarantee that sorting is "stable" or obeys the current locale. You will have
to try it out.
-The sorting itself cannot be interrupted, because of using a system library
-function. You can interrupt the preparation (for undo) and putting the sorted
-lines into the buffer. In the last case you may end up with duplicated lines.
+The sorting can be interrupted, but if you interrupt it too late in the
+process you may end up with duplicated lines. This also depends on the system
+library function used.
vim:tw=78:ts=8:ft=help:norl: