" ------------- " auto stuff " ------------- " Highlight the symbol and its references when holding the cursor. "autocmd CursorHold * silent call CocActionAsync('highlight') " ----------- " functions " ----------- function! s:check_back_space() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' endfunction " Use tab for trigger completion with characters ahead and navigate. " NOTE: Use command ':verbose imap ' to make sure tab is not mapped by " other plugin before putting this into your config. " short: When seeing an expression + typing tab => autocompletion "inoremap " \ pumvisible() ? "\" : " \ check_back_space() ? "\" : " \ coc#refresh() inoremap \ pumvisible() ? coc#_select_confirm() : \ coc#expandableOrJumpable() ? "\=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\" : \ check_back_space() ? "\" : \ coc#refresh() inoremap pumvisible() ? "\" : "\" function! s:show_documentation() if (index(['vim','help'], &filetype) >= 0) execute 'h '.expand('') else call CocAction('doHover') endif endfunction " Use Ctrl+d to show documentation in preview window. nnoremap :call show_documentation() inoremap :call show_documentation()