-" Moving back and forth between lines of same or lower indentation.
-nnoremap <silent> [l :call NextIndent(0, 0, 0, 1)<CR>
-nnoremap <silent> ]l :call NextIndent(0, 1, 0, 1)<CR>
-nnoremap <silent> [L :call NextIndent(0, 0, 1, 1)<CR>
-nnoremap <silent> ]L :call NextIndent(0, 1, 1, 1)<CR>
-vnoremap <silent> [l <Esc>:call NextIndent(0, 0, 0, 1)<CR>m'gv''
-vnoremap <silent> ]l <Esc>:call NextIndent(0, 1, 0, 1)<CR>m'gv''
-vnoremap <silent> [L <Esc>:call NextIndent(0, 0, 1, 1)<CR>m'gv''
-vnoremap <silent> ]L <Esc>:call NextIndent(0, 1, 1, 1)<CR>m'gv''
-onoremap <silent> [l :call NextIndent(0, 0, 0, 1)<CR>
-onoremap <silent> ]l :call NextIndent(0, 1, 0, 1)<CR>
-onoremap <silent> [L :call NextIndent(1, 0, 1, 1)<CR>
-onoremap <silent> ]L :call NextIndent(1, 1, 1, 1)<CR>
-" end of jump indent
+set undofile " persistent undo history
+set undodir=$HOME/.vim/backupdir
+
+set autowrite " automatically write a file when leaving a modified buffer
+
+" save with sudo
+cmap w!! w !sudo tee % > /dev/null
+
+" command line editing {{{1
+set history=500 " how many command lines are remembered
+set wildmode=longest:full " specifies how command line completion works
+set wildmenu " command-line completion shows a list of matches
+
+" various {{{1
+set virtualedit=block " let cursor move past last char in <C-V> mode
+set viminfo='100,<50,s10,h,n~/.vim/viminfo " viminfo defaults but save file in .vim
+
+" plugins {{{1
+" airline {{{2
+let g:airline_detect_whitespace=2
+let g:airline_whitespace_symbol = 'Ξ'
+let g:airline_linecolumn_prefix = '␊ '
+let g:airline_left_sep = '▶'
+let g:airline_right_sep = '◀'
+let g:airline#extensions#tabline#enabled = 1
+
+" Gundo {{{2
+nnoremap <F7> :GundoToggle<CR>
+" fugitive {{{2
+nmap <silent> <leader>dd :tab split \| Gdiff \| wincmd h<CR>
+
+" NERDTree {{{2
+" open/close NERDTree with \e
+nmap <Leader>e :NERDTreeToggle<CR>
+nmap <F6> :NERDTreeToggle<CR>
+" <space> to open files/dirs
+let NERDTreeMapActivateNode='<space>'
+" open NERDTree if no files were selected
+autocmd vimenter * if !argc() | NERDTree | endif
+" close vim if only NERDTree is open
+autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
+
+" synastic {{{2
+let g:syntastic_enable_highlighting = 0
+let g:syntastic_error_symbol='E'
+let g:syntastic_style_error_symbol='S'
+let g:syntastic_warning_symbol='W'
+let g:syntastic_style_warning_symbol='S'
+let g:syntastic_always_populate_loc_list=1
+nmap <silent> <leader>y :SyntasticCheck<cr>
+
+if ! &diff
+ let g:syntastic_check_on_open=1
+endif
+
+" tagbar {{{2
+map <F5> :TagbarToggle<cr>
+let g:tagbar_sort = 0
+let g:tagbar_compact = 1
+let g:tagbar_autoshowtag = 1
+let g:tagbar_width = 25
+let g:tagbar_iconchars = ['+', '-']
+
+" YouCompleteMe {{{2
+let g:ycm_extra_conf_globlist = ['/mnt/data/src/*']
+
+" vim-json {{{2
+let g:vim_json_syntax_conceal = 0
+
+" functions {{{1
+" Convenient command to see the difference between the current buffer and the
+" file it was loaded from, thus the changes you made.
+" Only define it when not defined already.
+if !exists(":DiffOrig")
+ command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
+ \ | wincmd p | diffthis
+endif