I'm using putty on a Linux machine. My usual method for searching in vi is entering the slash /, then my search string, enter, then go through all the matches by n or shift + n.
I was wondering if vi had a feature like Eclipse's Incremental Search (ctrl + j), wherein as I type, it jumps to the next logical match. I think one of my office mates used to do it but I'm not sure.
Press Esc to cancel or press Enter to perform the search. Then press n to search forwards for the next occurrence, or N to search backwards. Type ggn to jump to the first match, or GN to jump to the last.
incsearch. vim is a Vim plugin which improve incremental searching. It provides functionality to highlight all matches while searching, to move cursor to next/previous match while searching and so on.
If you're using vim
(and who isn't nowadays), you can enable incremental search with:
:set incsearch
Then just use the regular search command /
and it will move the highlight as you add characters to the search string.
I also like hlsearch
as well since it highlights all found items (once the search command is done) for easy viewing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With