Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#12783 - vi and vim VISUAL mode should not be default

Attached to Project: Arch Linux
Opened by Rob (p3nguin) - Wednesday, 14 January 2009, 03:03 GMT
Last edited by Allan McRae (Allan) - Saturday, 31 January 2009, 08:58 GMT
Task Type General Gripe
Category Packages: Extra
Status Closed
Assigned To Tobias Kieslich (tobias)
Allan McRae (Allan)
Architecture All
Severity Low
Priority Normal
Reported Version None
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:
The default settings of vi and vim cause VISUAL mode to be enabled when using the mouse. Other distros have commented out the section in /etc/virc and /etc/vimrc to stop this unwanted behavior from happening. Please comment out the lines related to the mouse in those config files. Global enabling of the mouse should not be default.


Additional info:
* package version(s) - all
* config and/or log files etc. - /etc/virc /etc/vimrc


Steps to reproduce:

Open a text file using vi or vim (such as executing `crontab -e`) and highlight some text with the mouse. VISUAL mode will become enabled.

To permanently correct the global behavior:

in /etc/virc and /etc/vimrc, change:

" In many terminal emulators the mouse works just fine, thus enable it.
if has('mouse')
set mouse=a
endif

to

" In many terminal emulators the mouse works just fine, thus enable it.
"if has('mouse')
" set mouse=a
"endif
This task depends upon

Closed by  Allan McRae (Allan)
Saturday, 31 January 2009, 08:58 GMT
Reason for closing:  Not a bug
Additional comments about closing:  Default upstream configuration. Override with ~/.vi{m}rc
Comment by Eric Belanger (Snowman) - Wednesday, 14 January 2009, 08:12 GMT
Rob: Make sure that you submit the bug report in the correct project. I had to move this one out of the community section.
Comment by Allan McRae (Allan) - Wednesday, 14 January 2009, 08:26 GMT
Looks like I have changed mine to

if has('mouse')
set mouse=v
endif

Does that achieve the same thing? It is an easier fix to sed...
Comment by Rob (p3nguin) - Wednesday, 14 January 2009, 08:30 GMT
http://www.vim.org/htmldoc/term.html#mouse-using

v is visual mode, which is what needs to be avoided. According to the vim documentation, the mouse setting should be empty by default. I'm not sure why the newer vimrcs have included enabling of mouse.
Comment by Tobias Kieslich (tobias) - Wednesday, 14 January 2009, 08:32 GMT
What is "incorrect" about that behaviour?
first of all, when enabled and selecting text, it selects only relevant text, not line numbers. I would deem as that correct behaviour.
Secondly, it is default behaviour in vimrc, as such desired by upstream authors. Thirdly, it activates other very useful features, such as mouse scrolling in vim(scrolling the text buffer rather than the terminal). So why should selecting text with the mouse should not activate the visual mode, which is basically vims version of selecting text. Selecting text with the mouse does nothing else than exactly that, selecting text.
Comment by Rob (p3nguin) - Wednesday, 14 January 2009, 08:39 GMT
I can select text just fine with my mouse without having VISUAL mode enabled.
Comment by Jan de Groot (JGC) - Wednesday, 14 January 2009, 13:47 GMT
This feature is highly irritating when selecting text via a terminal. I can't copy anything to the X clipboard: selection doesn't transfer it to the clipboard, and the copy function in gnome-terminal is greyed out. Instead of that, I have to yank the selection first before I can use the selection outside of vim.

This behaviour changed a while ago. Old versions of vi/vim on archlinux didn't have this option enabled by default.
Comment by Dan McGee (toofishes) - Saturday, 17 January 2009, 06:09 GMT
It is annoying when trying to get stuff to the X clipboard, but I find myself using the scroll wheel a lot.

How many people use vi/vim on a regular basis without a vimrc file? This can easily be overridden there. It also seems odd to me that upstream would ship a config they didn't stand behind using.
Comment by Allan McRae (Allan) - Thursday, 22 January 2009, 16:16 GMT
So is this a "Won't Fix" given the user can easily create their own .vi{m}rc config file. These are there for this exact purpose.
Comment by Tobias Kieslich (tobias) - Thursday, 22 January 2009, 17:24 GMT
I'm leaning towards exactly that. It seems that a whole bunch of people don't like it but it is upstream and it can be fixed in a local ~/.vimrc
So I would prefer to leave it the way it is.

Loading...