in bash in gnome terminal in Ubuntu, the command line editing commands are by default emacs-style, and can be changed to vim-style.

In bash in the terminal emulator of Mac, the emacs-style commands don't work. Are the commands just those of a regular text editor?

  • n defaultI Terminal and all Coca OSX apps you can edit using emacs keys e.g. Ctrl A and E for begin and end of line. The terminal editing is allowed by the shell which now defaults to bash. The terminal in OSX and gnome terminal does not provide the command line editing
    – mmmmmm
    Jun 7 '16 at 22:11
  • Thanks. commandline editing feature is provided by shell here bash not by the terminal emulator. I will update the post.
    – Tim
    Jun 7 '16 at 22:16

OS X ships with bash and you will want to set -o vi to get vi-style commands. A very popular choice is zsh and the many customization packages like oh-my-zsh. Neither she'll is fully in either style by default.

For emacs style, it's similar - see this great post for more details:

You switch between the two modes in bash, zsh or ksh with set -o vi or set -o emacs, and with bindkey -e or bindkey -v in tcsh or zsh.

  • 1
    I want to use emacs style. is the command set -o emacs?
    – Tim
    Jun 7 '16 at 22:27
  • @tim. Yes. See the edit and linked article
    – bmike
    Jun 8 '16 at 11:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .