In bash shell, alt + .
inserts the last argument of the previous command.
and there are alt + (number) + .
and alt + ,
variations.
I like to do the same while editing shell script in vim, i.e.
I want to insert the last word from previous line when I press alt + .
in insert mode.
(alt + ,
as well if possible. alt + ,
after alt + .
changes the last word to 2nd last and 3rd, and so on)
Line continuation using back slash is not considered at the moment and just the previous line as shown on the screen.
How can I do this? Is there a plugin for this?
k$yawj$p
); interactively, I’m more likely to use!$
which expands to the last word of the last command with history expansion enabled.