X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/4bdc61c5a84bf3525cdc4a43c24cf6c871a28680..c93cac14db0f7770cf76cad899142f807b31b36a:/vim/vimrc diff --git a/vim/vimrc b/vim/vimrc index 34da981..17e2a1e 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -42,9 +42,11 @@ Plugin 'derekwyatt/vim-fswitch' " Plugin 'powerman/vim-plugin-viewdoc' Plugin 'airblade/vim-gitgutter' -Plugin 'Raimondi/delimitMate' -Plugin 'SirVer/ultisnips' -Plugin 'Lokaltog/vim-easymotion' +Plugin 'raimondi/delimitmate' +Plugin 'sirver/ultisnips' +Plugin 'lokaltog/vim-easymotion' +Plugin 'junegunn/vim-easy-align' +Plugin 'chrisbra/checkattach' " remove entries first set runtimepath -=$HOME/.vim @@ -158,8 +160,12 @@ set foldlevelstart=0 " value for 'foldlevel' when starting to edit a " save and restore folds set viewoptions=folds,cursor " don't save local options +" diff mode {{{2 +set diffopt=filler,vertical + " reading and writing files {{{2 -set nomodeline " don't read modelines +set modeline " read modelines +set modelines=2 " only check first/last 2 lines set writebackup " write a backup file before overwriting a file set backup " keep a backup after owerwriting a file set backupdir=$XDG_CACHE_HOME/vim// @@ -226,12 +232,6 @@ augroup cursor_pos \ endif augroup END -" auto source vimrc when saved {{{2 -augroup source_vimrc - au! - autocmd bufwritepost vimrc source $MYVIMRC -augroup END - " bindings {{{1 " allow both and / to be @@ -307,6 +307,10 @@ inoremap A cnoremap cnoremap +" proper movement when lines are wrapped +noremap j (v:count == 0 ? 'gj' : 'j') +noremap k (v:count == 0 ? 'gk' : 'k') + " disable arrows noremap noremap @@ -329,7 +333,7 @@ cnoremap nnoremap zx zMzxzz15 " edit vimrc in new tab -nmap ev :tabedit $MYVIMRC +nmap ev :tabedit $MYVIMRC:lcd %:p:h map :ls:b @@ -384,9 +388,19 @@ let g:airline_detect_whitespace=2 let g:airline#extensions#tabline#enabled = 1 let g:airline_powerline_fonts = 1 +" checkattach {{{2 +let g:checkattach_filebrowser = 'ranger' + " Gundo {{{2 nnoremap :GundoToggle +" fswitch {{{2 +nnoremap ff :FSHere +nnoremap fl :FSRight +nnoremap fh :FSLeft +nnoremap fL :FSSplitRight +nnoremap fH :FSSplitLeft + " fugitive {{{2 nmap dd :tab split \| Gdiff \| wincmd h " delete fugitive buffers when closed @@ -395,7 +409,7 @@ autocmd BufReadPost fugitive://* set bufhidden=delete nnoremap gs :Gstatus nnoremap gd :Gdiff nnoremap gc :tab Gcommit -v -nnoremap gw :Gwrite +nnoremap ga :Gwrite " NERDTree {{{2 " open/close NERDTree with \e @@ -429,16 +443,25 @@ let g:tagbar_iconchars = ['+', '-'] " UltiSnips {{{2 let g:UltiSnipsEditSplit = 'vertical' -let g:UltiSnipsSnippetsDir = "$XDG_CONFIG_HOME/vim/ultisnips" +let g:UltiSnipsSnippetsDir = expand("$XDG_CONFIG_HOME/vim/ultisnips") +let g:UltiSnipsSnippetDirectories = ["UltiSnips", "ultisnips"] +let g:UltiSnipsExpandTrigger = "" +let g:UltiSnipsJumpForwardTrigger = "" +let g:UltiSnipsJumpBackwardTrigger = "" " youcompleteme {{{2 let g:ycm_extra_conf_globlist = ['~/src/*','/mnt/data/src/*'] let g:ycm_global_ycm_extra_conf = expand('$XDG_CONFIG_HOME/vim/ycm_extra_conf.py') +let g:ycm_extra_conf_vim_data = ['getcwd()'] let g:ycm_add_preview_to_completeopt = 1 let g:ycm_autoclose_preview_window_after_insertion = 1 "let g:ycm_extra_conf_vim_data = ['%:p'] nnoremap jd :YcmCompleter GoTo +" vim-easy-align {{{2 +" start interactive EasyAlign in visual mode +vnoremap (EasyAlign) + " vim-json {{{2 let g:vim_json_syntax_conceal = 0 @@ -504,4 +527,3 @@ function! g:ToggleNumber() endfunction nnoremap n :call g:ToggleNumber() nnoremap N :setlocal relativenumber! -