How to highlight search words in vim permanently?

Set the command in .vimrc.

Use the following commands:

  1. Open ~/.vimrc file (or create it if it didn’t exist).
  2. Add set hlsearch in the file.
  3. 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.

Leave a Comment