chore: upgraded coc
Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
This commit is contained in:
parent
bc52b26200
commit
52a75000c2
@ -1,16 +1,19 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@yaegassy/coc-intelephense": ">=0.22.4",
|
"@yaegassy/coc-intelephense": ">=0.24.1",
|
||||||
"coc-clangd": ">=0.21.4",
|
"coc-clangd": ">=0.23.0",
|
||||||
"coc-cmake": ">=0.2.1",
|
"coc-cmake": ">=0.2.1",
|
||||||
"coc-css": ">=1.3.0",
|
"coc-css": ">=1.3.0",
|
||||||
"coc-html": ">=1.6.1",
|
"coc-html": ">=1.6.1",
|
||||||
"coc-java": ">=1.5.5",
|
"coc-java": ">=1.5.5",
|
||||||
"coc-json": ">=1.4.2",
|
"coc-json": ">=1.4.2",
|
||||||
"coc-python": ">=1.2.13",
|
"coc-python": ">=1.2.13",
|
||||||
"coc-rust-analyzer": ">=0.62.1",
|
"coc-rust-analyzer": ">=0.64.1",
|
||||||
"coc-sh": ">=0.6.1",
|
"coc-sh": ">=0.7.0",
|
||||||
"coc-texlab": ">=3.2.0",
|
"coc-texlab": ">=3.2.0",
|
||||||
"coc-tsserver": ">=1.10.4"
|
"coc-tsserver": ">=1.10.5"
|
||||||
}
|
},
|
||||||
|
"disabled": [],
|
||||||
|
"locked": [],
|
||||||
|
"lastUpdate": 1664812478230
|
||||||
}
|
}
|
@ -1,5 +1,6 @@
|
|||||||
set number norelativenumber
|
set number norelativenumber
|
||||||
set noshowmode
|
set noshowmode
|
||||||
|
set mouse=
|
||||||
|
|
||||||
" https://stackoverflow.com/a/1878983
|
" https://stackoverflow.com/a/1878983
|
||||||
set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab
|
set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab
|
||||||
|
@ -1,43 +1,35 @@
|
|||||||
" Set internal encoding of vim, not needed on neovim, since coc.nvim using some
|
" May need for vim (not neovim) since coc.nvim calculate byte offset by count
|
||||||
" unicode characters in the file autoload/float.vim
|
" utf-8 byte sequence.
|
||||||
set encoding=utf-8
|
set encoding=utf-8
|
||||||
|
|
||||||
" TextEdit might fail if hidden is not set.
|
|
||||||
set hidden
|
|
||||||
|
|
||||||
" Some servers have issues with backup files, see #649.
|
" Some servers have issues with backup files, see #649.
|
||||||
set nobackup
|
set nobackup
|
||||||
set nowritebackup
|
set nowritebackup
|
||||||
|
|
||||||
" Give more space for displaying messages.
|
|
||||||
set cmdheight=2
|
|
||||||
|
|
||||||
" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
|
" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
|
||||||
" delays and poor user experience.
|
" delays and poor user experience.
|
||||||
set updatetime=300
|
set updatetime=300
|
||||||
|
|
||||||
" Don't pass messages to |ins-completion-menu|.
|
|
||||||
set shortmess+=c
|
|
||||||
|
|
||||||
" Always show the signcolumn, otherwise it would shift the text each time
|
" Always show the signcolumn, otherwise it would shift the text each time
|
||||||
" diagnostics appear/become resolved.
|
" diagnostics appear/become resolved.
|
||||||
if has("patch-8.1.1564")
|
|
||||||
" Recently vim can merge signcolumn and number column into one
|
|
||||||
set signcolumn=number
|
|
||||||
else
|
|
||||||
set signcolumn=yes
|
set signcolumn=yes
|
||||||
endif
|
|
||||||
|
|
||||||
" Use tab for trigger completion with characters ahead and navigate.
|
" 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 <tab>' to make sure tab is not mapped by
|
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
|
||||||
" other plugin before putting this into your config.
|
" other plugin before putting this into your config.
|
||||||
inoremap <silent><expr> <TAB>
|
inoremap <silent><expr> <TAB>
|
||||||
\ pumvisible() ? "\<C-n>" :
|
\ coc#pum#visible() ? coc#pum#next(1) :
|
||||||
\ <SID>check_back_space() ? "\<TAB>" :
|
\ CheckBackspace() ? "\<Tab>" :
|
||||||
\ coc#refresh()
|
\ coc#refresh()
|
||||||
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
|
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
|
||||||
|
|
||||||
function! s:check_back_space() abort
|
" Make <CR> to accept selected completion item or notify coc.nvim to format
|
||||||
|
" <C-g>u breaks current undo, please make your own choice.
|
||||||
|
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
|
||||||
|
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
|
||||||
|
|
||||||
|
function! CheckBackspace() abort
|
||||||
let col = col('.') - 1
|
let col = col('.') - 1
|
||||||
return !col || getline('.')[col - 1] =~# '\s'
|
return !col || getline('.')[col - 1] =~# '\s'
|
||||||
endfunction
|
endfunction
|
||||||
@ -49,11 +41,6 @@ else
|
|||||||
inoremap <silent><expr> <c-@> coc#refresh()
|
inoremap <silent><expr> <c-@> coc#refresh()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Make <CR> auto-select the first completion item and notify coc.nvim to
|
|
||||||
" format on enter, <cr> could be remapped by other vim plugin
|
|
||||||
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm()
|
|
||||||
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
|
|
||||||
|
|
||||||
" Use `[g` and `]g` to navigate diagnostics
|
" Use `[g` and `]g` to navigate diagnostics
|
||||||
" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list.
|
" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list.
|
||||||
nmap <silent> [g <Plug>(coc-diagnostic-prev)
|
nmap <silent> [g <Plug>(coc-diagnostic-prev)
|
||||||
@ -66,15 +53,13 @@ nmap <silent> gi <Plug>(coc-implementation)
|
|||||||
nmap <silent> gr <Plug>(coc-references)
|
nmap <silent> gr <Plug>(coc-references)
|
||||||
|
|
||||||
" Use K to show documentation in preview window.
|
" Use K to show documentation in preview window.
|
||||||
nnoremap <silent> K :call <SID>show_documentation()<CR>
|
nnoremap <silent> K :call ShowDocumentation()<CR>
|
||||||
|
|
||||||
function! s:show_documentation()
|
function! ShowDocumentation()
|
||||||
if (index(['vim','help'], &filetype) >= 0)
|
if CocAction('hasProvider', 'hover')
|
||||||
execute 'h '.expand('<cword>')
|
|
||||||
elseif (coc#rpc#ready())
|
|
||||||
call CocActionAsync('doHover')
|
call CocActionAsync('doHover')
|
||||||
else
|
else
|
||||||
execute '!' . &keywordprg . " " . expand('<cword>')
|
call feedkeys('K', 'in')
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@ -106,6 +91,9 @@ nmap <leader>ac <Plug>(coc-codeaction)
|
|||||||
" Apply AutoFix to problem on the current line.
|
" Apply AutoFix to problem on the current line.
|
||||||
nmap <leader>qf <Plug>(coc-fix-current)
|
nmap <leader>qf <Plug>(coc-fix-current)
|
||||||
|
|
||||||
|
" Run the Code Lens action on the current line.
|
||||||
|
nmap <leader>cl <Plug>(coc-codelens-action)
|
||||||
|
|
||||||
" Map function and class text objects
|
" Map function and class text objects
|
||||||
" NOTE: Requires 'textDocument.documentSymbol' support from the language server.
|
" NOTE: Requires 'textDocument.documentSymbol' support from the language server.
|
||||||
xmap if <Plug>(coc-funcobj-i)
|
xmap if <Plug>(coc-funcobj-i)
|
||||||
@ -133,13 +121,13 @@ nmap <silent> <C-s> <Plug>(coc-range-select)
|
|||||||
xmap <silent> <C-s> <Plug>(coc-range-select)
|
xmap <silent> <C-s> <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 CocActionAsync('format')
|
||||||
|
|
||||||
" Add `:Fold` command to fold current buffer.
|
" Add `:Fold` command to fold current buffer.
|
||||||
command! -nargs=? Fold :call CocAction('fold', <f-args>)
|
command! -nargs=? Fold :call CocAction('fold', <f-args>)
|
||||||
|
|
||||||
" Add `:OR` command for organize imports of the current buffer.
|
" Add `:OR` command for organize imports of the current buffer.
|
||||||
command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport')
|
command! -nargs=0 OR :call CocActionAsync('runCommand', 'editor.action.organizeImport')
|
||||||
|
|
||||||
" Add (Neo)Vim's native statusline support.
|
" Add (Neo)Vim's native statusline support.
|
||||||
" NOTE: Please see `:h coc-status` for integrations with external plugins that
|
" NOTE: Please see `:h coc-status` for integrations with external plugins that
|
||||||
|
Loading…
Reference in New Issue
Block a user