From e25bd405d1b11f517ebd2f50c8eaa95e1f34d19c Mon Sep 17 00:00:00 2001 From: Jeff LANCE Date: Tue, 20 Oct 2020 17:44:49 +0200 Subject: [PATCH] Some changes for coc to work. --- vim/vim/functions.vim | 12 +++++++- vim/vim/keybindings.vim | 28 +++++++++++++++---- vim/vim/pack/kite/start/vim-plugin/VERSION | 2 +- .../kite/start/vim-plugin/plugin/kite.vim | 4 +-- 4 files changed, 36 insertions(+), 10 deletions(-) diff --git a/vim/vim/functions.vim b/vim/vim/functions.vim index 9bb871f..d55f775 100644 --- a/vim/vim/functions.vim +++ b/vim/vim/functions.vim @@ -94,10 +94,20 @@ endfunction function! s:show_documentation() if (index(['vim','help'], &filetype) >= 0) execute 'h '.expand('') + elseif (coc#rpc#ready()) + call CocActionAsync('doHover') else - call CocAction('doHover') + execute '!' . &keywordprg . " " . expand('') endif endfunction +"function! s:show_documentation() +" if (index(['vim','help'], &filetype) >= 0) +" execute 'h '.expand('') +" else +" call CocAction('doHover') +" endif +"endfunction + " ----- " }}} diff --git a/vim/vim/keybindings.vim b/vim/vim/keybindings.vim index 63f66a4..da43d94 100644 --- a/vim/vim/keybindings.vim +++ b/vim/vim/keybindings.vim @@ -52,8 +52,10 @@ command! -bang -nargs=? -complete=dir Files map :echom 'Close buffer' :call BufClose() map :e map :enew -map :bn -map :bp +map :bn +map :bp +imap :bn +imap :bp " ----- " }}} @@ -74,10 +76,10 @@ map :call WinMove('l') " Tabs {{{ " ----- -map tn :tabnew -map tc :tabclose -map :tabnext -map :tabnext +"map tn :tabnew :Startify +"map tc :tabclose +"map :tabnext +"map :tabprev " ----- " }}} @@ -104,6 +106,13 @@ else inoremap pumvisible() ? "\" : "\u\" endif +" Use to trigger completion. +if has('nvim') + inoremap coc#refresh() +else + inoremap coc#refresh() +endif + " Use `[g` and `]g` to navigate diagnostics " Use `:CocDiagnostics` to get all diagnostics of current buffer in location list. nmap [g (coc-diagnostic-prev) @@ -118,6 +127,13 @@ nmap gr (coc-references) " Use K to show documentation in preview window. nnoremap K :call show_documentation() +" Symbol renaming. +nmap rn (coc-rename) + +" Formatting selected code. +xmap f (coc-format-selected) +nmap f (coc-format-selected) + " ----- " }}} diff --git a/vim/vim/pack/kite/start/vim-plugin/VERSION b/vim/vim/pack/kite/start/vim-plugin/VERSION index 9d8637c..1edd062 100644 --- a/vim/vim/pack/kite/start/vim-plugin/VERSION +++ b/vim/vim/pack/kite/start/vim-plugin/VERSION @@ -1 +1 @@ -1.0.70 +1.0.71 diff --git a/vim/vim/pack/kite/start/vim-plugin/plugin/kite.vim b/vim/vim/pack/kite/start/vim-plugin/plugin/kite.vim index 0d10845..a86cab4 100644 --- a/vim/vim/pack/kite/start/vim-plugin/plugin/kite.vim +++ b/vim/vim/pack/kite/start/vim-plugin/plugin/kite.vim @@ -3,8 +3,8 @@ if exists('g:loaded_kite') || &cp endif if has('nvim') - if !has('nvim-0.2') - echoerr 'Kite requires Neovim 0.2 or greater' + if !has('nvim-0.3') + echoerr 'Kite requires Neovim 0.3 or greater' finish endif else