How do I search for words that occur twice consecutively?

You can use one of the following search commands to locate words that occur twice consecutively:

     /\(\<\w\+\)\_s\+\1\>

     /\(\<\k\+\)\_s\+\1\>

The main difference is the use of ‘\w’ and ‘\k’, where the latter is based on the ‘iskeyword’ option which may include accented and other language specific characters.

Comments (1)


Pepsh Pepshinsky

Let’s see you to :help viminfo-file-name (option -i) :set viminfofile=NONE


Speak Your Mind