You are not logged in.

#1 2017-10-19 07:19:26

GloW_on_dub
Member
Registered: 2013-03-13
Posts: 391
Website

[Solved] Vim pasting yank register when opening a new file.

For a few weeks, I have the strangest issue, on a single computer.
On this computer, when I open a file with Vim, the yank register have a low chance of being pasted on the current position of the cursor, with the number "2" after it.

Eg :

myFile.cxx

#include <algorithm>
#include <iterator>
#include <set>
#include <cmath>

my yank register

irrelevant code

myFile.cxx after i open it

irrelevant cod2
#include <algorithm>
#include <iterator>
#include <set>
#include <cmath>

I suspected a bug in my .vimrc configuration so i minimized it, but the bug is still present. Here is my current .vimrc, without any .vim folder present.

:syntax on        "Turn on syntax highlighting
:set laststatus=2 "Always show status line
:set tabstop=2    "Number of spaces a TAB in the text stands for
:set shiftwidth=2 "Number of spaces used for each step of (auto)indent
:set hlsearch     "Have vim highlight the target of a search
:set incsearch    "Do incremental searching
:set ruler        "Show the cursor position all the time
:set number       "Show line numbers
"Converting tabs to spaces
:set expandtab
:set background=dark

The bug appears only after some time of usage after booting and using vim. Once it starts appearing, the chance of seeing it are quite low, but not negligeable, however I have a hard time reproducing it voluntarily.

Last edited by GloW_on_dub (2017-10-20 09:15:44)

Offline

#2 2017-10-19 07:25:08

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] Vim pasting yank register when opening a new file.

Why do you have colons in front of every option in your rc file?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2017-10-19 07:29:13

GloW_on_dub
Member
Registered: 2013-03-13
Posts: 391
Website

Re: [Solved] Vim pasting yank register when opening a new file.

TIL you do not need colon in .vimrc

I removed them (and the bug still showed up.)

Last edited by GloW_on_dub (2017-10-19 07:30:21)

Offline

#4 2017-10-19 07:32:33

GloW_on_dub
Member
Registered: 2013-03-13
Posts: 391
Website

Re: [Solved] Vim pasting yank register when opening a new file.

So i just reproduced the bug, and if I press "u" to undo, there is actually two changes. When the paster the yank register, and another one that replace the last character of the line with a 2.

Offline

#5 2017-10-19 07:36:48

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] Vim pasting yank register when opening a new file.

Is this vim or gvim? The Arch package or someting else? Have you installed any plugins, and if so have you tried disabling them all? Do you have ay software managing your clipboard (autocutsel)? Or any cut & paste stuff in your shell?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2017-10-19 09:14:15

GloW_on_dub
Member
Registered: 2013-03-13
Posts: 391
Website

Re: [Solved] Vim pasting yank register when opening a new file.

Found it. It was due to some files installed by the docker package in

/usr/share/vim/vimfiles/

Should i report that somewhere ?

Edit: It was vim from the arch packages, without plugins. I do have autocutsel.

Last edited by GloW_on_dub (2017-10-20 07:58:59)

Offline

#7 2017-10-19 15:15:28

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] Vim pasting yank register when opening a new file.

/vim.old/ suggests a manually named directory to me... The bug would be why Vim is sourcing that path.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2017-10-20 07:58:50

GloW_on_dub
Member
Registered: 2013-03-13
Posts: 391
Website

Re: [Solved] Vim pasting yank register when opening a new file.

I renamed the folder when testing. I've edited my comment.

Offline

#9 2017-10-20 08:05:11

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] Vim pasting yank register when opening a new file.

If docker put that there, you should open a bug report.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#10 2017-10-20 08:41:11

GloW_on_dub
Member
Registered: 2013-03-13
Posts: 391
Website

Re: [Solved] Vim pasting yank register when opening a new file.

Nevermind, the problem is still there. I managed to get a log of the command when opening the file using and then close the file directly

vim -W ~/vimcommand2.log myFile.cxx

the result is the following :

^[P1$r2 q^[\:x

One can clearly see the entered comment before my :x, but i have no idea where does it come from.

Edit: I've disabled autocutsel for the time being, no changes.
Edit2 : I'm not alone ! https://www.reddit.com/r/vim/comments/7 … _with_set/

Last edited by GloW_on_dub (2017-10-20 08:48:17)

Offline

#11 2017-10-20 09:15:32

GloW_on_dub
Member
Registered: 2013-03-13
Posts: 391
Website

Re: [Solved] Vim pasting yank register when opening a new file.

From the reddit thread, using

set t_RS=

in my .vimrc fixes it.

Offline

#12 2017-10-20 17:21:44

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] Vim pasting yank register when opening a new file.

Are you setting $TERM anywhere?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#13 2017-10-25 09:06:13

GloW_on_dub
Member
Registered: 2013-03-13
Posts: 391
Website

Re: [Solved] Vim pasting yank register when opening a new file.

I do not think so, it is set to xterm though.

Offline

Board footer

Powered by FluxBB