Vimrc

~/.vimrc for Vim 7.2 (Ubuntu 10.04):

" Syntax highlighting
syntax on

" This is to make sure that FileType (see below) works
filetype plugin on

" Don't use tabs, write two spaces instead for each one
set softtabstop=2
set shiftwidth=2
set expandtab

" Anticipate needed indentation
set autoindent
set smartindent

" Allow cursor to go past line boundaries and to roam freely in general
"   within the document boundaries. Could be useful for things like checking
"   indentation / finding matching code, or insert lots of whitespace quickly.
set virtualedit=all

" Use a key press to toggle between insert modes, so we can properly paste
"   text in a CLI version of vim without getting weird indentation etc.
set pastetoggle=<F2>

" --- Specific settings for various file types ---

" We need tab characters in Makefiles
au FileType Makefile set noexpandtab
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License