Linux VIM : usefull search tips and tricks

Posted: April 11, 2013 in linux, vim
Tags: , ,
  • Search for a word
  • Search ignore case
  • Incremental search

With incremental search you can view the matches as you type, no need to type the whole word.

:set incsearch
  • Highlight search matching word.
:set hlsearch
  • Smartcase

Search case sensitively if caps letters are in search pattern.

:set ignorecase smartcase
  • Type “*”  to search for the word under the cursor
  • Search for whole word

Here “/<” represents the start of the word and “\>” represents the end of the word

  1. Harsha says:

    vim open file for given name (with wildcard)

    vim $(find . -name “*filename*”)

Leave a Reply

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

You are commenting using your 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