Created
March 9, 2015 18:50
-
-
Save brennancheung/f4057c74fc54bad903f1 to your computer and use it in GitHub Desktop.
Brennan's .vimrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible | |
filetype off | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'gmarik/Vundle.vim' | |
Plugin 'tpope/vim-fugitive' | |
Plugin 'L9' | |
Plugin 'int3/vim-extradite' | |
Plugin 'scrooloose/syntastic' | |
Plugin 'scrooloose/nerdtree' | |
Plugin 'Xuyuanp/nerdtree-git-plugin' | |
Plugin 'scrooloose/nerdcommenter' | |
Plugin 'kchmck/vim-coffee-script' | |
Plugin 'wavded/vim-stylus' | |
Plugin 'elzr/vim-json' | |
Plugin 'pangloss/vim-javascript' | |
Plugin 'digitaltoad/vim-jade.git' | |
Plugin 'bling/vim-bufferline' | |
Plugin 'airblade/vim-gitgutter' | |
Plugin 'godlygeek/tabular' | |
Plugin 'rking/ag.vim' | |
Plugin 'Shougo/vimproc.vim' | |
Plugin 'Shougo/neomru.vim' | |
Plugin 'Valloric/YouCompleteMe' | |
Plugin 'nathanaelkane/vim-indent-guides' | |
Plugin 'SirVer/ultisnips' | |
Plugin 'Shougo/unite.vim' | |
Plugin 'terryma/vim-expand-region' | |
Plugin 'bling/vim-airline' | |
Plugin 'flazz/vim-colorschemes' | |
"Plugin 'git://git.wincent.com/command-t.git' | |
call vundle#end() | |
filetype plugin indent on | |
set tabstop=4 softtabstop=4 shiftwidth=4 expandtab | |
set number autoindent ignorecase smartcase showcmd showmode ruler hlsearch nowrap | |
set textwidth=0 wrapmargin=0 " turn off annoying auto wrapping | |
if has("gui_running") | |
" Color Scheme | |
set background=dark | |
colorscheme hybrid | |
set guifont=DejaVu\ Sans\ Mono\ for\ Powerline:h12 | |
let g:airline_powerline_fonts = 1 | |
endif | |
" Power user shit | |
let mapleader = "\<Space>" | |
nnoremap <Leader>b :Gblame<cr> | |
nnoremap <Leader>c :CoffeeWatch vert<cr><C-w>l | |
nnoremap <Leader>x :q<cr> | |
map <C-s> :vsp<cr><C-w>l | |
" Airline | |
set laststatus=2 | |
" Unite | |
let g:unite_source_history_yank_enable = 1 | |
let g:unite_source_rec_async_command='ag --nocolor --nogroup --hidden -g ""' | |
let g:unite_source_grep_command='ag' | |
let g:unite_source_grep_default_opts='-i --line-numbers --nocolor --nogroup --hidden -p /Users/brennan/.agignore' | |
call unite#filters#matcher_default#use(['matcher_fuzzy']) | |
autocmd FileType unite call s:unite_settings() | |
function! s:unite_settings() | |
imap <buffer> <C-j> <Plug>(unite_select_next_line) | |
imap <buffer> <C-k> <Plug>(unite_select_previous_line) | |
endfunction | |
nnoremap <Leader>a :UniteBookmarkAdd<cr><cr><cr> | |
nnoremap <Leader>s :Unite -no-split -buffer-name=bookmarks -start-insert bookmark<cr> | |
nnoremap <Leader>d :Unite -no-split -buffer-name=buffer -start-insert buffer<cr> | |
nnoremap <Leader>y :Unite -no-split -buffer-name=yanks history/yank<cr> | |
nnoremap <Leader><Space> :Unite -no-split -buffer-name=filenav -start-insert bookmark buffer file_rec/async:!<cr> | |
nnoremap <Leader>f :Unite -no-split -buffer-name=filenav -auto-preview -start-insert -winheight=40 bookmark buffer file_rec/async:!<cr> | |
nnoremap <Leader>g :Unite -no-split -no-quit -auto-preview -winheight=40 -start-insert grep:.<cr> | |
" Unite / Angular | |
nnoremap <Leader>t :UniteWithBufferDir -no-split -buffer-name=templates -start-insert -input=.jade file<cr> | |
nnoremap <Leader>c :UniteWithBufferDir -no-split -buffer-name=controllers -start-insert -input=_ctrl.coffee file<cr> | |
" NERDTree | |
let NERDTreeQuitOnOpen = 1 | |
let g:NERDTreeWinSize = 80 | |
" Open NERDTree in the directory of the current file (or /home if no file is open) | |
nmap <silent> <C-n> :call NERDTreeToggleInCurDir()<cr> | |
function! NERDTreeToggleInCurDir() | |
" If NERDTree is open in the current buffer | |
if (exists("t:NERDTreeBufName") && bufwinnr(t:NERDTreeBufName) != -1) | |
exe ":NERDTreeClose" | |
else | |
exe ":NERDTreeFind" | |
endif | |
endfunction | |
" NERDCommenter | |
let NERDCreateDefaultMappings = 0 | |
let NERDSpaceDelims = 1 | |
nmap <C-_> <Plug>NERDCommenterToggle<cr> | |
vmap - <Plug>NERDCommenterToggle<cr> | |
" vim-indent-guides ( default binding is <Leader>ig ) | |
nnoremap <C-i> :IndentGuidesToggle<cr> | |
" vim-expand-region | |
vmap v <Plug>(expand_region_expand) | |
vmap <C-v> <Plug>(expand_region_expand) | |
nnoremap <Leader>e v<Plug>(expand_region_expand)<Plug>(expand_region_expand) | |
" Tabularize | |
vmap <silent> = :Tabularize /=<cr> | |
vmap <silent> ; :Tabularize /:\zs<cr> | |
" Extradite | |
let g:extradite_width = 200 | |
nnoremap <Leader>z :Extradite!<cr> | |
syntax on | |
set cursorline | |
set scrolloff=5 | |
" Make window navigation easier | |
map <C-h> <C-W>h | |
map <C-j> <C-W>j | |
map <C-k> <C-W>k | |
map <C-l> <C-W>l | |
set nottyfast |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment