Named searches in Vim?

Is there a way to save the search pattern in a register and then call it using some quick command?

I think about how vim uses the named registers with q and @, and named labels with m and '.

+3
source share
1 answer

Enter the search pattern into the buffer somewhere, then yank / delete it in the register. Use ctrl-r + x at the search prompt (/) to get case x.

If you have already searched for a pattern, use :let @x=@/to assign it the register x.

+5
source

Source: https://habr.com/ru/post/1772156/


All Articles