On 2010-02-04, drlatex wrote:
> Hello,
>
> Is it possible for vim to search for repeated strings in a document ?
>
> For example, the file:
>
> abc
> def
> 123
> 654
> bcd
>
> has no repeated strings,
>
> But the file:
>
> 1234
> 2345
> 1567
> 1234
> 3214
>
> has the redundancy on lines 1 and 4.
>
> This might be hard because in the first file, the string 'bc' is in fact
> repeated on lines 1 and 6, but I am looking for if the file has two lines
> that are redundant.
>
> Any help, suggestions or discussion is greatly appreciated,
You could first sort the file,
:%sort
then search for duplicate lines in the result,
/\(^.*\)\n\1
HTH,
Gary
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php