1

I have the following situation. If I open a file in Vim, say by running vim myfile.tex, select something in visual mode, and do "+y, it is in the system clipboard as one would hope. If however I open a project, say vim -S myproject.vim, in which the same files are open, "+y does not change the system clipboard. This behavior is actually new; it did not do it before yesterday. I did not to my knowledge change anything in the configuration in the intervening period.

My current default Vim does return -clipboard among other things from vim --version, so I suppose I am lucky it works in even setting, but I am reluctant to switch to a different version of Vim because I switched to the present one because another extension was broken. The computer is running Ubuntu 22.04.

jdc
  • 141
  • 3
  • 2
    Which platform are you using? Did you close the Vim window before you tried to paste things? – Martin Tournoij Sep 22 '22 at 13:16
  • No, I know how to do that. The issue initially was that that vnoremap Y "+y was not behaving as expected, but I realized afterward that generally, "+yy was not functioning, but only within a project, like vim -S myproject.vim; in the context vim myfile.tex it was working just fine. I have checked :vim --version on both versions, and it comes up with -clipboard, so one wouldn't expect it to work at all, but it does work consistently when I simply open a file. – jdc Sep 23 '22 at 14:58
  • @MartinTournoij, my apologies, I wrote a response yesterday and then presumably lost connection before I hit "Add comment." I am using Ubuntu 22.04. I had not closed the terminal tab running Vim. – jdc Sep 23 '22 at 15:00
  • 1
    Might be worth trying How to debug my vimrc on your vimrc and on the session file – D. Ben Knoble Sep 23 '22 at 15:26
  • If it has -clipboard and still changes the clipboard then it has some mapping for y; 2. If it only works after -S foobar.vim then &ssop has options flag set and that mapping was saved into session file (but it's not in vimrc).
  • – Matt Sep 26 '22 at 15:53