shellkeyboard-shortcutszshshortcut

zsh shortcut 'ctrl + A' not working


I recently switch from bash to zsh shell. To be more precise, the oh-my-zsh Very nice, but the shortcut I most often use; jumping to the beginning/end of the line doesn't work anymore. From the docs it should be

ctrl + A --> beginning
ctrl + E --> end

However, when I do that I get the following

$~> my-command
$~> my-command^A   # did a ctrl + A here

Although I see this working by everybody else, on my system something seems to be different. Any suggestions what that might be ?


Solution

  • 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.