From 2d27e598b6984f21e47ea1ada2716066187edfbe Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Fri, 21 Oct 2022 02:01:02 +0200 Subject: [PATCH] vim:coc: Use tabs for indentation --- .config/vim/vimrc.d/25-coc.vim | 50 ++++++++++++++++------------------ 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/.config/vim/vimrc.d/25-coc.vim b/.config/vim/vimrc.d/25-coc.vim index 0244821..4318dbb 100644 --- a/.config/vim/vimrc.d/25-coc.vim +++ b/.config/vim/vimrc.d/25-coc.vim @@ -5,10 +5,6 @@ set nobackup set nowritebackup -" Having longer updatetime (default is 4000 ms = 4 s) 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 @@ -21,21 +17,21 @@ inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" " 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): - \ CheckBackspace() ? "\" : - \ coc#refresh() + \ coc#pum#visible() ? coc#pum#next(1): + \ CheckBackspace() ? "\" : + \ coc#refresh() inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" function! CheckBackspace() abort - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~# '\s' + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' endfunction " Use to trigger completion. if has('nvim') - inoremap coc#refresh() + inoremap coc#refresh() else - inoremap coc#refresh() + inoremap coc#refresh() endif " Make to accept selected completion item or notify coc.nvim to format @@ -58,11 +54,11 @@ nmap gr (coc-references) nnoremap K :call ShowDocumentation() function! ShowDocumentation() - if CocAction('hasProvider', 'hover') - call CocActionAsync('doHover') - else - call feedkeys('K', 'in') - endif + if CocAction('hasProvider', 'hover') + call CocActionAsync('doHover') + else + call feedkeys('K', 'in') + endif endfunction " Highlight the symbol and its references when holding the cursor. @@ -76,11 +72,11 @@ nmap rn (coc-rename) " 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') + 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 " Applying codeAction to the selected region. @@ -109,12 +105,12 @@ omap ao (coc-classobj-a) " 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) : "\" + 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 " Use CTRL-S for selections ranges.