3 ms·
This is a description of the Emacs bindings, which are the default. Vi bindings are also available and can be enabled by adding set -o vi to ~/.bashrc. P
by julian37 14y ago
This is a description of the Emacs bindings, which are the default. Vi bindings are also available and can be enabled by adding
set -o vi
to ~/.bashrc.
Peteris Krumins also has an article on bash command line editing with some extra information on completion:
http://www.catonmat.net/blog/bash-emacs-editing-mode-cheat-sheet/ http://www.catonmat.net/blog/bash-emacs-editing-mode-cheat-s...
- alxndr 14y agoBeat me to it. (My first thought upon seeing the headline was, "wow, faster than vi mode?") I haven't actually put the set into my .bashrc yet, I just end up typing it when I realize I'm about to navigate a lot.
- chimeracoder 14y agoSemi-related, but what's the fastest vi way to get to the space right after the first word? For example, I might type > ls /etc/foo/bar and have my cursor at the end when I realize I want to type ls -l instead. I know there's got to be a faster way than what I'm currently doing, but I'm blanking. (Yes, I know sometimes tacking on the command line switch at the end will work, but that's not true for all commands).
- wumpushunter 14y agoShift-T (the opposite of up`t`o) and then `s`. You can hit `;` if there are multiple incidences of 's'.
- weaksauce 14y agojj0W that should work for commands without spaces in them. I remap jj to escape so it is faster than moving my hand. in ~/.inputrc set editing-mode vi $if mode=vi #normal mode set keymap vi-insert "jj": vi-movement-mode $endif