Hello, I'd like to know if it's possible to scroll up or down the quick info that shows up for methods and stuff. I'm new to Vim so I'm trying to get some of the functionality I'm used to having in VS Code.
CodePudding user response:
Okay, answering my own question here. I'm excited to have finally found a solution.
So, if you're using the COC plugin for vim/neovim, add the following lines to your vim config file (.vimrc
or init.vim
) and you'll be able to scroll through the quick info menu using CTRL-F and CTRL-B for those long method docs.
" Remap <C-f> and <C-b> for scroll float windows/popups.
if has('nvim-0.4.0') || has('patch-8.2.0750')
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>"
inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>"
vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
endif
I'm still open to learning an alternative way, but this will do for now.