Where is the default vimrc located on Mac

50,538

Solution 1

Type in Terminal: vim --version
as you want check the vim's version, then scroll down you will find something like; user vimrc file: "$HOME/.vimrc"

Hope it helps.

Solution 2

The path used by macOS's default vim install is /usr/share/vim/vimrc.

On my system at the moment (macOS 10.12.5), these are its contents:

" Configuration file for vim
set modelines=0     " CVE-2007-2438

" Normally we use vim-extensions. If you want true vi-compatibility
" remove change the following statements
set nocompatible    " Use Vim defaults instead of 100% vi compatibility
set backspace=2     " more powerful backspacing

" Don't write backup file if vim is being called by "crontab -e"
au BufWrite /private/tmp/crontab.* set nowritebackup nobackup
" Don't write backup file if vim is being called by "chpass"
au BufWrite /private/etc/pw.* set nowritebackup nobackup

Solution 3

You can use :echo $MYVIMRC to print it. Also, you can have a look at :version which gives list of places being searched.

Solution 4

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.

Share:
50,538
isethi
Author by

isethi

Updated on September 12, 2021

Comments

  • isethi
    isethi over 2 years

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