To enter and edit complex commands, you may like to work directly in the command prompt window, which is accessed by the q: normal mode command. See :h 20.5 and :hq: Or, if you are already in command mode, you can access the command line window using Cf
- For example, in normal mode, enter
q: to enter the command prompt window. (or enter Cf from command line mode. - You can move previous commands using standard movements, and you can edit them as usual.
- When you want to execute the command that you just edited, press
enter normally in this command window. The line where your cursor is located will be executed as a command in
in which you were before opening a command prompt window.
Another possibility to consider is to edit / remove a command from another buffer. You can do this by pulling the desired text and inserting it into command mode by typing CR n , where n is the register you pulled at.
BTW: I like the comparisons provided by @rks. But if you do not have these mappings, you can use the commands out of the box. Find :h c_<S-Left> and :h c_<S-Right> and :h 20.1 .
source share