loupe icon indicating copy to clipboard operation
loupe copied to clipboard

Request: option to prevent * from jumping to next match

Open jdsutherland opened this issue 7 years ago • 4 comments

When I use *, I prefer not to automatically jump. Here is a reddit thread expressing support/use cases of this idea. I have similar uses to what a user mentioned:

...I want to highlight a given word (think typos in an article), or perform a count, or perform a global replacement.

I'm not sure how to make this work with loupe. My first thought was to chain N (something like nnoremap * <Plug>(LoupeStar)N) but this doesn't seem to work (can <Plug> calls be chained?).

Thoughts?

jdsutherland avatar Jul 11 '17 11:07 jdsutherland

There are other plugins that do that. For example, inkarkat/SearchHighlighting. It also mentions several related works.

john-kurkowski avatar Nov 08 '17 00:11 john-kurkowski

This is a good idea. One I initially hesitated to pursue because I don't like deviating too far from Vim defaults. Thanks for the links.

wincent avatar Nov 08 '17 01:11 wincent

is.vim has a similar config option

I also find it useful (it doesn't seem to chain with loupe like shown in that link, however)

jaydorsey avatar Feb 21 '20 04:02 jaydorsey

I added these lines in my ~/.vim/after/plugin/loupe.vim:

nmap <silent> * <plug>(LoupeStar)``
nmap <silent> # <plug>(LoupeOctothorpe)``

sanpii avatar Oct 19 '20 18:10 sanpii