Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Here's a dumb question: most *nixes come with vi as the text editor, but the shell uses emacs keybindings. Why is that?

(btw, if you learn emacs well enough, you're commandline-fu goes through the roof)



"the shell" usually means (on modern Linux distros) bash, which is the "GNU Bourne-Again SHell".[0]

Brian Fox[1] developed the readline library to handle bash's interactive input. Between Brian Fox having been an Emacs maintainer, and bash being a GNU project, the keybindings followed suit...

Had bash been "Bill Joy's[2] Awesome SHell," things might have gone differently :-) Well, it would've just been csh[3] (written by Bill Joy.)

[0] I address this introduction to anyone not already "in the know."

[1] http://en.wikipedia.org/wiki/Brian_Fox

[2] http://en.wikipedia.org/wiki/Bill_Joy

[3] http://en.wikipedia.org/wiki/C_shell


Actually the keybindings can be changed to those of vim (by typing "set -o vi" on terminal). It is probably not set as default as it is confusing to new users.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: