Tuesday, April 5, 2011

Copy the selected text in visual mode to search

I many cases I like to search for other occurrence of some text in a file, under vim. Here's are the steps:
  1. Yank with y
  2. Start the search with the forward slash "/"
  3. CTRL-r then type "
And you should see the text in the search area.