Possible to use modal editing inside Vim’s command-line mode

command linevim

Vim's normal and insert modes are wonderful. A source of constant frustration for me is that whenever I enter command-line mode for entering Ex commands (by pressing 🙂 suddenly I lose all the niceness of modal editing and wind up with a set of totally different (and comparatively lame) shortcuts that don't correspond to normal-mode OR insert-mode. Is there any way to enable standard modal editing of ex commands on the Vim command line?
This would also be nice for / searching, etc.

Best Answer

Vim actually has several modes, of which normal and insert are just the most obvious. So to say...

To enter the command-line window from command-line mode (the mode you're in after you press :), press Ctrl-F. Now you're in the command-line window, where you can write up a command just like in insert, and edit it kinda like in normal mode. Enter will execute the command.

An example:

press : ("to get into" cmdline)
press Ctrl-F
press a
write echom "Hello world!"
press Esc
press Enter

It will echo' the "Hello world!" on the commandline, just like as if you've written that command from the cmdline.

Does this make any sense?

Related Question