autocmd BufEnter * :set selection=exclusive

36 views
Skip to first unread message

Paul

unread,
Apr 20, 2015, 5:34:45 PM4/20/15
to vim...@googlegroups.com
I'm seeking a solution for the problem of the "selection" option being
set to inclusive (http://thread.gmane.org/gmane.editors.vim/118590).
Is the following autocmd the most sensible way to fix this?

autocmd BufEnter * :set selection=exclusive

Christian Brabandt

unread,
Apr 22, 2015, 5:04:01 PM4/22/15
to vim...@googlegroups.com
Hi Paul!
Check with
:verbose set selection?
what caused the change of the selection.

If a plugin is the culprit contact the plugin author. He should fix it.

Best,
Christian
--
Weniges auf dieser Welt verbindet so stark wie eine gemeinsame
Abneigung gegen einen Dritten.
-- Rene Clair

Paul

unread,
Apr 22, 2015, 6:29:10 PM4/22/15
to vim...@googlegroups.com
Christian Brabandt <cblists <at> 256bit.org> writes:
> Check with
> :verbose set selection?
> what caused the change of the selection.
>
> If a plugin is the culprit contact the plugin author. He should fix it.

Will do, Christian. Thanks.

Paul

unread,
Apr 24, 2015, 6:29:28 PM4/24/15
to vim...@googlegroups.com
Christian Brabandt <cblists <at> 256bit.org> writes:
> Check with
> :verbose set selection?
> what caused the change of the selection.
>
> If a plugin is the culprit contact the plugin author. He should fix
> it.

It shows that netrw is the last to change the "selection" option.
However, the author confirmed that netrw saves and restores the
original values.

In any case, the autocmd seems to work well enough to hide this
problem, whatever the cause. Not the most efficient, I know.

toothpik

unread,
Apr 24, 2015, 7:51:13 PM4/24/15
to vim...@googlegroups.com
On Fri, Apr 24, 2015 at 10:29:00PM +0000, Paul wrote:
> Christian Brabandt <cblists <at> 256bit.org> writes:
> > Check with
> > :verbose set selection?
> > what caused the change of the selection.
> >
> > If a plugin is the culprit contact the plugin author. He should fix
> > it.

> It shows that netrw is the last to change the "selection" option.
> However, the author confirmed that netrw saves and restores the
> original values.

when working with said author you need to give specific details about
how you invoke netrw and how you leave it -- that plugin has more
entries and exits than a big block of swiss cheese and it's possible
you've found a way to foil the expected behavior

--
_|_ _ __|_|_ ._ o|
|_(_)(_)|_| ||_)||<
|

Paul

unread,
Apr 30, 2015, 4:40:16 PM4/30/15
to vim...@googlegroups.com
That would be challenging...I am not exactly sure *when* the selection
option gets clobbered and not restored. It's difficult to know which
method of exiting is causing the problem. And my methods of exiting
are probably the same as most people's: Change windows, close window,
close tab, switch tab, open a file, or preview a file.

Charles Campbell

unread,
May 28, 2015, 1:18:04 PM5/28/15
to vim...@googlegroups.com
You could put

redir >> $HOME/vss
verbose set selection?
redir END

in s:NetrwOptionSave(). That way a file, "vss", will be created with
the output of "verbose set selection?" -- eventually you'll find a "last
set" message in that file that'll help point you where the problem occurred.

Regards,
Chip Campbell

Reply all
Reply to author
Forward
0 new messages