set nocompatible " Options {{{ set autoindent set autoread let &background = $BACKGROUND ==# 'light' ? 'light' : 'dark' set backspace=indent,eol,start set nobackup set clipboard=unnamed set colorcolumn=80 set cursorline set encoding=utf8 set expandtab set foldenable set foldlevelstart=100 set foldmethod=syntax set foldnestmax=10 set formatoptions-=t set hidden set history=1000 set hlsearch set incsearch set laststatus=2 set lazyredraw set listchars=tab:›\ ,trail:· set modelines=0 set number set scrolloff=5 set shiftwidth=4 let &showbreak = '↪ ' set showmatch set noshowmode set sidescrolloff=5 set nrformats-=octal set smartindent set smarttab set splitbelow set splitright set noswapfile set tabstop=4 set textwidth=79 set timeoutlen=1000 set ttimeoutlen=100 set ttyfast set viminfofile=~/.vim/viminfo set wildignore=*.o,*.obj,*.pyc,*.exe,*.so,*.dll set wildmenu set wrap set writebackup " }}} " Plugins {{{ call plug#begin('~/.vim/bundle') Plug 'altercation/vim-colors-solarized' Plug 'bling/vim-bufferline' Plug 'bronson/vim-trailing-whitespace' Plug 'elzr/vim-json' Plug 'godlygeek/tabular' | Plug 'plasticboy/vim-markdown' Plug 'junegunn/rainbow_parentheses.vim' Plug 'kien/ctrlp.vim' Plug 'majutsushi/tagbar' Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } Plug 'tpope/vim-commentary' Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' Plug 'vim-scripts/srec.vim' Plug 'keith/swift.vim' Plug 'chr4/nginx.vim' call plug#end() let g:ctrlp_match_window = 'bottom,order:ttb' let g:ctrlp_switch_buffer = 0 " open files in new buffer let g:ctrlp_working_path_mode = 0 " use the current working directory let g:rainbow#pairs = [['(',')'], ['[',']'], ['{','}']] if !exists('g:airline_symbols') let g:airline_symbols = {} endif let g:airline_left_sep = ' ' let g:airline_right_sep = ' ' let g:airline_left_alt_sep = '' let g:airline_right_alt_sep = '' let g:airline_symbols.crypt = '☢' let g:airline_symbols.paste = 'Ⓟ' let g:airline_symbols.spell = '✔' let g:airline_symbols.branch = '⎇' let g:airline_symbols.readonly = ' ⃠' let g:airline_symbols.linenr = '␤' let g:airline_symbols.whitespace = '✗' let g:bufferline_echo = 0 highlight link srecStart Comment highlight link srecType Comment highlight link srecLength WarningMsg highlight link srec16BitAddress Constant highlight link srec24BitAddress Constant highlight link srec32BitAddress Constant highlight link srecChecksum Type colorscheme solarized filetype plugin indent on syntax enable " }}} " Mappings {{{ let mapleader = "\" let maplocalleader = "," " better navigation for wrapped lines noremap j gj noremap k gk " quickly exit insert mode inoremap jk " retain selection when indenting/unindenting in visual mode vnoremap > >gv vnoremap < <gv " case insensitive searching nnoremap // /\c nnoremap ?? ?\c " window resizing similar to the way I have tmux set up nnoremap 5+ nnoremap 5- nnoremap 5< nnoremap 5> " easier tab navigation nnoremap :tabprevious nnoremap :tabnext nnoremap :tabfirst nnoremap :tablast " quickly change background nnoremap bg \ :let &background = &background ==# 'light' ? 'dark' : 'light' " toggle tagbar nnoremap g :TagbarToggle " turn off search highlight nnoremap h :nohlsearch " toggle NERDTree nnoremap n :NERDTreeToggle " toggle rainbow parens nnoremap r :RainbowParentheses!! " fix whitespace nnoremap w :FixWhitespace " }}}" augroup vimrc " {{{ autocmd! autocmd BufNewFile,BufRead bash_profile,bashrc set filetype=sh autocmd BufNewFile,BufRead gitconfig set filetype=gitconfig autocmd BufNewFile,BufRead rcrc set filetype=sh autocmd BufNewFile,BufRead *.sx,*.s19 set filetype=srec autocmd FileType vim setlocal foldmethod=marker autocmd FileType python setlocal foldmethod=indent foldignore= autocmd FileType markdown,text,gitcommit setlocal formatoptions+=t spell autocmd FileType gitcommit setlocal textwidth=72 augroup END " }}} if filereadable(expand("~/.vimrc.local")) | source ~/.vimrc.local | endif