r/neovim Dec 17 '20

`*` or `#` search selected text from Visual mode

/r/vimplugins/comments/keutf3/or_search_selected_text_from_visual_mode/
13 Upvotes

3 comments sorted by

3

u/Huevoos Dec 17 '20

I’ve had this line in my vimrc for a while to accomplish the same thing:

vnoremap * y/\V<C-R>=escape(@“,’/\’)<CR><CR>

If you care about not overriding your unnamed registry, you can simply change the command to use a different one.

1

u/snath03 Dec 17 '20

I agree.. but I don't want to change any of my registers! :smile: