You are not logged in.

#1 2016-12-11 14:19:15

DerJudge
Member
From: NRW, Germany
Registered: 2013-03-26
Posts: 24
Website

Unexpected behavior of vim

Hi everyone,

I'm not really a vim expert, but I'm using it very often. I changed from Gentoo Linux to ArchLinux a few years ago. I'm also using Ubuntu a lot for my workstations.

Some time ago, vim's behaviour on my ArchLinux systems started to become weird; you can see what I describe in the following in this screencast: https://www.youtube.com/watch?v=rEOOPvkJS4Q.

Somehow vim reacts to mouse interaction in the console window in X. Former, I could (double-)click on texts, mark areas by draging the cursor over, right click it to copy, etc.
With current vim in ArchLinux, these clicks seem to be grabbed by vim somehow. It the switches it's mode to "visual", marked text isn't put into the mouse buffer for middle-click-paste, and right click moves the carret for the marked text instead showing a context menu.

When I switch the mouse to mode "c" (commandline) by ":set mouse=c", it behaves as expected. But when I add the following line to /etc/vimrc this seems to have no effect at all:

set mouse=c

So I have to set the mode manually for every vim session, currently. Why that - what am I doing wrong?
There is no ~/.vimrc file present.

Offline

#2 2016-12-11 14:41:24

null
Member
Registered: 2009-05-06
Posts: 398

Re: Unexpected behavior of vim

You can have a look with ':set mouse' what the used value is. I've never heard of 'mouse=c', but I'm always using 'set mouse=' in my vimrc.

Also have a look on the ':version' output. It'll print all the files sourced by vim, make sure that your /etc/vimrc is sourced.

Offline

#3 2016-12-11 14:42:23

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: Unexpected behavior of vim

Yeah, add the following to ~/.vimrc

set mouse-=a

Offline

#4 2016-12-11 14:42:32

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Offline

#5 2016-12-11 15:35:06

DerJudge
Member
From: NRW, Germany
Registered: 2013-03-26
Posts: 24
Website

Re: Unexpected behavior of vim

null wrote:

You can have a look with ':set mouse' what the used value is. I've never heard of 'mouse=c', but I'm always using 'set mouse=' in my vimrc.

Also have a look on the ':version' output. It'll print all the files sourced by vim, make sure that your /etc/vimrc is sourced.

See http://vimdoc.sourceforge.net/htmldoc/options.html#'mouse' for info about the c mode.

Your hint with having a look into output of :version is helpful. /etc/vimrc is in that list.

graysky wrote:

Yeah, add the following to ~/.vimrc
set mouse-=a

What does that -= notation do?

Offline

#6 2016-12-12 00:03:22

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Unexpected behavior of vim

The 'a-=b' notation is shorthand for 'a = a - b', like the more familiar '+=' notation. wink

Settings in Vim are represented by lists, not strings (or at least this one is), so you can use this notation to remove "a" from the list of things "mouse" is defined as.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#7 2016-12-12 09:35:25

DerJudge
Member
From: NRW, Germany
Registered: 2013-03-26
Posts: 24
Website

Re: Unexpected behavior of vim

With the help of Scimmia's Github Link for patch 7.4.2111, I conclude that there's nothing specific to be entered into /etc/vimrc or ~/.vimrc - creating an empty ~/.vimrc file solves this "issue". I'm naming it "issue", since it seems to confuse others, too, when you study the commit comments.

Last edited by DerJudge (2016-12-12 09:35:50)

Offline

#8 2016-12-12 13:20:34

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,530
Website

Re: Unexpected behavior of vim

DerJudge, your conclusion is what is already documented in the wiki page that Scimmia already linked to.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Online

Board footer

Powered by FluxBB