When I use "yy" and paste, when I paste it pastes one line below where my cursor is, is there a way to paste on the same line?
Thanks in advance!
When I use "yy" and paste, when I paste it pastes one line below where my cursor is, is there a way to paste on the same line?
Thanks in advance!
yy yanks the entire line, including the newline, which is why p pastes below. You may instead want to copy the current line without the newline, which can be done with ^y$. This moves the cursor to the beginning of the line and yanks until the end. You can then position the cursor wherever you like and paste as normal.
If what you want to do is paste at the end of the current line, a shortcut could be to use yy as normal, paste with p, then join the two lines with J or gJ.
To paste below cursor, use p and to paste above cursor use P (shift + P of course)