Vi: how can I paste the last string of text that I entered when I was in insert mode?

4

How can I paste the last string of text that I entered when I was in insert mode? I think I've done this before on accident but I can't recall how.

James

Posted 2011-09-24T03:07:24.837

Reputation: 4 189

Answers

7

I believe the command you're looking for is simply . (period/full stop key). It's a normal mode command, so simply press the key in normal mode.

Wuffers

Posted 2011-09-24T03:07:24.837

Reputation: 16 645

Sorry - but what is <c-a> because CTRL-a didn't work for me ... – Felipe Alvarez – 2014-06-20T06:10:50.177

3. in normal mode will repeat the last change. If you want to paste the last inserted text it can be found in the . register. e.g. ".p In insert mode to insert the last inserted text use <c-a> – Peter Rincker – 2011-09-26T14:13:27.750