Tuesday, May 14, 2024
20
rated 0 times [  20] [ 0]  / answers: 1 / hits: 2592  / 2 Years ago, sun, may 1, 2022, 3:52:51

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.


More From » command-line

 Answers
0

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 your set line to ~/.vimrc creating this file if necessary:



echo 'set mouse=a' >>~/.vimrc


After that, either restart vim or source the file in a running instance with



:source ~/.vimrc


for the change to take effect.


[#5571] Monday, May 2, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
zzlingots

Total Points: 414
Total Questions: 130
Total Answers: 117

Location: Sudan
Member since Tue, Sep 15, 2020
4 Years ago
;