X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/41a01ab5953ca44e2bca83e991b8b4bad53bd786..53cdb87f3118aa9e0e6a7caa61e65e545fb54f3e:/vim/vimrc diff --git a/vim/vimrc b/vim/vimrc index f7a072b..77a35a3 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -25,7 +25,6 @@ Plugin 'majutsushi/tagbar' Plugin 'rking/ag.vim' Plugin 'scrooloose/nerdtree' Plugin 'scrooloose/syntastic' -Plugin 'sirver/ultisnips' Plugin 'sjl/gundo.vim' Plugin 'tomtom/tcomment_vim' Plugin 'tpope/vim-fugitive' @@ -34,6 +33,11 @@ Plugin 'tpope/vim-surround' Plugin 'tpope/vim-unimpaired' Plugin 'valloric/youcompleteme' +" snippets +Plugin 'sirver/ultisnips' +Plugin 'honza/vim-snippets' + +" ros Plugin 'ompugao/ros.vim' Plugin 'ompugao/ctrlp-ros' @@ -50,6 +54,7 @@ Plugin 'lokaltog/vim-easymotion' Plugin 'chrisbra/checkattach' Plugin 'klen/python-mode' Plugin 'nathanaelkane/vim-indent-guides' +Plugin 'vim-scripts/yankring.vim' " remove entries first set runtimepath -=$HOME/.vim @@ -252,6 +257,7 @@ augroup END map " make +nnoremap r :make nnoremap :make " unhighlight search @@ -289,8 +295,8 @@ nnoremap i :set list! nnoremap U :syntax sync fromstart:AirlineRefresh:redraw! " Ranger -nnoremap r :silent !ranger %:h:redraw! -nnoremap R :silent !ranger:redraw! +" nnoremap r :silent !ranger %:h:redraw! +" nnoremap R :silent !ranger:redraw! " Use sane regexes. nnoremap / /\v @@ -391,14 +397,14 @@ autocmd BufWinEnter *.* silent loadview " save with sudo cnoremap w!! w !sudo tee % > /dev/null -" plugins {{{1 +" plugins options {{{1 " ag {{{2 let g:AgSmartCase = 1 nnoremap ag yiw:Ag " vnoremap ag y:Ag " " airline {{{2 -let g:airline_detect_whitespace=2 +let g:airline#extensions#whitespace#enabled = 1 let g:airline#extensions#tabline#enabled = 1 let g:airline_powerline_fonts = 1 @@ -479,9 +485,42 @@ let g:tagbar_iconchars = ['+', '-'] let g:UltiSnipsEditSplit = 'vertical' let g:UltiSnipsSnippetsDir = expand("$XDG_CONFIG_HOME/vim/ultisnips") let g:UltiSnipsSnippetDirectories = ["UltiSnips", "ultisnips"] -let g:UltiSnipsExpandTrigger = "" -let g:UltiSnipsJumpForwardTrigger = "" -let g:UltiSnipsJumpBackwardTrigger = "" +let g:UltiSnipsExpandTrigger = "" +let g:UltiSnipsJumpForwardTrigger = "" +let g:UltiSnipsJumpBackwardTrigger = "" + +" UltiSnips completion function that tries to expand a snippet. If there's no +" snippet for expanding, it checks for completion window and if it's shown, +" selects first element. If there's no completion window it tries to jump to +" next placeholder. If there's no placeholder it just returns TAB key +" https://github.com/Valloric/YouCompleteMe/issues/36#issuecomment-15451411 +function! g:UltiSnips_Complete() + call UltiSnips#ExpandSnippet() + if g:ulti_expand_res == 0 + if pumvisible() + return "\" + else + call UltiSnips#JumpForwards() + if g:ulti_jump_forwards_res == 0 + return "\" + endif + endif + endif + return "" +endfunction +au InsertEnter * exec "inoremap " . g:UltiSnipsExpandTrigger . " =g:UltiSnips_Complete()" +let g:UltiSnipsListSnippets="" + +" yankring {{{2 +nnoremap p :YRShow +let g:yankring_history_dir = expand('$XDG_CACHE_HOME/vim') +let g:yankring_replace_n_pkey = '' +let g:yankring_replace_n_nkey = '' + +" map Y to y$ for the yank ring +function! YRRunAfterMaps() + nnoremap Y :YRYankCount 'y$' +endfunction " youcompleteme {{{2 let g:ycm_extra_conf_globlist = ['~/src/*','/mnt/data/src/*'] @@ -541,7 +580,6 @@ function! SwitchSpell() echo "setlocal spelllang=" g:myLangList[b:myLang] endfunction -nnoremap s :call ToggleSpell() -nnoremap S :call SwitchSpell() +nnoremap coS :call SwitchSpell() " fix spelling with first choice nnoremap f 1z=