Highlight search terms in vim

By default, vim does not highlight search terms, and it can be difficult to find them in the document.


While editing a file in vim you can temporarily turn on the highlight search option by typing:

:set hlsearch

To automatically highlight search patterns in vim, first edit your .vimrc file:

vim ~/.vimrc

and then add this line:

set hlsearch