I posted this somewhere else once. Here it is now for the Antergos forums:
I’m starting with
This file is used by the Readline library, which is the library used by all Bash shells to control the command line.
1. history search with up and down arrow keys
This one somewhat common, but I am still surprised to see so many users without it. The up and down keys work up and down the shell history even during command completion. The last two lines aren’t needed on many shells. But they fix a problem on other shells where you were not able to move left and back between characters with the cursor keys.
2. ctrl-right and ctrl-left keys move between words
Useful if you are not an emacs or vi person. Also useful if you are.
3. single tab for completion; complete the word as far as possible and show remaining possible completions
set show-all-if-ambiguous on
This one fixes a common annoyance in bash, in which we are forced to double tap the TAB key to trigger completion. Well, not anymore! It does to things: From now on you just need to hit TAB once (yey!) and it also completes a command as far as possible before showing further completion options.
4. invoke man page for the command in the current line with alt+h
"\eh": "\C-a\eb\ed\C-y\e#man \C-y\C-m\C-p\C-p\C-a\C-d\C-e"
It doesn’t matter where you are in the command line. Having trouble with a command you are typing? Can’t remember some of its options? Hit ALT+h to invoke man for that command and when you return it will still be there waiting for your input.
5. automatically add sudo to the beginning of the line with alt+s?
Similar to the above, it doesn’t matter where you are in the command line. Forgot to write
sudo at the beginning of the command line? Then just hit ALT+s and continue typing your command.
If you look carefully at the two commands above, you can use them to make your own new key triggers. Have fun.
~/.bashrc on the next post…