0

I know by /foo you can find and go on foo. So what I am looking for is highlighting that line. I mean when vim find foo and the courser points to foo, also highlight that line which include foo.

1 Answer 1

2

The easiest way to do this is may be to toggle cursorline:

:set cursorline

and perhaps turn it off when you are done searching. To turn it off issue:

:set cursorline!

In the vimtips pages you will find more ideas including setting up a function key or other keyboard shortcut to do the above.

This is for the part where you say ".. and the cursor points to ..". To highlight all the lines where foo occurs in the document you might consider using ack.vim. It may take a little bit of time to figure out how to install it, but you can do something like:

:Ack foo

and a new window will open with all the lines where foo appears.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .