3

File:

1111
2222
3333
4444

If I yyP on 2222, the system clipboard is pasted in, not 2222 as expected. However, :reg shows that 2222 was saved to register 0 and ". I expected it to save to th

If I ddP on 4444, everything works as expected: That line is deleted and then 4444 is pasted. So, it seems delete is working as expected, but yank is not.

My current solution is to use delete then undo until I figure out why yanks aren't working.

Notes:

  • vim version 8.1
  • Windows 10
  • _vimrc does not have set clipboard=unnamed.
  • Also, interestingly, delete not only saves to a vim register, but also to the system clipboard. My impression is that this is abnormal, but I do prefer it this way.
1
  • I typed :set clipboard in command mode and it said clipboard=unnamedplus. I changed it using :set clipboard=unnamed and now vim yanks to the system register, and indeed :set clipboard returns unnamed. However, when I put set clipboard=unnamed in my _vimrc file, it doesn't take effect. Vim is still starting with unnamedplus. Why is this?
    – JDG
    Nov 30, 2018 at 8:06

1 Answer 1

5

For some reason, editing _vimrc in the Vim file wasn't working. From within vim, if I used :e! $MYVIMRC to change the file, everything worked out.

I removed set clipboard=unnamedplus and the behavior is now back to normal. Whew!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.