" pop-up (completion) menu mappings {{{ imap pumvisible() ? "\" : "\delimitMateCR" imap pumvisible() ? "\" : "\" imap pumvisible() ? "\" : "\" imap pumvisible() ? "\" : "\" " }}} if !g:vim_ide function IsCocEnabled() return 0 endfunction finish endif " coc.nvim {{{ " list of filetypes (that are added in language-specific scripts) for which " coc mappings are enabled let g:coc_filetypes = [] function IsCocEnabled() return index(g:coc_filetypes, &filetype) >= 0 endfunction command -nargs=* CocKeywordprg call CocAction('doHover') augroup vimrc-coc autocmd! autocmd FileType * if IsCocEnabled() \|let &l:formatexpr = "CocAction('formatSelected')" \|let &l:keywordprg = ":CocKeywordprg" \|endif autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') augroup end " mappings {{{ let g:coc_snippet_next = '' let g:coc_snippet_prev = '' inoremap coc#refresh() inoremap call CocActionAsync('showSignatureHelp') imap nmap [c (coc-diagnostic-prev) nmap ]c (coc-diagnostic-next) nmap gd (coc-definition) nmap gt (coc-type-definition) nmap gi (coc-implementation) nmap gr (coc-references) nmap (coc-rename) nmap (coc-codeaction-line) vmap (coc-codeaction-selected) " nmap qf (coc-fix-current) nnoremap l CocList nnoremap d CocList --auto-preview diagnostics nnoremap c CocList commands nnoremap o CocList --auto-preview outline nnoremap s CocList --interactive symbols nnoremap e CocList extensions nnoremap h CocPrev nnoremap k CocPrev nnoremap l CocNext nnoremap j CocNext nnoremap p CocListResume " }}} " CocFormat {{{ function s:CocFormat(range, line1, line2) abort if a:range == 0 call CocAction('format') else call cursor(a:line1, 1) normal! V call cursor(a:line2, 1) call CocAction('formatSelected', 'V') endif endfunction command! -nargs=0 -range -bar CocFormat call s:CocFormat(, , ) " }}} let g:coc_global_extensions = [] let g:coc_user_config = {} let g:coc_global_extensions += ['coc-snippets'] let g:coc_user_config['diagnostic'] = { \ 'virtualText': v:true, \ 'virtualTextCurrentLineOnly': v:false, \ 'enableMessage': 'jump', \ 'errorSign': 'XX', \ 'warningSign': '!!', \ } let g:coc_user_config['suggest.floatEnable'] = v:false let g:coc_user_config['workspace.progressTarget'] = "statusline" runtime! coc-languages/*.vim " }}}