How to paste in the line where the cursor is?

Kitcha picture Kitcha · Feb 21, 2012 · Viewed 28.3k times · Source

The command p pastes below the cursor and P pastes above the cursor. What's the command to paste in the line where cursor is?

Answer

Randy Morris picture Randy Morris · Feb 21, 2012

This all depends on the type of data in the register you're pasting. If the data is line-oriented data (yanked with yy for instance) it will be pasted as a whole line above or below the cursor. If the data is character-oriented (yanked with e.g. y2w) then it will be pasted at or before the cursor position in the current line.

See :help linewise-register for more info on the interaction between the type of register and the put command.