set hidden set nobackup set nowritebackup set cmdheight=2 set shortmess+=c set signcolumn=yes set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')} function! s:show_documentation() if (index(['vim','help'], &filetype) >= 0) execute 'h '.expand('') else call CocAction('doHover') endif endfunction command! -nargs=0 Format :call CocAction('format') " Binds nnoremap K :call show_documentation() nnoremap a :CocList diagnostics nnoremap e :CocList extensions nnoremap c :CocList commands nnoremap o :CocList outline nnoremap s :CocList -I symbols nnoremap j :CocNext nnoremap k :CocPrev nnoremap p :CocListResume nnoremap . (coc-codeaction-selected) nmap [g (coc-diagnostic-prev) nmap ]g (coc-diagnostic-next) nmap gd (coc-definition) nmap gy (coc-type-definition) nmap gi (coc-implementation) nmap gr (coc-references) nmap rn (coc-rename) nmap f (coc-format-selected) xmap f (coc-format-selected) inoremap coc#refresh() function! s:cocActionsOpenFromSelected(type) abort execute 'CocCommand actions.open ' . a:type endfunction xmap a :execute 'CocCommand actions.open ' . visualmode() nmap a :set operatorfunc=cocActionsOpenFromSelectedg@ nmap ac (coc-codeaction) nmap qf (coc-fix-current)