Blog Archives

#MacOsX : vimrc

If you are looking to configure Vim you find the default configuration file in:

/usr/share/vim/vimrc

Copy and rename it in your home directory:

cp /usr/share/vim/vimrc ~/.vimrc

However it is bare minimal so it is better if you personalize it a bit. One very simple example is the following:

" 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
" Use Vim defaults instead of 100% vi compatibility
set nocompatible

" more powerful backspacing
set backspace=2

" Display line numbers on the left
set number

" Allow intelligent auto-indenting for each filetype
" and for "plugins that are filetype specific.
filetype indent plugin on

" Fallback when no filetype-specific indenting is enabled
set autoindent

" Enable syntax highlighting
syntax on

" Display the cursor position
set ruler

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

Advertisement
%d bloggers like this: