call plug#begin('~/.vim/plugged') Plug 'tpope/vim-sensible' Plug 'tpope/vim-sleuth' Plug 'tpope/vim-fugitive' Plug 'bling/vim-airline' Plug 'mhinz/vim-signify' Plug 'Shougo/unite.vim' Plug 'trusktr/seti.vim' call plug#end() " ----- plugin settings ------ let g:signify_vcs_list = [ 'git' ] call unite#filters#matcher_default#use(['matcher_fuzzy']) " use ag if present if executable('ag') " we run a wrapper around ag so it respects agignore let g:unite_source_rec_async_command = ['sh', expand('~/.vim/ag-unite')] endif autocmd FileType unite call s:unite_settings() function! s:unite_settings() " Enable navigation with control-j and control-k in insert mode imap (unite_select_next_line) imap (unite_select_previous_line) endfunction " ------ settings ------ " default indentation set shiftwidth=2 set tabstop=4 set expandtab " permanent undo history set undofile set undodir=~/.vim/undo " 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 unite nnoremap :Unite -no-split -buffer-name=files -start-insert file_rec nnoremap :Unite -no-split -buffer-name=buffers -start-insert buffer " ------ nvim specific ------ if has('nvim') tnoremap jj tnoremap nnoremap :Unite -no-split -buffer-name=files -start-insert file_rec/neovim endif augroup formatting au! " strip trailing whitespace autocmd BufWritePre * :%s/\s\+$//e augroup end colorscheme seti