This commit is contained in:
gurkenhabicht 2023-11-12 20:18:23 +01:00
parent 58a3752477
commit 0f64a62f6b
1 changed files with 33 additions and 10 deletions

View File

@ -6,6 +6,7 @@ syntax on
filetype plugin on filetype plugin on
set tabstop=4 shiftwidth=4 autoindent smartindent expandtab set tabstop=4 shiftwidth=4 autoindent smartindent expandtab
set mouse=v set mouse=v
set ttymouse=xterm
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" "
@ -134,6 +135,19 @@ autocmd BufWritePre * :call UpdateGitBranch()
autocmd BufReadPost * :call UpdateGitBranch() autocmd BufReadPost * :call UpdateGitBranch()
autocmd BufEnter * :call UpdateGitBranch() autocmd BufEnter * :call UpdateGitBranch()
augroup end 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 laststatus=2
set statusline= set statusline=
@ -145,6 +159,7 @@ set statusline+=\ %M
set statusline+=\ %r set statusline+=\ %r
set statusline+=\ %F set statusline+=\ %F
set statusline+=%= "Right side settings set statusline+=%= "Right side settings
set statusline+=\ [%{LinterStatus()}\]
set statusline+=\ %y set statusline+=\ %y
set statusline+=%#CursorColumn# set statusline+=%#CursorColumn#
set statusline+=\ %{&fileencoding?&fileencoding:&encoding} set statusline+=\ %{&fileencoding?&fileencoding:&encoding}
@ -192,7 +207,7 @@ function! AutoHighlightToggle()
au! au!
au CursorHold * let @/ = '\V\<'.escape(expand('<cword>'), '\').'\>' au CursorHold * let @/ = '\V\<'.escape(expand('<cword>'), '\').'\>'
augroup end augroup end
setl updatetime=500 setl updatetime=1600
endfunction endfunction
call AutoHighlightToggle() call AutoHighlightToggle()
@ -201,17 +216,26 @@ call AutoHighlightToggle()
" Code Completion " Code Completion
" "
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set lazyredraw
set splitright set splitright
let g:ale_enabled = 1 let g:ale_enabled = 1
let g:ale_hover_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_enabled = 1
let g:ale_completion_autoimport = 1 let g:ale_completion_autoimport = 1
" let g:ale_floating_window_border = ['│', '─', '╭', '╮', '╯', '╰', '│', '─'] " let g:ale_floating_window_border = ['│', '─', '╭', '╮', '╯', '╰', '│', '─']
let g:ale_floating_window_border = repeat([''], 8) " let g:ale_floating_window_border = repeat([''], 8)
" let g:ale_close_preview_on_insert = 1 let g:ale_close_preview_on_insert = 1
" let g:ale_popup_menu_enabled = 1 let g:ale_hover_to_preview = 1
" nmap gr :ALEFindReferences<CR>
" nmap K :ALEHover<CR> 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<CR>
nmap T :ALEHover<CR>
" nmap gd :ALEGoToDefinition<CR>
" set completeopt+=menuone " set completeopt+=menuone
" set completeopt+=noselect " set completeopt+=noselect
@ -219,11 +243,11 @@ let g:ale_floating_window_border = repeat([''], 8)
set shortmess+=c " Shut off completion messages set shortmess+=c " Shut off completion messages
set belloff+=ctrlg " Add only if Vim beeps during completion set belloff+=ctrlg " Add only if Vim beeps during completion
let g:mucomplete#enable_auto_at_startup = 1 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=syntaxcomplete#Complete
" set omnifunc=ale#completion#Complete " set omnifunc=ale#completion#Complete
set omnifunc=ale#completion#OmniFunc " set omnifunc=ale#completion#OmniFunc
"let g:ale_completion_enabled=1 "let g:ale_completion_enabled=1
"function! OpenCompletion() "function! OpenCompletion()
" if !pumvisible() && ((v:char >= 'a' && v:char <= 'z') || (v:char >= 'A' && v:char <= 'Z')) " if !pumvisible() && ((v:char >= 'a' && v:char <= 'z') || (v:char >= 'A' && v:char <= 'Z'))
@ -232,13 +256,12 @@ set omnifunc=ale#completion#OmniFunc
"endfunction "endfunction
" "
"autocmd InsertCharPre * call OpenCompletion() "autocmd InsertCharPre * call OpenCompletion()
let g:ale_set_balloons=1
" "
set completeopt+=longest,menu,menuone,preview,noselect,noinsert set completeopt+=longest,menu,menuone,preview,noselect,noinsert
set splitkeep=screen set splitkeep=screen
"" set completeopt+=menuone,noselect,noinsert "" set completeopt+=menuone,noselect,noinsert
"" ""
autocmd InsertLeave,CompleteDone * if pumvisible() == 0 | pclose | endif " autocmd InsertLeave,CompleteDone * if pumvisible() == 0 | pclose | endif
" "
" "