From ea1d43170b01d56c20405042a0bf734d51541cb7 Mon Sep 17 00:00:00 2001 From: DanielSchuette Date: Tue, 26 Oct 2021 00:02:38 +0200 Subject: [PATCH] enable popup scrolling for neovim's coc --- vim-config/configs.vim | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/vim-config/configs.vim b/vim-config/configs.vim index 8734f371..713556af 100644 --- a/vim-config/configs.vim +++ b/vim-config/configs.vim @@ -314,14 +314,27 @@ let g:ycm_filetype_specific_completion_to_disable = {} " Coc Configs " ----------- -" highlights, NOTE: this doesn't really work (didn't bother to fix it) +" Highlights, NOTE: this doesn't really work (didn't bother to fix it). highlight CocErrorSign ctermfg=Red ctermbg=Black highlight CocWarningSign ctermfg=Yellow ctermbg=Blue -" enable autocompletion on tab +" Enable autocompletion on tab. set completeopt=longest,menuone -" disable completion for TypeScript +" Use key up/down for scrolling documentation popup windows. +if has('nvim-0.4.3') || has('patch-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)\" : "\" + inoremap coc#float#has_scroll() ? "\=coc#float#scroll(1)\" : "\" + inoremap coc#float#has_scroll() ? "\=coc#float#scroll(0)\" : "\" +endif + +" inoremap coc#util#has_float() ? FloatScroll(1) : "\" +" inoremap coc#util#has_float() ? FloatScroll(0) : "\" + +" Disable completion for TypeScript. autocmd BufNew,BufEnter *.ts execute "silent! CocDisable" autocmd BufLeave *.ts execute "silent! CocEnable"