I have strange problem with my /etc/vim/vimrc
file.
I was trying to get rid of VISUAL mode in VIM, so I have tried to add the set mouse-=a
command in my vimrc
file.
However my vim does not take those changes into account.
When I do :set mouse-=a
in openend vim, it does what I want (selecting text with mouse without entering VISUAL mode), but the command does not work in the vimrc
file.
I have also enabled the "jump to the last position when reopening a file" in vimrc
and it is working, that makes me even more confused.
I have been trying every possible command:
set mouse=a
set mouse=r
set mouse-=a
:set mouse-=a
None of them is working when added to /etc/vim/vimrc
.
My system is:
rRr-kali:~# uname -a
Linux rRr-kali 4.8.0-kali2-amd64 #1 SMP Debian 4.8.15-1kali1 (2016-12-23) x86_64 GNU/Linux
rRr-kali:~#
Mouse reporting is enabled in an app, such as Vim, that runs in a Terminal window. In general, mouse reporting is not enabled in apps by default. For example, to enable mouse reporting in Vim, you need to add a set mouse=a command to your ~/. vimrc file.
All you have to do is to create a . vimrc file in the HOME directory of the user than you want to configure Vim for and add the required Vim configuration options there. For simplicity, I will refer to both system wide Vim configuration file and user specific Vim configuration file as vimrc file.
You can copy a block of text by pressing Ctrl-v (or Ctrl-q if you use Ctrl-v for paste), then moving the cursor to select, and pressing y to yank. Now you can move elsewhere and press p to paste the text after the cursor (or P to paste before).
vimrc file can contain variables, conditional code, function definitions etc, but when getting started you will mostly want to stick with enabling/disabling settings and mapping keys. While I have only been working with Vim for a couple of weeks now, I am starting to settle on my favorite settings and key mappings.
If you are using Debian 9 (Strecth), edit the file /usr/share/vim/vim80/defaults.vim and change the line 70 to put
set mouse-=a
Best Regards
Thibault
I know, that this question is a bit old, but I just want to clarify, why both answers above are correct and why it's working that way.
On Debian systems the way the config files for vim are loaded is like this:
/etc/vim/vimrc
/etc/vim/vimrc.local
~/.vimrc
does not exist and there is no "let g:skip_defaults_vim = 1"
in /etc/vim/vimrc
or /etc/vim/vimrc.local
, load settings from /usr/share/vim/vim80/defaults.vim
otherwise load settings from ~/.vimrc
(if it exists).Details for that can be found in the config files itself, as well as in a discussion on bugs.debian.org
So to solve your issue you have two ways to go:
"let g:skip_defaults_vim = 1"
at the beginning of /etc/vim/vimrc.local
.~/.vimrc
by issuing touch ~/.vimrc
.https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=864074
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With