Skip to content

Instantly share code, notes, and snippets.

@groveriffic
Created April 4, 2012 18:48
Show Gist options
  • Save groveriffic/2304677 to your computer and use it in GitHub Desktop.
Save groveriffic/2304677 to your computer and use it in GitHub Desktop.
My Vimrc
set wildmode=list,longest
if has("gui_running")
colorscheme darkblue
set guifont=Bitstream\ Vera\ Sans\ Mono\ Bold:h13
set guioptions-=T
endif
if has("gui_macvim")
map <SwipeLeft> :bprev<CR>
map <SwipeRight> :bnext<CR>
endif
set tabstop=2
set shiftwidth=2
set expandtab
set autoindent
set backupdir=~/.vim/backup/
set directory=~/.vim/backup/
set incsearch
set hlsearch
" Leader is backslash
map <Leader>t :NERDTree<CR>
map <Leader>e :CommandTFlush<CR>:CommandT<CR>
map <Leader>b :CommandTJump<CR>
map <Leader>q :q<CR>
map <Leader>w :w<CR>
" Comment Visual Block
vmap # :s/^/#/<CR>gv
vmap - :s/^/-/<CR>gv
vmap <Tab> >gv
vmap <S-Tab> <gv
" Automatically reload ~/.vimrc when saved
" au BufWritePost .vimrc so ~/.vimrc
" Center search pattern
nnoremap <silent> n nzz
nnoremap <silent> N Nzz
nnoremap <silent> * *zz
nnoremap <silent> # #zz
nnoremap <silent> g* g*zz
nnoremap <silent> g# g#zz
au BufRead,BufNewFile {Capfile,Gemfile,Rakefile,Thorfile,config.ru,.caprc,.irbrc,irb_tempfile*} set ft=ruby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment