Skip to content

Instantly share code, notes, and snippets.

@cmeiklejohn
Created June 1, 2010 21:00
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 cmeiklejohn/421483 to your computer and use it in GitHub Desktop.
Save cmeiklejohn/421483 to your computer and use it in GitHub Desktop.
My .vimrc
" Christopher Meiklejohn (cmeiklejohn@devio.us)
" .vimrc -- parts stolen from all over the place.
set nocompatible " We don't want vi compatibility.
set viminfo^=!
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1
let g:LustyJugglerSuppressRubyWarning = 1
map <silent> <m-p> :cp <cr>
map <silent> <m-n> :cn <cr>
let g:rails_default_file='config/database.yml'
set cf
set clipboard+=unnamed
set autowrite
set ruler
set nu
set timeoutlen=250
set ts=2
set bs=2
set shiftwidth=2
set incsearch
set cinoptions=:0,p0,t0
set cinwords=if,else,while,do,for,switch,case
set formatoptions=tcqr
set cindent
set autoindent
set smarttab
set showmatch
set novisualbell
set noerrorbells
set laststatus=2
set mouse=a
runtime! macros/matchit.vim
augroup myfiletypes
autocmd!
autocmd FileType ruby,eruby,yaml set ai sw=2 sts=2 et
augroup END
set hlsearch
set incsearch
set wildmode=list:longest
set hidden
set history=256
filetype plugin on
filetype indent on
set autoread
let mapleader = ","
let g:mapleader = ","
set so=7
set wildmenu
set ruler
set cmdheight=2
set backspace=eol,start,indent
set whichwrap+=<,>,h,l
set ignorecase
set magic
set mat=2
set noerrorbells
set novisualbell
set t_vb=
syntax enable
set nobackup
set nowb
set noswapfile
set expandtab
set shiftwidth=4
set tabstop=4
set smarttab
set lbr
set tw=500
set ai
set si
set wrap
map <leader>t2 :setlocal shiftwidth=2<cr>
map <leader>t4 :setlocal shiftwidth=4<cr>
map <leader>t8 :setlocal shiftwidth=4<cr>
map <space> /
map <c-space> ?
map <silent> <leader><cr> :noh<cr>
set laststatus=2
set statusline=\ %F%m%r%h\ %w\ \ CWD:\ %r%{CurDir()}%h\ \ \ Line:\ %l/%L:%c\ %{GitBranch()}
function! CurDir()
let curdir = substitute(getcwd(), '/Users/amir/', "~/", "g")
return curdir
endfunction
vnoremap $1 <esc>`>a)<esc>`<i(<esc>
vnoremap $2 <esc>`>a]<esc>`<i[<esc>
vnoremap $3 <esc>`>a}<esc>`<i{<esc>
vnoremap $$ <esc>`>a"<esc>`<i"<esc>
vnoremap $q <esc>`>a'<esc>`<i'<esc>
vnoremap $e <esc>`>a"<esc>`<i"<esc>
inoremap $1 ()<esc>i
inoremap $2 []<esc>i
inoremap $3 {}<esc>i
inoremap $4 {<esc>o}<esc>O
inoremap $q ''<esc>i
inoremap $e ""<esc>i
@cmeiklejohn
Copy link
Author

Also, I use rails.vim, ruby.vim and git.vim to speed up my development.

@cmeiklejohn
Copy link
Author

...and sometimes Lusty Explorer as well.

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