Set the command in .vimrc.
Use the following commands:
- Open
~/.vimrcfile (or create it if it didn’t exist). - Add
set hlsearchin the file. - Save the file.
Now your search will always be highlighted in vim.
For single time use, just use :set hlsearch in vim, which will be in effect for that instance only.