" let g:coc_global_extensions = ['coc-pyright', 'coc-rls', 'coc-clangd', 'coc-tsserver', 'coc-html', 'coc-cmake', 'coc-json', 'coc-sh', 'coc-java'] " let g:coc_global_extensions = ['coc-pyright', 'coc-tsserver'] let g:coc_data_home = g:vim_dir . '/coc' let g:coc_config_home = g:vim_dir . '/coc' " Use to trigger completion. if has('nvim') inoremap coc#refresh() else inoremap coc#refresh() endif set updatetime=300 " Make auto-select the first completion item and notify coc.nvim to " format on enter, could be remapped by other vim plugin inoremap pumvisible() ? coc#_select_confirm() \: "\u\\=coc#on_enter()\" " GoTo code navigation. nmap gd (coc-definition) nmap gy (coc-type-definition) nmap gi (coc-implementation) nmap gr (coc-references) " Use K to show documentation in preview window. nnoremap K :call show_documentation() function! s:show_documentation() if CocAction('hasProvider', 'hover') call CocActionAsync('doHover') else call feedkeys('K', 'in') endif endfunction " Symbol renaming. nmap rn (coc-rename) " Formatting selected code. xmap f (coc-format-selected) nmap f (coc-format-selected) augroup mygroup autocmd! " Setup formatexpr specified filetype(s). autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') " Update signature help on jump placeholder. autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') augroup end " Apply AutoFix to problem on the current line. nmap qf (coc-fix-current) " Remap and for scroll float windows/popups. if has('nvim-0.4.0') || has('patch-8.2.0750') nnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" nnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" inoremap coc#float#has_scroll() ? "\=coc#float#scroll(1)\" : "\" inoremap coc#float#has_scroll() ? "\=coc#float#scroll(0)\" : "\" vnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" vnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" endif " Mappings for CoCList " Show all diagnostics. nnoremap a :CocList diagnostics " Manage extensions. " nnoremap e :CocList extensions " Show commands. nnoremap c :CocList commands " Find symbol of current document. nnoremap o :CocList outline " Search workspace symbols. nnoremap s :CocList -I symbols " Do default action for next item. nnoremap j :CocNext " Do default action for previous item. nnoremap k :CocPrev " Resume latest coc list. nnoremap p :CocListResume "COC LSP SETTING let g:coc_user_config = { \ 'suggest.noselect': v:true, \ 'suggest.enablePreselect': v:false, } call coc#config("java.jdt.ls.vmargs", '-javaagent:' . g:mydotfiles_directory . '/config/coc/java/lombok-1.18.26.jar') call coc#config("java.jdt.ls.lombokSupport.enabled", v:false) call coc#config("java.inlayHints.parameterNames.enabled", v:false) call coc#config("inlayHint.enable", v:false) for section in ['suggest', 'diagnostic', 'signature', 'hover'] call coc#config(section.'.floatConfig.border', v:true) call coc#config(section.'.floatConfig.rounded', v:true) call coc#config(section.'.floatConfig.highlight', 'Normal') " transparent setting (only for neovim) call coc#config(section.'.floatConfig.winblend', 6) endfor