deleting the last line of a paragraph with |dd|, the paragraph will be
joined with the next one.
- Changed text is saved for undo. Formatting is also a change. Thus each
format action saves text for undo. This may consume quite a lot of memory.
- Formatting a long paragraph and/or with complicated indenting may be slow.
==============================================================================
7. Sorting text *sorting*
Vim has a sorting function and a sorting command. The sorting function can be
found here: |sort()|, |uniq()|.
*:sor* *:sort*
:[range]sor[t][!] [b][f][i][l][n][o][r][u][x] [/{pattern}/]
Sort lines in [range]. When no range is given all
lines are sorted.
With [!] the order is reversed.
With [i] case is ignored.
With [l] sort uses the current collation locale.
Implementation details: strcoll() is used to compare
strings. See |:language| to check or set the collation
locale. Example: >
:language collate en_US.UTF-8
:%sort l
< |v:collate| can also used to check the current locale.
Sorting using the locale typically ignores case.
This does not work properly on Mac.
Options [n][f][x][o][b] are mutually exclusive.
With [n] sorting is done on the first decimal number
in the line (after or inside a {pattern} match).
One leading '-' is included in the number.
With [f] sorting is done on the Float in the line.
The value of Float is determined similar to passing
the text (after or inside a {pattern} match) to
str2float() function.
With [x] sorting is done on the first hexadecimal
number in the line (after or inside a {pattern}
match). A leading "0x" or "0X" is ignored.
One leading '-' is included in the number.
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] (u stands for unique) only keep the first