简体   繁体   中英

Is there any Ctrl - R kind of command search in vim?

we have Ctrl - R command to quickly search bash command history. Is there any similar command to use in vim command history & also search history.

Don't have enough rep to comment, but in regards to your question about search history:

You can use q/ just like q: to view the search history.

Alternatively you can press CTRL-F from command or search mode to bring up the history.

No. But you can use q: to open the command history window, where you can edit and execute previous commands, and search for them, just like in a regular buffer (use / and friends to search there).

Ctrl-R in Vim is reserved for something else entirely (accessing registers from insert or command mode, redo in normal mode).

There is a plugin I have made that does exactly what Ctrl-R does on the shell, to use it you start command mode and type Ctrl-R and just start typing your search. If there's anything typed before invoking it though it assumes default command mode Ctrl-R functionality.

https://github.com/goldfeld/ctrlr.vim

To recall a previous command or search, start command or search mode ( : or / , respectively) and start typing the beginning of whatever past line you're looking for. When you think you've supplied enough to search for, hit Up to go back through previous commands or searches that started with that string.

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