From f37c1626291a25aadb64650f1293b0a01d0729b5 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 10 Nov 2020 19:28:12 -0500 Subject: updates --- plug-config/coc/coc.vim | 26 ++++++++++++++++++++++++-- vim-plug/plugins.vim | 2 ++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/plug-config/coc/coc.vim b/plug-config/coc/coc.vim index 597d39d9..0b0631ca 100644 --- a/plug-config/coc/coc.vim +++ b/plug-config/coc/coc.vim @@ -33,11 +33,19 @@ nnoremap K :call show_documentation() 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 +" set keywordprg=:call\ CocActionAsync('doHover') +" augroup VimHelp +" autocmd! +" autocmd Filetype vim,help setlocal keywordprg=:help +" augroup END + " Highlight the symbol and its references when holding the cursor. autocmd CursorHold * silent call CocActionAsync('highlight') @@ -69,6 +77,20 @@ xmap af (coc-funcobj-a) omap if (coc-funcobj-i) omap af (coc-funcobj-a) +" Remap and for scroll float windows/popups. +" Note coc#float#scroll works on neovim >= 0.4.3 or vim >= 8.2.0750 +nnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" +nnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" +inoremap coc#float#has_scroll() ? "\=coc#float#scroll(1)\" : "\" +inoremap coc#float#has_scroll() ? "\=coc#float#scroll(0)\" : "\" + +" NeoVim-only mapping for visual mode scroll +" Useful on signatureHelp after jump placeholder of snippet expansion +if has('nvim') + vnoremap coc#float#has_scroll() ? coc#float#nvim_scroll(1, 1) : "\" + vnoremap coc#float#has_scroll() ? coc#float#nvim_scroll(0, 1) : "\" +endif + " Add `:Format` command to format current buffer. command! -nargs=0 Format :call CocAction('format') @@ -81,7 +103,7 @@ command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organize " Add (Neo)Vim's native statusline support. " NOTE: Please see `:h coc-status` for integrations with external plugins that " provide custom statusline: lightline.vim, vim-airline. -set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')} +" set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')} " Mappings using CoCList: " Show all diagnostics. diff --git a/vim-plug/plugins.vim b/vim-plug/plugins.vim index e541adde..7774b7a3 100644 --- a/vim-plug/plugins.vim +++ b/vim-plug/plugins.vim @@ -111,6 +111,8 @@ call plug#begin('~/.config/nvim/autoload/plugged') " Debugging Plug 'puremourning/vimspector' Plug 'szw/vim-maximizer' + " Neovim in Browser + Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } } " Rainbow brackets " Plug 'luochen1990/rainbow' " Async Linting Engine -- cgit v1.2.3