Recover last argument of the last command in bash' vi mode
I've been using _
(in normal mode) to do that.
I've found it documented here http://www.catonmat.net/download/bash-vi-editing-mode-cheat-sheet.txt .
It's easy to remember too:
$_
expands to the last argument<Esc> + _
types it out
For me it works when I add the following to my .inputrc
:
$if mode=vi
"\e.":yank-last-arg
$endif
Then, when changing it in bash on the fly, the .inputrc
must be read again:
set -o vi
bind -f .inputrc
Now, I can get the last argument with alt+..