In Normal mode:
:set hlsearch
Then search for a pattern with the command /
in Normal mode, or <Ctrl>o
followed by /
in Insert mode. *
in Normal mode will search for the next occurrence of the word under the cursor. The hlsearch
option will highlight all of them if set. #
will search for the previous occurrence of the word.
To remove the highlight of the previous search:
:nohlsearch
You might wish to map :nohlsearch<CR>
to some convenient key.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…