Search For The Word Under The Cursor In VIM

If you want to search a word in vim, you’ll probably use “/” (forward) and “?” (backward) followed by the word you want to search.

What if you want to look for the word currently under the cursor?
Obviously, you can use the above method. But a shorter one is: just hit “*” to search forwards, and “#” to search backwards.
So short, so efficient.

Leave a Reply