Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs style highlighting for inc-search in vim

I realize that this question has been posed before on this forum, but I didn't find an answer so here goes..

In Vim, is there a way to enable on-the-fly highlighting for all matches when searching?

If I enable incsearch and type "/something" it will highlight the first match only. If I enable hlsearch and type "/something", nothing happens until I press enter (it only highlights the previous search).

In emacs the first match will be highlighted, and (after a slight delay) all other matches on the screen are highlighted in a different color, giving almost instant feedback when scanning for matches in a piece of code.

like image 903
user1273496 Avatar asked Mar 16 '12 08:03

user1273496


Video Answer


1 Answers

use the n-search feature of easy-motion , it does exactly what you need(look in the gif demo) BONUS: it also dims down the background for you that really makes searching easy

https://github.com/Lokaltog/vim-easymotion#n-character-search-motion

like image 79
linusx Avatar answered Oct 06 '22 02:10

linusx