diff --git a/home/.vimrc.d/dev-environ.vim b/home/.vimrc.d/dev-environ.vim index 104f61a..4345301 100644 --- a/home/.vimrc.d/dev-environ.vim +++ b/home/.vimrc.d/dev-environ.vim @@ -59,21 +59,24 @@ let g:vimspector_install_gadgets = ['debugpy'] " Config for Coc originally from their github. " Use tab for trigger completion with characters ahead and navigate -inoremap - \ coc#pum#visible() ? coc#pum#next(1) : - \ CheckBackspace() ? "\" : - \ coc#refresh() -inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" +" If node is not available Coc will not be loaded so disable. +if executable('node') " Coc only works if nodejs is available. + inoremap + \ coc#pum#visible() ? coc#pum#next(1) : + \ CheckBackspace() ? "\" : + \ coc#refresh() + inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" -" Make to accept selected completion item or notify coc.nvim to format -inoremap coc#pum#visible() ? coc#pum#confirm() - \: "\u\\=coc#on_enter()\" + " Make to accept selected completion item or notify coc.nvim to format + inoremap coc#pum#visible() ? coc#pum#confirm() + \: "\u\\=coc#on_enter()\" -" Use to trigger completion -inoremap coc#refresh() + " Use to trigger completion + inoremap coc#refresh() -" Dependenciy of the above. fom Coc github. -function! CheckBackspace() abort - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~# '\s' -endfunction + " Dependenciy of the above. fom Coc github. + function! CheckBackspace() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' + endfunction +endif