![]() " Update signature help on jump placeholder autocmd User CocJumpPlaceholder call CocActionAsync( 'showSignatureHelp ')Īugroup end " Applying code actions to the selected code block " Example: `aap` for current paragraph xmap a (coc -codeaction -selected) ![]() " Formatting selected code xmap f (coc -format -selected)Īugroup mygroup autocmd ! " Setup formatexpr specified filetype(s) autocmd FileType typescript,json setl formatexpr = CocAction( 'formatSelected ') " Use K to show documentation in preview window nnoremap K : call ShowDocumentation() function ! ShowDocumentation()Įndif endfunction " Highlight the symbol and its references when holding the cursor autocmd CursorHold * silent call CocActionAsync( 'highlight ') " GoTo code navigation nmap gd (coc -definition) ') =~# '\s ' endfunction " Use to trigger completion if has( 'nvim ')Įndif " Use `g` to navigate diagnostics " Use `:CocDiagnostics` to get all diagnostics of current buffer in location list nmap [ g (coc -diagnostic - prev) \: " \u \\=coc#on_enter() \ " function ! CheckBackspace() abort let col = col( '. ![]() Inoremap coc#pum#visible() ? coc#pum#prev( 1) : " \ " " Make to accept selected completion item or notify coc.nvim to format " u breaks current undo, please make your own choice inoremap coc#pum#visible() ? coc#pum#confirm() " Use tab for trigger completion with characters ahead and navigate " NOTE: There's always complete item selected by default, you may want to enable " no select by `"suggest.noselect": true` in your configuration file " NOTE: Use command ':verbose imap ' to make sure tab is not mapped by " other plugin before putting this into your config inoremap \ coc#pum#visible() ? coc#pum#next( 1) : " May need for Vim (not Neovim) since coc.nvim calculates byte offset by count " utf-8 byte sequence set encoding =utf - 8 " Some servers have issues with backup files, see #649 set nobackup set nowritebackup " Having longer updatetime (default is 4000 ms = 4s) leads to noticeable " delays and poor user experience set updatetime = 300 " Always show the signcolumn, otherwise it would shift the text each time " diagnostics appear/become resolved set signcolumn =yes
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |