viminfo do not save registers, but clipboard still set at startup ?

38 views
Skip to first unread message

M Kelly

unread,
Jun 4, 2020, 4:48:52 PM6/4/20
to vim_use
Hi,

I have my viminfo set to not save any registers:

viminfo='20,:10,<0

I have clipboard set to include unnamedplus:

clipboard=autoselectml,unnamedplus,exclude:cons\|linux

I deliberately clear out my X11 selection and clipboard such that:

xsel -o -b
xsel -o -p

show nothing.

If I start vim I see some text in the + and * registers and now my X11 clipboard is set with that same data.

Does anyone know where is this data coming from ?  And if there is a way to not have it be loaded at startup ?

thx always for everything vim,
-m



M Kelly

unread,
Jun 4, 2020, 4:52:20 PM6/4/20
to vim_use
Hi again,

The data that is loaded into the * and + registers _seems_ to be a recently deleted line from a previous session.
But I am sure to exit all vim processes.

thx,
-m

Chris Willis

unread,
Jun 4, 2020, 5:11:55 PM6/4/20
to vim_use
--
--
I learned a while ago that register * is the clipboard. It seems + is the same. May be different as regards writing to it.
 
Chris Willis

M Kelly

unread,
Jun 4, 2020, 6:24:29 PM6/4/20
to vim_use
Hi,

Thanks.
Even if I unset clipboard and set history to 0, I still get * and + set on startup.
I just wonder where/how vims saves and restores this info and if it can be disabled ?
Its not in my viminfo file.  Its still there even if i start vim -i NONE

# Expression History (newest to oldest):

# Input Line History (newest to oldest):

# Debug Line History (newest to oldest):

# Registers:

#

thx,
-m

Chris Willis

unread,
Jun 5, 2020, 5:43:04 AM6/5/20
to vim_use
 
 
From: M Kelly
Sent: Thursday, June 04, 2020 11:24 PM
To: vim_use
Subject: Re: viminfo do not save registers, but clipboard still set at startup ?
 
Try
   help: “*
+ is nearby, and apparently canonical for the clipboard.
 
regards – Chris

Chris Willis

unread,
Jun 5, 2020, 5:57:27 AM6/5/20
to vim_use
Woops!
 
I meant of course:
 
   :help “*
 
Chris

Tony Mechelynck

unread,
Jun 5, 2020, 12:42:42 PM6/5/20
to vim_use
On Windows, the + and * registers are synonymous: both are the
clipboard. On X11, the + register is the clipboard (used for Edit→Cut,
Edit→Copy and Edit→Paste) and the * register is the selection (on
anything but Vim, it is the latest thing you highlighted even if you
didn't use Edit→Copy; it can be pasted by <MiddleMouse>). On the macOS
non-X11 GUI, I don't know. On Unix-like systems, if you start Vim in a
console with no access to X (for instance after Ctrl-Alt-F2 on Linux)
then the + and * registers are unavailable.

Best regards,
Tony.

M Kelly

unread,
Jun 5, 2020, 1:14:30 PM6/5/20
to vim_use
Hi,
Tony, thanks always for your info.

My point is the X11 selection and clipboard are empty and my viminfo does not contain any register info, yet after starting vim the + and * regsiters contain info.
This seems a bit odd to me since:
1). I did not save register info and I've confirmed my viminfo does not have any register info in it.
2). the X11 selection and clipboard were empty before starting vim and I've comfirmed that via xsel/xclip/etc.
It just seems a mystery to me how these two registers get filled.
I'll keep looking, even if just for my own curiosity :-)
If you clear out your X11 selection and primary and then start vim without a viminfo, are your * and + set with some info ?
It must be some other history/undo or something I am missing.
take care,
-m

Tony Mechelynck

unread,
Jun 5, 2020, 1:48:20 PM6/5/20
to vim_use
I don't know. I mostly use gvim, and there the * and + registers are
set, but if I start Vim in an xterm with my usual vimrc and viminfo,
then :reg doesn't mention them, not even after using :wv in gvim. (My
'viminfo' setting doesn't include the < and s parameters, which means
"save all registers").

I use:
:set vi='1000,!,%,c,r/mnt/ history=200
cb=exclude:cons\\\|linux go=!cgimrLtTp
see
:help 'viminfo'
:help 'history'
:help 'clipboard'
:help option-backslash
:help 'guioptions'

> It must be some other history/undo or something I am missing.
> take care,
> -m

Best regards,
Tony.
Reply all
Reply to author
Forward
0 new messages