Vim search for word under cursor

Hit # while cursor is over a function name or variable to search backwards on that value. Use * to search forwards.

Then press n to step forward through all instances, and N to step backwards.

Subsequently, you can press [I (that's a capital i) to get a listing of all lines where that string appears.

1 comment

Anonymous wrote 7 years 1 day ago

A really nice and useful tip

A really nice and useful tip when I am looking a nested-for loop statement.
Thank you very much.

Add your comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

Find Me Around

User login