Remiss for not mentioning "rlwrap": <a href="https://github.com/hanslub42/rlwrap">https://github.com/hanslub42/rlwrap</a><p>...basically "readline in a can" that you can use to improve text input of other programs.<p>I forget if it was RMS or ESR that really wanted to hold "readline" away from corporations, so it's licensed as GPLv3 (not v2), and he explicitly wanted it to _not_ be LGPL (ie: embeddable).<p>My crazy readline/bash tip is `ESC, .` (or maybe `alt+.`, I'm not 100% sure, random search result here: <a href="https://gist.github.com/tuxfight3r/60051ac67c5f0445efee" rel="nofollow">https://gist.github.com/tuxfight3r/60051ac67c5f0445efee</a> ). Basically it up-arrows through the last "word" of previous commands, adding it to the current command.<p>Example:<p><pre><code> mkdir foo
cd `esc, .` => cd foo
vim bar.txt
cp `esc, .` baz.txt => cp bar.txt baz.txt
</code></pre>
It's crucial in that it reduces the number of keystrokes, and avoids typing errors completely, as you're "recalling" something rather than re-typing.<p>I'm also in the same boat as the author in that `set -o vi` doesn't quite do it for me (although I consider myself an expert in vi). What I tend to do instead is:<p><pre><code> C-a # <cr> => go to the beginning of the line and insert a comment char
fc => "fix command", see "help fc" (it's a built-in)
</code></pre>
...basically it invokes: `$EDITOR "$( history | tail -1 )"` and whatever you save/quit will get executed as a command.<p>This lets me intentionally "damage" a command, but then get into `vim` to "fix it up" (eg: `dw, cw, df/, etc...`). Remove the comment from the beginning of the line to execute it, or keep it there to take the command back "out" of `vim` so you can keep building it up.