Map coc.nvim bindings only if coc is installed
This commit is contained in:
parent
601ba8f1ec
commit
37fb739795
|
@ -1,17 +1,20 @@
|
|||
map <silent> gd <Plug>(coc-definition)
|
||||
if exists(":CocAction")
|
||||
set signcolumn=yes
|
||||
map <silent> gd <Plug>(coc-definition)
|
||||
|
||||
map <silent> <M-=> :call CocAction("doHover")<cr>
|
||||
map <silent> <Leader>t <Plug>(coc-type-definition)
|
||||
map <silent> <Leader>u <Plug>(coc-references)
|
||||
map <silent> <Leader>r <Plug>(coc-rename)
|
||||
map <silent> <Leader>q <Plug>(coc-quickfix)
|
||||
map <silent> <M-=> <cmd>call CocAction("doHover")<cr>
|
||||
map <silent> <Leader>t <Plug>(coc-type-definition)
|
||||
map <silent> <Leader>u <Plug>(coc-references)
|
||||
map <silent> <Leader>r <Plug>(coc-rename)
|
||||
map <silent> <Leader>q <Plug>(coc-quickfix)
|
||||
|
||||
map <silent> <Leader>F <Plug>(coc-format)
|
||||
map <silent> <Leader>f <Plug>(coc-format-selected)
|
||||
vmap <silent> <Leader>f <Plug>(coc-format-selected)
|
||||
map <silent> <Leader>F <Plug>(coc-format)
|
||||
map <silent> <Leader>f <Plug>(coc-format-selected)
|
||||
vmap <silent> <Leader>f <Plug>(coc-format-selected)
|
||||
|
||||
map <silent> <M-a> <Plug>(coc-codeaction)
|
||||
vmap <silent> <M-a> <Plug>(coc-codeaction-selected)
|
||||
map <silent> <M-a> <Plug>(coc-codeaction)
|
||||
vmap <silent> <M-a> <Plug>(coc-codeaction-selected)
|
||||
|
||||
omap <silent> af <Plug>(coc-funcobj-a)
|
||||
omap <silent> if <Plug>(coc-funcobj-i)
|
||||
omap <silent> af <Plug>(coc-funcobj-a)
|
||||
omap <silent> if <Plug>(coc-funcobj-i)
|
||||
endif
|
||||
|
|
|
@ -7,14 +7,13 @@ endif
|
|||
"inoremap <expr><C-h> deoplete#smart_close_popup()."\<C-h>"
|
||||
"inoremap <expr><BS> deoplete#smart_close_popup()."\<C-h>"
|
||||
|
||||
inoremap <silent><expr> <TAB>
|
||||
\ pumvisible() ? "\<C-n>" :
|
||||
\ <SID>check_back_space() ? "\<TAB>" :
|
||||
\ coc#refresh()
|
||||
"\ '\<C-x><C-o>'
|
||||
"inoremap <silent><expr> <TAB>
|
||||
" \ pumvisible() ? "\<C-n>" :
|
||||
" \ <SID>check_back_space() ? "\<TAB>" :
|
||||
" \ '\<C-x><C-o>'
|
||||
|
||||
function! s:check_back_space()
|
||||
let col = col('.') - 1
|
||||
return !col || getline('.')[col - 1] =~ '\s'
|
||||
endfunction
|
||||
inoremap <silent><expr> <c-space> coc#refresh()
|
||||
"inoremap <silent> <c-space> <C-x><C-o>
|
||||
|
|
Loading…
Reference in a new issue