On 2015-02-06 12:45, David Fishburn wrote:
>>   :g/^\(\S*\)\s\+\<\1\>/sil! >
>  
> Thanks Tim, I didn't release we could use the \1 that way.  Once
> again I just assumed it could only be used in the replacement part.

I think I stumbled across it on a "hey, I wonder if this works" and
found that it did, so it's been in my tool-bag since then.  It's
documented at ":help /\1" with some caveats at ":help /\@<="

> To force the case sensitivity (regardless of the ignorecase
> setting) we can just add:
>   :g/\C^\(\S*\)\s\+\<\1\>/sil! >

Yes, that would have been wise to include, as I almost never fly with
'ignorecase' set, so my mind only thinks about it when I want to
force case-insensitivity with "\c".

> And to remove the ones that are identical (instead of indenting):
>   :g/\C^\(\S*\)\s\+\<\1\>/d
> 
> And to reverse that (i.e. keep only the ones that do match):
>   :v/\C^\(\S*\)\s\+\<\1\>/d

As usual, any Ex command will do here. :-)

-tim



-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to