I have a habit of copying lines of text across files by yanking it, closing Vim, starting Vim with the target file, then p
. However, earlier today Vim started to forget that I yanked whole lines of text and started pasting it after the character.
For example, if I have a file with just one line of abcd
, when I hit yy
then p
, it becomes two lines of abcd
. When I hit yy
, exit and restart Vim, then p
, it becomes one line of aabcdbcd
.
I have not touched my vimrc for months and looking in my home directory for recently modified files, I couldn't find anything related to Vim. I have tried deleting ~/.viminfo
and the undesired behavior persists. How can I restore Vim to its old behavior?
This is Ubuntu's stock Vim:
# vim --version
VIM - Vi IMproved 9.1 (2024 Jan 02, compiled May 03 2024 02:45:42)
Included patches: 1-16
# apt list vim-nox
vim-nox/noble-updates,now 2:9.1.0016-1ubuntu7.1 amd64 [installed,automatic]
I'm working over SSH from a Windows 10 PC, using Windows Terminal and Win10's stock OpenSSH, and this Vim runs inside a tmux session.
viminfo
option, but there doesn’t appear to be a tweak for this. I wonder if it could be a bug; are you able to build from source and bisect? What version are you using?vim --clean
? I wonder if it might be related to some plug-in or clipboard integration you might have in your vimrc or other initialization config filevim -u NONE
which disables the initialization via vimrc, perhapsvim -u NONE --noplugin
, it turns out-i
disables loading viminfo so that wouldn't help, but you can disable vimrc and plugins to see if that has an effect as expected