I wanted to add set mouse=a
to the .vimrc
file to add point and click cursor, but the /etc/vim/vimrc
file is read-only and won't allow me to edit or delete it. I tried to uninstall and reinstall vim
but the .vimrc
file remained unchanged.
Additionally when I try to edit it from terminal using
sudo vim /etc/vim/vimrc
it says
Found a swap file by name of 'filename'
Apparently it says I edited the same file twice.
User-specific changes like that should go in your personal
.vimrc
, which should be located in your home directory. If this file doesn’t exist yet you can simply create it. This will add yourset
line to~/.vimrc
creating this file if necessary:After that, either restart
vim
or source the file in a running instance withfor the change to take effect.
When vim gives you this warning, it also should give you some options at the bottom:
Chose "R" if you want to recover whatever changes and "E" if you don't.
If you persistently get this message, delete the swap file named.
More information is found in the error message normally.