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 'Shougo/denite.nvim' Plug 'EinfachToll/DidYouMean' Plug 'diepm/vim-rest-console' Plug 'idanarye/vim-merginal' Plug 'vimwiki/vimwiki' Plug 'vim-scripts/dbext.vim', {'for': 'sql'} Plug 'cespare/vim-toml' Plug 'chrisbra/csv.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 if executable('kotlin') Plug 'udalov/kotlin-vim' endif if executable('ansible') Plug 'pearofducks/ansible-vim' endif if executable('rustc') Plug 'rust-lang/rust.vim' endif if executable('npm') Plug 'pangloss/vim-javascript' Plug 'mxw/vim-jsx' endif if executable('qml') Plug 'peterhoeg/vim-qml' endif Plug 'trusktr/seti.vim' call plug#end() " ----- plugin settings ------ let g:signify_vcs_list = [ 'git' ] let g:jsx_ext_required = 0 let g:airline_left_sep='' let g:airline_right_sep='' let g:vimwiki_list = [{'path': '~/.root/home/wiki'}] call denite#custom#option('_', 'cursor_wrap', 1) call denite#custom#option('_', 'prompt', '>') call denite#custom#map( \ 'insert', \ 'jj', \ '', \ 'noremap' \) call denite#custom#map( \ 'insert', \ '', \ '', \ 'noremap' \) call denite#custom#map( \ 'insert', \ '', \ '', \ 'noremap' \) call denite#custom#map( \ 'insert', \ '', \ '', \ 'noremap' \) call denite#custom#map( \ 'insert', \ '', \ '', \ 'noremap' \) " use rg or ag if present if executable('rg') call denite#custom#var('file_rec', 'command', \ ['rg', '--files', '--glob', '!.git', '']) call denite#custom#var('grep', 'command', ['rg']) call denite#custom#var('grep', 'default_opts', \ ['--vimgrep', '--no-heading']) call denite#custom#var('grep', 'recursive_opts', []) call denite#custom#var('grep', 'pattern_opt', ['--regexp']) call denite#custom#var('grep', 'separator', ['--']) call denite#custom#var('grep', 'final_opts', []) elseif executable('ag') call denite#custom#var('file_rec', 'command', \ ['ag', '--follow', '--nocolor', '--nogroup', '-g', '']) call denite#custom#var('grep', 'command', ['ag']) call denite#custom#var('grep', 'default_opts', \ ['-i', '--vimgrep']) call denite#custom#var('grep', 'recursive_opts', []) call denite#custom#var('grep', 'pattern_opt', []) call denite#custom#var('grep', 'separator', ['--']) call denite#custom#var('grep', 'final_opts', []) endif " ------ settings ------ " change terminal title set title " 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 unite nnoremap :Denite file_rec nnoremap :Denite buffer imap nnoremap h :tabprev nnoremap l :tabnext " grepper nnoremap f :Denite -mode=normal grep:. " git nnoremap gs :Gstatus nnoremap gb :Merginal " undo tree nnoremap ut :GundoToggle " vimrc nnoremap ve :vsplit $MYVIMRC nnoremap vs :source $MYVIMRC " ------ nvim specific ------ if has('nvim') set inccommand=split let g:airline_theme_patch_func = 'AirlineThemePatch' function! AirlineThemePatch(palette) let a:palette.terminal = copy(a:palette.insert) endfunction let g:terminal_scrollback_buffer_size = 10000 tnoremap tmap tmap tmap tmap tnoremap tnoremap tnoremap "+pi autocmd BufWinEnter,WinEnter term://* startinsert nnoremap tv :vsp term://zsh nnoremap to :term endif augroup formatting au! " strip trailing whitespace autocmd BufWritePre * :%s/\s\+$//e autocmd FileType markdown :set tw=80 augroup end colorscheme seti if filereadable(expand('~/.vimrc.local')) source ~/.vimrc.local endif