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?
Paste the line by pressing p . That will put the yanked line right under your cursor (on the next line). You can also paste before your current line by pressing the capital letter P .
Highlight the text you want to copy. Use the shortcut key combination Ctrl + C on a PC or Command + C on a Mac to copy the text. Move the text cursor to where you want to paste the text. Press Ctrl + V on a PC or Command + V on a Mac to paste the text.
Therefore, the key sequence would from command mode, A to get into insert mode at end of line, <space> to insert a space, then Ctrl-v to paste. Alternatively, while in insert mode, use the mouse to put the cursor at the end of a line, <space> then Ctrl-v .
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.
The Edit menu in gvim lists the following:
Paste = "+gP
Put Before = [p
Put After = ]p
If you're running vim in Windows, you can do the following to get Ctrl+C and Ctrl+V to work as expected:
source $VIMRUNTIME/mswin.vim behave mswin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With