Is there a way to start each new prompt in Vi "command mode" instead of "insert mode". I do not want to press Esc every time.

  • what do you mean by starting each new prompt – Bharat Apr 17 '18 at 12:13
  • @Bharat They want the default mode of the command line editor to be "command mode" rather than "insert mode" when using Vi command editing mode. – Kusalananda Apr 17 '18 at 12:57

The solution to this is actually found in the zshzle (or zshall) manual:

zle-line-init() { zle -K vicmd; }
zle -N zle-line-init

This will always put the command line into Vi command mode for each new prompt.

  • 1
    Just info zsh zle-line-init (or i and then zle-line-init with completion within info). Using man for manuals this size is masochism. – Stéphane Chazelas Apr 17 '18 at 14:49
  • @StéphaneChazelas Thanks! Remember, I'm not a zsh user ;-) – Kusalananda Apr 17 '18 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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