yingmanwumen
yingmanwumen

Reputation: 119

How to scroll the hover area in Vim when showing documentation with coc.nvim

I can use K to show the man pages in Vim before I install the coc.nvim. And when I using the coc.nvim to do the same thing, instead of man pages, the documentation was in a hover are. But sometimes, the text cannot be displayed at one time, like this:

enter image description here

I have tried many ways to scroll the hover area, j, Ctrl+j, Shift+j, Ctrl+p, Shift+p, Tab, j..., but they didn't work.

So what can I do to scroll the documentation so that I can read the whole text

Upvotes: 5

Views: 3625

Answers (2)

yingmanwumen
yingmanwumen

Reputation: 119

My vim version was too low, after updating it, the problem had been solved

Upvotes: 0

fannheyward
fannheyward

Reputation: 19287

Check :h coc#float#has_scroll:

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

Upvotes: 6

Related Questions