简体   繁体   中英

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.

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

You can do this with the incsearch.vim plugin:

类似于emacs的incsearch:在增量搜索时移动光标

You need to first install the plugin and bind <Over>(incsearch-...) .

You are looking for :set incsearch together with hlsearch. However all hits will have the same color.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM