up vote 6 down vote favorite
2
share [g+] share [fb]

I have been convinced (over at Stack Overflow) to use my beloved bash in vi mode. So far I got used to it quite well and I like it.

However I really do miss one feature: In emacs-mode, you can enter the last parameter of the previous command by pressing "ESC ." (That is, press escape followed by the .)

Is there a default binding to insert the last parameter in vi-mode? I wasn't able to find one and I really miss this command...

link|improve this question
feedback

4 Answers

up vote 4 down vote accepted

There's no default. The binding for 'yank-last-arg' (as listed by 'bind -p') disappears when you switch to vi mode.

bind '"\e."':yank-last-arg

will give you that same binding back (or pick something else)

link|improve this answer
Thanks... guess, I'll have to rebind it then – Mo. Aug 5 '09 at 14:27
feedback

Not exactly the same, but in either mode you can type !$, and it will be replaced by the last word of the previous command. Find more such things in the manual.

link|improve this answer
Close enough to get an upvote but not exactly the same... I miss the possibility to edit the line before executing it. But thanks alot anyway! – Mo. Aug 5 '09 at 14:17
feedback

There's (vi-yank-arg), by default mapped to "_". That should do what you want (in command mode).

link|improve this answer
feedback

here is a good list of special bash parameter . I found this while searching meaning of $@.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.