Reputation: 7433
How do I paste the text into the middle of a line of text?
Upvotes: 0
Views: 3037
Reputation: 3159
The steps you mentioned above should actually paste the yanked characters to the position where the cursor is while pasting. So I believe there are three possible reasons for getting pasted into the newline.
Possibly one of your plugins/mappings is playing the devil here. Just try to use vim without any plugins or anything by running (clean equivalent to "-u DEFAULTS -U NONE -i NONE") and see if it's getting pasted as intended:
vim --clean
You have yanked the last characters of a line including the newline. Quite possible right? Like the last character of each line is a newline. So yanking and pasting those characters(including newline) to another line means the same newline is pasted into the "another line".
A variant of the above, is when you yank using yy
(that is yank the whole line) , then definitely while pasting it would go into a newline.
Hope this helps you somehow. Cheers!
Upvotes: 1