Add do#show_documentation() using coc.nvim

Change the `K` normal mode overrides to use the example given in the
coc.nvim README file which uses Vim's builtin help when in `vim` or
`help` files, or checks if coc.nvim is ready and invokes
`CocActionAsync('doHover')`, otherwise fallback to using `keywordprg`.
This commit is contained in:
2021-02-22 20:48:33 +00:00
parent ecd8659df7
commit 3a2337cd63
6 changed files with 17 additions and 17 deletions

View File

@@ -1,9 +1,10 @@
" coc.nvim
nmap <leader>fi <Plug>(coc-fix-current)
nmap <leader>gd <Plug>(coc-definition)
nmap <leader>gt <Plug>(coc-type-definition)
nmap <leader>sd <Plug>(coc-diagnostic-info)
nmap <leader>gr <Plug>(coc-references)
nnoremap <silent> <leader>fi <Plug>(coc-fix-current)
nnoremap <silent> <leader>gd <Plug>(coc-definition)
nnoremap <silent> <leader>gt <Plug>(coc-type-definition)
nnoremap <silent> <leader>sd <Plug>(coc-diagnostic-info)
nnoremap <silent> <leader>gr <Plug>(coc-references)
nnoremap <silent> K :call do#show_documentation()<CR>
if has('nvim')
" Make nvim :terminal more like vim :terminal
@@ -110,8 +111,6 @@ nnoremap <C-s> i<C-g>u<C-X>s
" Disable 'Q' from opening Ex mode
nnoremap Q <nop>
" Disable 'K' from loading man pages
noremap K <nop>
" Split line at the cursor
nnoremap [j i<CR><Esc>