Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ?

like image 614
Jeanluca Scaljeri Avatar asked Apr 17 '14 08:04

Jeanluca Scaljeri


People also ask

How do I terminate a zsh command?

Pressing Enter on an empty line: execute: _ zsh: do you wish to see all 373 possibilities (64 lines)? In other shells, Alt + X brings the same behavior, except that Ctrl + C cancels the prompt.

What does ctrl t do in bash?

Alt+T: Swap the current word with the previous word. Ctrl+T: Swap the last two characters before the cursor with each other. You can use this to quickly fix typos when you type two characters in the wrong order.


1 Answers

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

like image 75
Navin Avatar answered Sep 22 '22 07:09

Navin