|
|
|
|
|
by austintaylor
5245 days ago
|
|
Whether it pastes a newline or not depends on whether you yanked one. I guess this is what you mean by "vim preserves new lines". Don't all editors work this way? If you want to yank a line character-wise, you would do something like ^y$. I have Y mapped to y$ for this sort of thing. You cannot yank a substring of a line line-wise. That doesn't really make sense. I typically open a new line with o and then paste in insert mode with <C-r>". So o<C-r>". |
|
Seems like my description was incorrect. I meant that there are two ways to deal with text: line-wise and fragment-wise.
In most other text editors, if you copy a line, and then paste it, it gets pasted into the cursor position regardless whether you copied a line or a fragment (fragment-wise). In Vim, lines yanked with 'yy' disregard the cursor column and get pasted into a line above or below, while fragments yanked with 'y' (e.g. '0y$'), take into account the column.
I like how in Vim you can do line-wise editing, but I just miss an easy way to paste text to the position starting with the current column regardless of the way I yanked it.
PS Thanks everyone for replies!