Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim paste before cursor [duplicate]

Tags:

vim

I have a selection in a register that includes no new lines. For example:

Happy-

I would like to paste this selection at the start of a line. Say for example:

New-Year

To result in:

Happy-New-Year

Since New-Year is at the start of a line, the leftmost I can place my cursor is over the N:

[N]ew-Year

If I press p in normal mode, I get the following:

NHappy-ew-Year

Is there a variation to p that I can use to paste before my cursor?

like image 741
Sam Berry Avatar asked Aug 27 '26 19:08

Sam Berry


1 Answers

As often, capitalization makes the difference: p pastes after, P pastes before.

like image 72
L3viathan Avatar answered Aug 30 '26 07:08

L3viathan