mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
vim-patch:1c471ac: runtime(doc): update description of :uniq command
The examples mention the [u] flag, so at least the [u] flag should be
introduced before the examples.
Slightly reword the sentence about trailing/leading white space.
closes: vim/vim#17604
1c471ac548
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
This commit is contained in:
@ -1952,12 +1952,20 @@ Also see |:sort-uniq|.
|
|||||||
With [r] comparison is done on the text that matches
|
With [r] comparison is done on the text that matches
|
||||||
/{pattern}/ instead of the full line.
|
/{pattern}/ instead of the full line.
|
||||||
|
|
||||||
|
With [u] only keep lines that do not repeat (i.e., are
|
||||||
|
not immediately followed by the same line).
|
||||||
|
|
||||||
|
With [!] only keep lines that are immediately followed
|
||||||
|
by a duplicate.
|
||||||
|
|
||||||
|
If both [!] and [u] are given, [u] is ignored and [!]
|
||||||
|
takes effect.
|
||||||
|
|
||||||
When /{pattern}/ is specified and [r] is not used, the
|
When /{pattern}/ is specified and [r] is not used, the
|
||||||
text matched with {pattern} is skipped and comparison
|
text matched with {pattern} is skipped and comparison
|
||||||
is done on what comes after the match.
|
is done on what comes after the match.
|
||||||
'ignorecase' applies to the pattern, but 'smartcase'
|
'ignorecase' applies to the pattern, but 'smartcase'
|
||||||
is not used.
|
is not used.
|
||||||
|
|
||||||
Instead of the slash any non-letter can be used.
|
Instead of the slash any non-letter can be used.
|
||||||
|
|
||||||
For example, to remove adjacent duplicate lines based
|
For example, to remove adjacent duplicate lines based
|
||||||
@ -1969,17 +1977,8 @@ Also see |:sort-uniq|.
|
|||||||
< If {pattern} is empty (e.g. // is used), the last
|
< If {pattern} is empty (e.g. // is used), the last
|
||||||
search pattern is used.
|
search pattern is used.
|
||||||
|
|
||||||
With [u] only keep lines that do not repeat (i.e., are
|
Note that leading and trailing white space may cause
|
||||||
not immediately followed by the same line).
|
lines to be considered different.
|
||||||
|
|
||||||
With [!] only keep lines that are immediately followed
|
|
||||||
by a duplicate.
|
|
||||||
|
|
||||||
If both [!] and [u] are given, [u] is ignored and [!]
|
|
||||||
takes effect.
|
|
||||||
|
|
||||||
Note that leading and trailing white space, and lines
|
|
||||||
that are not adjacent, are not considered duplicates.
|
|
||||||
To remove all duplicates regardless of position, use
|
To remove all duplicates regardless of position, use
|
||||||
|:sort-u| or external tools.
|
|:sort-u| or external tools.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user