Highlight each matching pattern while searching in Vim

I have set incsearch installed in my .vimrc and it selects EVERY associated template only when I press enter. But is there a way to highlight all the matches and enter into the search?

+6
source share
1 answer

What it means :set incsearch : show matches when entering a template :

enter image description here

Make sure the IncSearch highlight IncSearch does have distinctive visual features; It can be cleaned:

 :hi IncSearch 

Only the following coincidence stands out here; this means the functions mentioned in :help 'incsearch' :

CTRL-L can be used to add one character after the current match on the command line. If "ignorecase" and "smartcase" are installed and there are no uppercase characters on the command line, the added character is converted to lowercase.

CTRL-R CTRL-W can be used to add a word at the end of the current match, with the exception of characters that have already been typed.

If you want to highlight all matches , you need to either modify the Vim source code (and eventually publish the patch) or re-run the search (using getchar() and matchad() ) completely in Vimscript. Both are not trivial, so I recommend adhering to the status quo.

+17
source

All Articles