Command-line window
From Vim Tips Wiki
Tip 928 Previous Tip • Next Tip
Created: May 11, 2005 Complexity: basic Author: Wim Coenen Minimum version: 5.7 Karma: 272/90 Imported from: Tip#928
When you hit : to enter a command, or / to start a search, you often want to edit a previous command or search. That can be done using the up and down arrow keys to scroll through the history. Then you can edit a previous line – see :help :.
A superior solution is q: or q/ which gives you a command or search editing window with all Vim's normal editing power.
Related to this is the 'cedit' key, which defaults to <C-F> – see :help 'cedit'. While on the command/search line, you can use the key specified with the 'cedit' option to switch to the command editing window.
You might consider
:set cedit=<Esc>
so you can press Esc to go to the command/search window from the command/search line.
If you always want to use the command editing window, you may experiment with mappings like:
:nmap : q:i :nmap / q/i :nmap ? q?i
Use <Ctrl-C><Ctrl-C> to cancel a search started with the above mapping.
