3 ms·
Apart from Emacs and Unix in general, lately I've come to depend on some simple readline shortcuts in bash: $ cat ~/.inputrc "\e\C-k": shell-kill-word "\e\C-a"
by unhammer 10y ago
Apart from Emacs and Unix in general, lately I've come to depend on some simple readline shortcuts in bash:
$ 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
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
while true; do ( make -j && grep foo|sed 's,b,x,g'|./run ); inotifywait -q -e modify -e close_write ; done
meaning whenever I save a file in that directory, the command runs again.
- nathyong 10y agoLooks like some of your text got a little mutilated by the pseudo-markdown parser; perhaps copying that into a gist or paste would be better? I'm really curious what some of what you've copied does.
- unhammer 10y agoSorry, that was quite unreadable! My full inputrc is at https://gist.github.com/unhammer/130df5f3ebf61724d36f60c4bb19ba97 https://gist.github.com/unhammer/130df5f3ebf61724d36f60c4bb1...