|
@@ -73,13 +73,6 @@ endfunction
|
|
" Highlight the symbol and its references when holding the cursor.
|
|
" Highlight the symbol and its references when holding the cursor.
|
|
autocmd CursorHold * silent call CocActionAsync('highlight')
|
|
autocmd CursorHold * silent call CocActionAsync('highlight')
|
|
|
|
|
|
-" Symbol renaming.
|
|
|
|
-nmap <leader>rn <Plug>(coc-rename)
|
|
|
|
-
|
|
|
|
-" Formatting selected code.
|
|
|
|
-xmap <leader>f <Plug>(coc-format-selected)
|
|
|
|
-nmap <leader>f <Plug>(coc-format-selected)
|
|
|
|
-
|
|
|
|
augroup mygroup
|
|
augroup mygroup
|
|
autocmd!
|
|
autocmd!
|
|
" Setup formatexpr specified filetype(s).
|
|
" Setup formatexpr specified filetype(s).
|
|
@@ -88,29 +81,6 @@ augroup mygroup
|
|
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
|
|
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
|
|
augroup end
|
|
augroup end
|
|
|
|
|
|
-" Applying codeAction to the selected region.
|
|
|
|
-" Example: `<leader>aap` for current paragraph
|
|
|
|
-xmap <leader>a <Plug>(coc-codeaction-selected)
|
|
|
|
-nmap <leader>a <Plug>(coc-codeaction-selected)
|
|
|
|
-
|
|
|
|
-" Remap keys for applying codeAction to the current line.
|
|
|
|
-nmap <leader>ac <Plug>(coc-codeaction)
|
|
|
|
-" Apply AutoFix to problem on the current line.
|
|
|
|
-nmap <leader>qf <Plug>(coc-fix-current)
|
|
|
|
-
|
|
|
|
-" Introduce function text object
|
|
|
|
-" NOTE: Requires 'textDocument.documentSymbol' support from the language server.
|
|
|
|
-xmap if <Plug>(coc-funcobj-i)
|
|
|
|
-xmap af <Plug>(coc-funcobj-a)
|
|
|
|
-omap if <Plug>(coc-funcobj-i)
|
|
|
|
-omap af <Plug>(coc-funcobj-a)
|
|
|
|
-
|
|
|
|
-" Use <TAB> for selections ranges.
|
|
|
|
-" NOTE: Requires 'textDocument/selectionRange' support from the language server.
|
|
|
|
-" coc-tsserver, coc-python are the examples of servers that support it.
|
|
|
|
-"nmap <silent> <TAB> <Plug>(coc-range-select)
|
|
|
|
-"xmap <silent> <TAB> <Plug>(coc-range-select)
|
|
|
|
-
|
|
|
|
" Add `:Format` command to format current buffer.
|
|
" Add `:Format` command to format current buffer.
|
|
command! -nargs=0 Format :call CocAction('format')
|
|
command! -nargs=0 Format :call CocAction('format')
|
|
|
|
|
|
@@ -129,7 +99,7 @@ set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
|
|
" Show all diagnostics.
|
|
" Show all diagnostics.
|
|
nnoremap <silent> <space>a :<C-u>CocList diagnostics<cr>
|
|
nnoremap <silent> <space>a :<C-u>CocList diagnostics<cr>
|
|
" Manage extensions.
|
|
" Manage extensions.
|
|
-nnoremap <silent> <space>e :<C-u>CocList extensions<cr>
|
|
|
|
|
|
+nnoremap <silent> <space>x :<C-u>CocList extensions<cr>
|
|
" Show commands.
|
|
" Show commands.
|
|
nnoremap <silent> <space>c :<C-u>CocList commands<cr>
|
|
nnoremap <silent> <space>c :<C-u>CocList commands<cr>
|
|
" Find symbol of current document.
|
|
" Find symbol of current document.
|
|
@@ -142,3 +112,5 @@ nnoremap <silent> <space>j :<C-u>CocNext<CR>
|
|
nnoremap <silent> <space>k :<C-u>CocPrev<CR>
|
|
nnoremap <silent> <space>k :<C-u>CocPrev<CR>
|
|
" Resume latest coc list.
|
|
" Resume latest coc list.
|
|
nnoremap <silent> <space>p :<C-u>CocListResume<CR>
|
|
nnoremap <silent> <space>p :<C-u>CocListResume<CR>
|
|
|
|
+
|
|
|
|
+nmap <silent> <C-_> <Plug>(pydocstring)
|