call plug#begin('~/.vim/plugged') Plug 'tpope/vim-sensible' Plug 'tpope/vim-sleuth' Plug 'tpope/vim-fugitive' Plug 'tpope/vim-surround' Plug 'bling/vim-airline' Plug 'mhinz/vim-signify' Plug 'sjl/gundo.vim' Plug 'ctrlpvim/ctrlp.vim' if executable('lein') Plug 'guns/vim-sexp' Plug 'tpope/vim-sexp-mappings-for-regular-people' Plug 'tpope/vim-fireplace', {'for': 'clojure'} endif if executable('sbt') Plug 'derekwyatt/vim-scala' endif Plug 'trusktr/seti.vim' call plug#end() " ----- plugin settings ------ let g:signify_vcs_list = [ 'git' ] if executable('ag') " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore " we cd first into the dir so ag will use .agignore correctly let g:ctrlp_user_command = 'cd %s && ag --nocolor --hidden -g ""' endif " ------ settings ------ " xdg-ish settings set undodir=~/.cache/vim/undo,. set backupdir=~/.cache/vim/backup,. set directory=~/.cache/vim/swap,. " default indentation set shiftwidth=2 set tabstop=4 set expandtab " permanent undo history set undofile " allow switching buffers set hidden " always scroll set scrolloff=99 " show line numbers set number set relativenumber " set wordwrap indent set nowrap set linebreak if exists("&breakindent") set breakindent set breakindentopt=shift:2,sbr endif " show whitespace set list " make a new copy of the file for backup " setting to no or auto messes with filewatchers set backupcopy=yes " ------ key bindings ------ " ; as : nnoremap ; : vnoremap ; : " allow via jj in insert mode inoremap jj " fix j/k with wraps nnoremap j gj nnoremap k gk vnoremap j gj vnoremap k gk " opening ctrlp nnoremap :CtrlPBuffer nnoremap h :tabprev nnoremap l :tabnext " ------ nvim specific ------ if has('nvim') let g:airline#themes#dark#palette.terminal = copy(g:airline#themes#dark#palette.insert) tnoremap tmap tmap tmap tmap autocmd BufWinEnter,WinEnter term://* startinsert endif augroup formatting au! " strip trailing whitespace autocmd BufWritePre * :%s/\s\+$//e augroup end colorscheme seti if filereadable(expand('~/.vimrc.local')) source ~/.vimrc.local endif