Apart from Emacs and Unix in general, lately I've come to depend on some simple readline shortcuts in bash:<p><pre><code> $ cat ~/.inputrc
"\e\C-k": shell-kill-word
"\e\C-a": "awk 'BEGIN{OFS=FS=\"\\t\"; } { }'\C-b\C-b\C-b"
"\e\C-w": "\C-w\C-y > /tmp/temporary-inputrc && mv -f /tmp/temporary-inputrc \C-y"
"\e\C-f": "find . -type f -print0|while read -rd '' f; do ; done\e-b\C-b\C-b\C-b\C-b\C-b\C-b"
"\e\C-i": "\C-awhile true; do ( \C-e ); inotifywait -q -e modify -e close_write *; done\e51\C-b"
"\e[A": history-search-backward
"\e[B": history-search-forward
"\ep": history-search-backward
"\en": history-search-forward*
</code></pre>
<i>So if I've typed "make -j && grep foo|sed 's,b,x,g'|./run", and then hit ctrl+alt+i, that'll turn into</i><p><i>while true; do ( make -j && grep foo|sed 's,b,x,g'|./run ); inotifywait -q -e modify -e close_write </i>; done<p>meaning whenever I save a file in that directory, the command runs again.