From 0f64a62f6bf2ebef93f37cfc22999dee31e9d687 Mon Sep 17 00:00:00 2001 From: gurkenhabicht Date: Sun, 12 Nov 2023 20:18:23 +0100 Subject: [PATCH] typo --- vim/.vimrc | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/vim/.vimrc b/vim/.vimrc index 9edff72..473afb0 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -6,6 +6,7 @@ syntax on filetype plugin on set tabstop=4 shiftwidth=4 autoindent smartindent expandtab set mouse=v +set ttymouse=xterm """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " @@ -134,6 +135,19 @@ autocmd BufWritePre * :call UpdateGitBranch() autocmd BufReadPost * :call UpdateGitBranch() autocmd BufEnter * :call UpdateGitBranch() augroup end + +function! LinterStatus() abort + let l:counts = ale#statusline#Count(bufnr('')) + + let l:all_errors = l:counts.error + l:counts.style_error + let l:all_non_errors = l:counts.total - l:all_errors + + return l:counts.total == 0 ? 'OK' : printf( + \ 'Lint: %dW %dE', + \ all_non_errors, + \ all_errors + \) +endfunction set laststatus=2 set statusline= @@ -145,6 +159,7 @@ set statusline+=\ %M set statusline+=\ %r set statusline+=\ %F set statusline+=%= "Right side settings +set statusline+=\ [%{LinterStatus()}\] set statusline+=\ %y set statusline+=%#CursorColumn# set statusline+=\ %{&fileencoding?&fileencoding:&encoding} @@ -192,7 +207,7 @@ function! AutoHighlightToggle() au! au CursorHold * let @/ = '\V\<'.escape(expand(''), '\').'\>' augroup end - setl updatetime=500 + setl updatetime=1600 endfunction call AutoHighlightToggle() @@ -201,17 +216,26 @@ call AutoHighlightToggle() " Code Completion " """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +set lazyredraw set splitright let g:ale_enabled = 1 let g:ale_hover_enabled = 1 +let g:ale_set_balloons = 1 +let g:ale_sign_error = '✗' +let g:ale_sign_warning = '' let g:ale_completion_enabled = 1 let g:ale_completion_autoimport = 1 " let g:ale_floating_window_border = ['│', '─', '╭', '╮', '╯', '╰', '│', '─'] -let g:ale_floating_window_border = repeat([''], 8) -" let g:ale_close_preview_on_insert = 1 -" let g:ale_popup_menu_enabled = 1 -" nmap gr :ALEFindReferences -" nmap K :ALEHover +" let g:ale_floating_window_border = repeat([''], 8) +let g:ale_close_preview_on_insert = 1 +let g:ale_hover_to_preview = 1 + +let g:ale_echo_msg_error_str = 'E' +let g:ale_echo_msg_warning_str = 'W' +let g:ale_echo_msg_format = '[%linter%], [%severity%] %s' " let g:ale_popup_menu_enabled = 1 +nmap gr :ALEFindReferences +nmap T :ALEHover +" nmap gd :ALEGoToDefinition " set completeopt+=menuone " set completeopt+=noselect @@ -219,11 +243,11 @@ let g:ale_floating_window_border = repeat([''], 8) set shortmess+=c " Shut off completion messages set belloff+=ctrlg " Add only if Vim beeps during completion let g:mucomplete#enable_auto_at_startup = 1 -let g:mucomplete#completion_delay = 1 +let g:mucomplete#completion_delay = 0 " set omnifunc=syntaxcomplete#Complete " set omnifunc=ale#completion#Complete -set omnifunc=ale#completion#OmniFunc +" set omnifunc=ale#completion#OmniFunc "let g:ale_completion_enabled=1 "function! OpenCompletion() " if !pumvisible() && ((v:char >= 'a' && v:char <= 'z') || (v:char >= 'A' && v:char <= 'Z')) @@ -232,13 +256,12 @@ set omnifunc=ale#completion#OmniFunc "endfunction " "autocmd InsertCharPre * call OpenCompletion() -let g:ale_set_balloons=1 " set completeopt+=longest,menu,menuone,preview,noselect,noinsert set splitkeep=screen "" set completeopt+=menuone,noselect,noinsert "" -autocmd InsertLeave,CompleteDone * if pumvisible() == 0 | pclose | endif +" autocmd InsertLeave,CompleteDone * if pumvisible() == 0 | pclose | endif " "