VIM: How do you get the last ex command you used?

Posted by TrevorBoydSmith on Super User See other posts from Super User or by TrevorBoydSmith
Published on 2011-01-08T16:17:06Z Indexed on 2011/01/08 16:55 UTC
Read the original article Hit count: 252

I find that sometimes I write a really long ex mode command that do lots of stuff. They are sort of "mini-scripts" that I write in the text editor then I start ex mode and copy them into the ex line and execute. But then I always end up editing in the ex mode and then I find it difficult to get the changes i did in ex mode back to my text editing session.

Using the keyboard, how do you copy the last ex command you used and paste it into your text editor?

(Note: This is sort of the opposite of this question "how do I copy/paste in vim ex mode" where the user asks "how do you copy from the text editor and paste INTO the ex mode?". My question is the opposite because I wish to copy from the ex mode and paste into my text editor.)

© Super User or respective owner

Related posts about keyboard-shortcuts

Related posts about vim