zsh shortcut 'ctrl + A' not working
zsh .zshrc
bindkey "^A" vi-beginning-of-line
you don't have to config the Ctrl+A behavior if you use default keymap (emacs
keymap). It does what you are expecting.
However if you set your zle to use vi
keymap, you have to define the keybind
for vi-beginning-of-line
. same for Ctrl+E.
So check which keymap did you set in config. If it was vi, try pressing ESC then ^ and $ should do what you want.
If you're wondering why this happened: You likely have $EDITOR
or $VISUAL
set to vi/vim which made zsh default to the vi keymap which doesn't use ctrl+a for moving the caret.
Adding bindkey -e
to ~/.zshrc
will restore the old behavior (emacs keymap).