Home > Unix > multiple search inside VIM

multiple search inside VIM

There are two simple ways to highlight multiple words in vim editor.

  1. Go to search mode i.e. type ‘/‘ and then type \v followed by the words you want to search separated by ‘|‘ (pipe).
    Ex: /\vword1|word2|word3
  2. Go to search mode and type the words you want to search separated by ‘\|‘.
    Ex: /word1\|word2\|word3

Reference:

  1. http://stackoverflow.com/questions/19970974/how-to-highlight-multiple-words-in-vim
Advertisements
Categories: Unix
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: