Skip to content
Snippets Groups Projects
Commit 3cc9aeea authored by Henrik Tjäder's avatar Henrik Tjäder
Browse files

Latest coc requires setting these

parent bd9b7195
Branches
No related tags found
No related merge requests found
...@@ -950,9 +950,26 @@ nmap <silent> <leader>me <Plug>(coc-command)expandMacro ...@@ -950,9 +950,26 @@ nmap <silent> <leader>me <Plug>(coc-command)expandMacro
nmap <silent> <leader>gh :CocCommand clangd.switchSourceHeader<CR> nmap <silent> <leader>gh :CocCommand clangd.switchSourceHeader<CR>
nmap <silent> <leader>gH :CocCommand clangd.switchSourceHeader vsplit<CR> nmap <silent> <leader>gH :CocCommand clangd.switchSourceHeader vsplit<CR>
nmap <silent> <leader>gsi :CocCommand clangd.SymbolInfo<CR> nmap <silent> <leader>gsi :CocCommand clangd.SymbolInfo<CR>
" From coc-completion-help 2022-08-01
inoremap <expr> <cr> coc#pum#visible() ? coc#_select_confirm() : "\<CR>"
" Use K to show documentation in preview window " 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:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction
" Insert <tab> when previous text is space, refresh completion if not.
inoremap <silent><expr> <TAB>
\ coc#pum#visible() ? coc#pum#next(1):
\ <SID>check_back_space() ? "\<Tab>" :
\ coc#refresh()
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
function! s:show_documentation() function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0) if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>') execute 'h '.expand('<cword>')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment