I'm using Mac OSX (10.9) and I'm trying to configure my vimrc file by adding "set number". I found my vimrc file in user/share/vim/ but I can't edit it because it's read-only. How can I fix this and read it?
Opening vimrc Using file name completion, you could type :e $M then press Tab until you see the desired variable. If you only want to see the path, type :echo $M then press Tab to see the variable, and press Enter. In gvim, the Edit menu includes "Startup Settings" which will use $MYVIMRC to edit your vimrc file.
The path used by macOS's default vim install is /usr/share/vim/vimrc .
The global or system-wide vim configuration file is generally located under the /etc/vim/vimrc . This configuration file is applied to all users and when Vim is started this configuration file is read and Vim is configured according to this file contents.
In the terminal, type vi . vimrc . This will create an empty vimrc system file which you want to use. In the file, type set number , and then hit Esc on the keyboard and type in :wq .
You should not overwrite the system vimrc for various reasons. One being that with a system upgrade it will be overwritten.
Instead you can create a new .vimrc file in your home directory. Open the terminal and enter:
vim ~/.vimrc
There you can enter your various configurations. When done, you need to save the file and restart vim.
To be sure which vimrc is being used, you can ask inside of vim by typing:
:echo $MYVIMRC
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