$ set -o vi
This command changes the key bindings to vi's. If vi's your favorite editor, you'll love this. I'll cover the vi mode in more details in the next part of the article.
I'd love to find a cheat sheet for vi bash usage (and also an indicator for which editing mode I'm in).
This has made me even happier than learning I could get vim key bindings in vim's own command-line mode. Thanks again!
(C-f from command-line mode, or q: from normal)
Luckily, zsh actually allows you to change your prompt when the mode changes. I have mine set up to change the color of part of it whenever I'm in command mode. Definitely worth setting up.
In zsh, you can type: "bindkey" to get a listing. IIRC, in bash it is "bind -p".
shopt -s histappend
This is also pretty neat, in your .bash_proflie:
These are the first things I do when I'm on another terminal.
I've been using the remap of the up/down arrow for a while too, and it is crazily useful indeed. It's the first thing I do on a new terminal. That, together with adjusting PS1 and setting up my common aliases.
Any other tips? These two were brilliant!
> When this variable is assigned a value, the history file is truncated
Which I read as meaning if you export the following then you should get infinite entries:
To go to the previous space, Ctrl+R SPACE works for me.
Been using Emacs for a year and I didn't know this. O_o
In OSX you can set it up in keyboard preferences and in Windows I use Autohotkey.
Working on a keyboard with a regular Caps Lock key feels very strange after all this time.
In iTerm  I have the left alt/option key setup as meta, so things like meta-b are much easier to type then Esc-b.
 "You'll often see Meta+b but there is no such key on the keyboards anymore."
 Profiles -> Keys "Left option acts as meta"
One shortcut that used often is Ctrl-o. When you have a few commands in your history that you want to repeat in that seqeunce, search for the first command in the group, optionally edit it if you want, and press Ctrl-o instead of the ENTER key.
After this command is executed, the next command in the history is presented to you. Press Ctrl-o again to continue the sequence, or press ENTER once you reached the last command in the sequence.
If you want skip a command in the sequence, instead of Ctrl-o just press Ctrl-n (or down-arrow) to get the next one in sequence.
Control-q: push-line-or-edit -- this saves the current command without executing it, allows you to run another command, then puts back the saved command for you to edit/run.
Esc-A: accept-and-hold -- execute command and maintain cursor position, so you can edit command and re-run.
Esc-' : quote-line -- escapes the single quotes in a line.
Old Vim user here, who has used emacs mode since moving from ksh to bash for about 8-10 years. Recently, switched back to vi mode, however, I have mapped Ctrl-A, Ctrl-E and a few more so i can use them in vi mode too. e.g.
bindkey "^A" beginning-of-line
oh, this is the first time I've seen this: there is a vi mode for bash