isethi
isethi

Reputation: 755

Where is the default vimrc located on Mac

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

Upvotes: 49

Views: 82825

Answers (7)

Fernando Lozano
Fernando Lozano

Reputation: 1

/usr/local/lib/vim/doc/*.txt The Vim documentation files. Use ":help doc-file-list" to get the complete list.

   /usr/local/lib/vim/doc/tags
                  The tags file used for finding information in the documentation files.

   /usr/local/lib/vim/syntax/syntax.vim
                  System wide syntax initializations.

   /usr/local/lib/vim/syntax/*.vim
                  Syntax files for various languages.

   /usr/local/lib/vim/vimrc
                  System wide Vim initializations.

   ~/.vimrc       Your personal Vim initializations.

   /usr/local/lib/vim/gvimrc
                  System wide gvim initializations.

   ~/.gvimrc      Your personal gvim initializations.

   /usr/local/lib/vim/optwin.vim
                  Script used for the ":options" command, a nice way to view and set options.

   /usr/local/lib/vim/menu.vim
                  System wide menu initializations for gvim.

   /usr/local/lib/vim/bugreport.vim
                  Script to generate a bug report.  See ":help bugs".

   /usr/local/lib/vim/filetype.vim
                  Script to detect the type of a file by its name.  See ":help 'filetype'".

   /usr/local/lib/vim/scripts.vim
                  Script to detect the type of a file by its contents.  See ":help 'filetype'".

   /usr/local/lib/vim/print/*.ps
                  Files used for PostScript printing.

   For recent info read the VIM home page:
   <URL:http://www.vim.org/>

Upvotes: 0

SantaCruzRC
SantaCruzRC

Reputation: 87

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.

Upvotes: 7

feli_x
feli_x

Reputation: 166

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.

Upvotes: 2

Chandana De Silva
Chandana De Silva

Reputation: 441

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.

Upvotes: -2

Jimmy_Rw
Jimmy_Rw

Reputation: 1336

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.

Upvotes: 51

Dan Lowe
Dan Lowe

Reputation: 56498

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

Upvotes: 36

dlmeetei
dlmeetei

Reputation: 10371

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

Upvotes: 10

Related Questions