fix: documentation binding, coc diagnostic navigation
This commit is contained in:
@@ -87,8 +87,8 @@ nmap <silent> <leader>E :CocCommand explorer --reveal expand('<sfile>')<cr>
|
|||||||
|
|
||||||
|
|
||||||
" coc.nvim
|
" coc.nvim
|
||||||
" Ctrl-n - Go to previous diagnostic
|
" Ctrl-n - Go to next diagnostic
|
||||||
" Ctrl-p - Go to next diagnostic
|
" Ctrl-p - Go to previous diagnostic
|
||||||
" <l>c - Open command list
|
" <l>c - Open command list
|
||||||
" <l>d - Jump to definition of current symbol
|
" <l>d - Jump to definition of current symbol
|
||||||
" <l>r - Jump to references of current symbol
|
" <l>r - Jump to references of current symbol
|
||||||
@@ -96,8 +96,8 @@ nmap <silent> <leader>E :CocCommand explorer --reveal expand('<sfile>')<cr>
|
|||||||
" <l>s - Fuzzy search current project symbols
|
" <l>s - Fuzzy search current project symbols
|
||||||
" <l>n - Symbol renaming
|
" <l>n - Symbol renaming
|
||||||
" <l>k - Symbol renaming
|
" <l>k - Symbol renaming
|
||||||
nmap <silent> <C-n> <Plug>(coc-diagnostic-prev)
|
nmap <silent> <C-n> <Plug>(coc-diagnostic-next)
|
||||||
nmap <silent> <C-p> <Plug>(coc-diagnostic-next)
|
nmap <silent> <C-p> <Plug>(coc-diagnostic-prev)
|
||||||
nmap <silent> <leader>d <Plug>(coc-definition)
|
nmap <silent> <leader>d <Plug>(coc-definition)
|
||||||
nmap <silent> <leader>r <Plug>(coc-references)
|
nmap <silent> <leader>r <Plug>(coc-references)
|
||||||
nmap <silent> <leader>j <Plug>(coc-implementation)
|
nmap <silent> <leader>j <Plug>(coc-implementation)
|
||||||
@@ -112,26 +112,23 @@ nnoremap <leader>h :%s///<left><left>
|
|||||||
nnoremap <silent> <leader>/ :nohlsearch<cr>
|
nnoremap <silent> <leader>/ :nohlsearch<cr>
|
||||||
|
|
||||||
|
|
||||||
" use <tab> for trigger completion and navigate to next complete item
|
" <c-@> - trigger completion
|
||||||
|
" <tab> - trigger completion and navigate to next complete item
|
||||||
|
inoremap <silent><expr> <c-@> coc#refresh()
|
||||||
inoremap <silent><expr> <TAB>
|
inoremap <silent><expr> <TAB>
|
||||||
\ pumvisible() ? "\<C-n>" :
|
\ pumvisible() ? "\<C-n>" :
|
||||||
\ <SID>check_back_space() ? "\<TAB>" :
|
\ <SID>check_back_space() ? "\<TAB>" :
|
||||||
\ coc#refresh()
|
\ coc#refresh()
|
||||||
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
|
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function! s:check_back_space() abort
|
function! s:check_back_space() abort
|
||||||
let col = col('.') - 1
|
let col = col('.') - 1
|
||||||
return !col || getline('.')[col - 1] =~ '\s'
|
return !col || getline('.')[col - 1] =~ '\s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Use <c-space> to trigger completion.
|
" K - show documentation in preview window
|
||||||
if has('nvim')
|
|
||||||
inoremap <silent><expr> <c-space> coc#refresh()
|
|
||||||
else
|
|
||||||
inoremap <silent><expr> <c-@> coc#refresh()
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Use K to show documentation in preview window.
|
|
||||||
nnoremap <silent> K :call <SID>show_documentation()<cr>
|
nnoremap <silent> K :call <SID>show_documentation()<cr>
|
||||||
|
|
||||||
function! s:show_documentation()
|
function! s:show_documentation()
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ Plug 'junegunn/goyo.vim'
|
|||||||
Plug 'junegunn/limelight.vim'
|
Plug 'junegunn/limelight.vim'
|
||||||
|
|
||||||
" DOcumentation GEneraton
|
" DOcumentation GEneraton
|
||||||
Plug 'kkoomen/vim-doge'
|
Plug 'kkoomen/vim-doge', { 'do': { -> doge#install({ 'headless': 1 }) } }
|
||||||
|
|
||||||
" auto-close plugins
|
" auto-close plugins
|
||||||
Plug 'tpope/vim-endwise'
|
Plug 'tpope/vim-endwise'
|
||||||
|
|||||||
Reference in New Issue
Block a user