I'm using vi mode with zsh, but I'm stuck in moving to start of current command when there are multiple lines in it.

With 0, it just moves to the start of current line rather than current command.

Is there any way to achieve that?


It's gg in command mode like in vim to move to the start of the editing buffer:

$ bindkey -M vicmd | grep begi
"^[[1~" vi-beginning-of-line
"0" vi-digit-or-beginning-of-line
"gg" beginning-of-buffer-or-history

(that ^[[1~, the escape sequence sent upon Home in my terminal emulator was added by my distribution config file, the two other ones are standard in zsh).

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.