search - Searching using previously defined keywords in Vim -


there keywords search throughout project. use search this: put keyword "register", after while (i may or may not use regular search during time) want search keyword in open file. load register , n/n movements work usual, search keyword have loaded.

is possible?

you can exactly want, actually.

vim has 26 "named registers" (a-z) can use recording macros or storing text. can use these registers part of commands, example copy word under cursor register 'a', type "yiw in normal mode. can assign them directly, example put word "snarfblat" register 'b' use :let @b='snarfblat' (and press enter).

once have text in register, can retrieve in search using ctrl+r , pressing register want retrieve. in case search contents of register 'a' start search /, press ctrl+r followed a insert register text, press enter search normal.

see :help registers details.


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -