7

I can use K to show the man pages in Vim before I install coc.nvim. And when I am using coc.nvim to do the same thing, instead of man pages, the documentation is in a hover. 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

3
  • vi.stackexchange.com Commented Oct 26, 2021 at 9:42
  • Did you try the mouse/trackpad? Commented Oct 26, 2021 at 9:53
  • Shift-k will activate the lsp hover but leave you in visual mode, in the buffer. If you type shift-k again focus will move to the hover and you can scroll around using all the usual keys (j, k, C-f, C-d, C-b, page-up, page-down etc) and type q to dismiss the popup. Commented Jul 24 at 15:49

2 Answers 2

7

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
Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.