3

Normal mode is also called command mode, and is different from command line mode.

It seems both can be used for : commands, but what is the difference?

2 Answers 2

6

: is a normal-mode key-sequence (command) that makes a switch into one of command-line submodes.

From :h :

Command-line mode is used to enter Ex commands (":"), search patterns ("/" and "?"), and filter commands ("!").

So in command-line mode : is just a prompt that shows you're allowed to input one Ex-command and then get back to the Normal mode (so it differs from the true Ex-mode).

3
  • 1
    I see, I know both modes pretty well, but confused myself severely when reading the help, it seems... I assumed command means the same in both mode names, but only one of them means ex command. And there would be good reasons to call ex mode the normal mode, because it existed before command mode. Nov 26, 2019 at 7:13
  • 1
    @VolkerSiegel For that reason we'd have called "vi-mode" instead of "normal" mode. But nowadays "vi-mode" is really "normal", while "true Ex" is almost never used.
    – Matt
    Nov 26, 2019 at 7:24
  • 1
    Yes, "vi-mode" is the right name. I suspect scrolling randomly through vim help is inherently risky... (I feel very ''at home" in vim, and normally in the help too...) Nov 26, 2019 at 7:37
6

Normal mode is the mode you are in when you start Vim and the mode you should spend the most of time in. From this mode you can easily invoke other modes (v for visual, i for insert, : for command line and so on).

Everything you press in normal mode can be some sort of command. dd? It's a command saying "delete current line". Hence command mode.

In command line mode you use Ex and search commands, like :s/a/b/g or /pattern. For them to take effect you need to press "Return"* (after which you get back to normal mode - there is also Ex mode, where after pressing "Return" you stay in command line).

In big approximation: normal (command) mode is for keybindings and command line is for "shell" commands (similarity to Bash, Zsh, sh, CMD etc.)

* return, enter, <CR>

1
  • I know both modes pretty well, but confused myself severely when reading the help, it seems... I assumed command means the same in both mode names, but only one of them means ex command. And there would be good reasons to call ex mode the normal mode, because it existed before command mode. And good reasons to call normal mode vi-mode. I suspect scrolling randomly through vim help is inherently risky... (I feel very ''at home" in vim, and normally in the help too...) Nov 26, 2019 at 7:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.