recentpopularlog in

Copy this bookmark:





to read

bookmark detail

Quick Tip: some .inputrc fun - BrettTerpstra.com
You can also bind a key to glob-expand-word which will take a bash glob -- say * -- and replace the glob with all the files that match that glob.
<code>set bind-tty-special-chars on
set mark-symlinked-directories on
set prefer-visible-bell on
"\C-w": unix-filename-rubout
"": unix-filename-rubout
"\C-x*": glob-expand-word</code>

The bind-tty-special-chars is so that I can use C-s and C-r to search forward and backwards, respectively, in my command history. Normally C-s taken over by the tty but by enabling bind-tty-special-chars and also putting this,
<code># this is a bugfix for certain terminals so that all eamcs bindings
# work.
if [ -t 0 ]; then
stty stop undef
stty werase undef
fi</code>
In Bash, there are some great but lesser-known default bindings. You may know that Option-. will insert the last argument of the previous command (e.g. running ls ~/Desktop and then typing cd and pressing Option-. will turn it into cd ~/Desktop), but did you know you can actually yank the argument at any index from the last command (without using history or ! operators)?

Just press Option-[#], where # is the position of the argument you want, then type Option-. to insert it in the current command.
commandline  terminal  cli  inputrc  configfile  rubout 
april 2013 by kme
view in context