Skip to content

Instantly share code, notes, and snippets.

@d11wtq
Created June 6, 2012 07:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save d11wtq/2880405 to your computer and use it in GitHub Desktop.
Save d11wtq/2880405 to your computer and use it in GitHub Desktop.
My .vimrc
" actually run as vim, not vi
set nocompatible
" 256-color terminal
set t_Co=256
" utf-8 by default
set encoding=utf-8
" vundle requires turning off filetypes momentarily
filetype off
" include vundle on the runpath
set rtp+=~/.vim/bundle/vundle/
" initialize vundle
call vundle#rc()
" let vundle manage itself
Bundle 'gmarik/vundle'
" ruby mode (might not be needed, w/ vim-rails?)
Bundle 'vim-ruby/vim-ruby'
" better tab completion
Bundle 'ervandew/supertab'
" erb support and the likes
Bundle 'tpope/vim-rails'
" solarized color theme
Bundle 'altercation/vim-colors-solarized'
" mustang theme
Bundle 'croaker/mustang-vim'
" php mode stuff
Bundle 'tobyS/vip'
" trailing whitespace annoyances
Bundle 'bronson/vim-trailing-whitespace'
" git integration
Bundle 'tpope/vim-fugitive'
" show current line and col in status bar
set ruler
" show filename in status bar
set title
" line numbers
set number
" let vim do more at once, with a modern terminal
set ttyfast
" always show current mode in status bar
set showmode
" tab completion done better
set wildmode=list:full
" allow opening new files while edits are kept
set hidden
" highlight matches in search
set hlsearch
" show matches while typing
set incsearch
" fuck ~backup files
set nobackup
" fuck ~backup files during editing
set nowritebackup
" fuck .swp files
set noswapfile
" force blank lines at end of file
set eol
" disallow assumption of binary (noeol) mode
set nobinary
" needed for most plugins to work
filetype plugin indent on
" spaces, not tabs
set expandtab
" not sure, will check
set shiftwidth=2
" soft tabs are 2 spaces
set softtabstop=2
" override tab settings for php
augroup filetype_php
autocmd!
autocmd FileType php setlocal noexpandtab shiftwidth=2 tabstop=2
augroup END
" allow syntaxes
syntax on
" always show the status line
set laststatus=2
" customize status line components
set statusline=%<%f\ %h%m%r%=%{fugitive#statusline()}\ %-14.(%l,%c%V%)\ %P
" opening a file any buffer uses the pwd for that file
set autochdir
" purdy colors
set background=dark
colorscheme mustang
" emacs user hangs head in shame: these are key-bindings for moving to ^/$ and
" for cut/paste while in insert mode, same as emacs, readline, zsh, bash, OS X
" undo/redo/visual select, I can live with switching to normal mode
inoremap <C-a> <ESC>I
inoremap <C-e> <ESC>A
" C-c usually by-passes the InsertLeave event
inoremap <C-c> <ESC>
" make vim's regex interpretation friendlier (see :h pattern)
nnoremap / /\v
vnoremap / /\v
" ubuntu has some dumb sql plugin installed that breaks the arrow keys
let g:omni_sql_no_default_maps = 1
" make status line red while in insert mode
augroup hi_statusline
autocmd!
autocmd InsertEnter * hi StatusLine ctermbg=15 ctermfg=9
autocmd InsertLeave * hi StatusLine ctermbg=238 ctermfg=253
augroup END

How to use this .vimrc

First, you need to create a ~/.vim directory, and a ~/.vim/bundle directory.

Then install vundle as described in its own README (i.e. clone the repository inside of ~/.vim/bundle).

Now you should be able to copy my .vimrc to your home directory, open vim and run :BundleInstall. You may get errors the first time you open vim, due to reference to color schemes that :BundleInstall will install, but the next time you open vim everything will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment