Skip to content

Instantly share code, notes, and snippets.

@jelder
Created November 29, 2011 17:07
Show Gist options
  • Save jelder/1405552 to your computer and use it in GitHub Desktop.
Save jelder/1405552 to your computer and use it in GitHub Desktop.
My .vimrc
" This is jelder's .vimrc. Use it well.
syntax on
filetype on
filetype indent on
filetype plugin on
set cinoptions=:0,p0,t0
set cinwords=if,else,while,do,for,switch,case
set formatoptions=tcqr
set cindent
set autoindent
set number
" Show (partial) command in the last line of the screen.
set showcmd
" When set to "dark", Vim will try to use colors that look good on a
" dark background. When set to "light", Vim will try to use colors that
" look good on a light background.
set background=dark
" Use a less-braindead backspace mode.
set backspace=indent,eol,start
" Use the fastest, safest backup mode.
set backupcopy=auto
" Put swap files in the home directory.
set backupdir=~/.vim/
" Obv.
set history=50
" Use incremental search
set incsearch
" Always show status line.
set laststatus=2
" Allow the mouse to be used for everything. Hold down Option in iTerm to get select locally.
set mouse=a
" Backups? That's what git is for.
set nobackup
" "compatible" means disable any features added since the beginning of the Shuttle program.
set nocompatible
" Hit F11 while in insert mode to prevent Vim from eating your indents.
set pastetoggle=<F11>
" Show the line and column number of the cursor position, separated by a comma.
set ruler
" Don't use literal \t characters; use spaces instead.
set expandtab
" This is the tab width. Any even number between two and four is acceptible.
set shiftwidth=2
" Related. Should be the same as "shiftwidth"
set softtabstop=2
" Even though tab inserts "shiftwidth" spaces, backspace over indentation in
" "shiftwidth" chunks.
set smarttab
set viminfo='50,\"1000,:50,n~/.viminfo
" http://vimdoc.sourceforge.net/htmldoc/options.html#'whichwrap'
set whichwrap+=<,>,h,l
" Don't move to first column for # (We're not writing C).
inoremap # X#
" Highlight matching parenthesis, brackets, etc for 0.3 seconds.
set showmatch
set matchtime=3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment