Where is the default vimrc located on Mac

Viewed 59403

Where can I find the default vimrc on Mac when there is no ~/.vimrc. On some Linux its located in the /etc/vimrc

8 Answers

If you're just looking to change VIM defaults for your profile, macOS looks for ~/.vimrc, so if you make the file you can change your vim settings there.

For my homebrew generated vim the location of the default vimrc file is:

/usr/local/share/vim/vim81/defaults.vim

Here, the numbers 81 correspond to the vim version number.

I'm writing a whole new answer because I can't add a comment on SantaCruzRC's answer. I also didn't have that file by default. So just create a new .vimrc in home directory and add there any settings you want to have(e.g. syntax on).

If there is no .vimrc in the home directory you can create it.

On OSX Mojave, the default settings are at

/usr/share/vim/vim80/syntax/

If you want to modify any of these, it is best to copy the file you need into ~/.vim/syntax, and modify that, thereby preserving the original.

Related