mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
refactor: set all custom highlight in one function
This commit is contained in:
parent
e348ca93b4
commit
644e8af39f
@ -56,24 +56,27 @@ augroup END
|
||||
" highlight yanked region, see `:h lua-highlight`
|
||||
augroup custom_highlight
|
||||
autocmd!
|
||||
autocmd ColorScheme * highlight YankColor ctermfg=59 ctermbg=41 guifg=#34495E guibg=#2ECC71
|
||||
autocmd ColorScheme * call s:custom_highlight()
|
||||
augroup END
|
||||
|
||||
function! s:custom_highlight() abort
|
||||
" For yank highlight
|
||||
highlight YankColor ctermfg=59 ctermbg=41 guifg=#34495E guibg=#2ECC71
|
||||
|
||||
" For cursor colors
|
||||
highlight Cursor cterm=bold gui=bold guibg=#00c918 guifg=black
|
||||
highlight Cursor2 guifg=red guibg=red
|
||||
|
||||
" For floating windows border highlight
|
||||
highlight FloatBorder guifg=LightGreen guibg=NONE
|
||||
|
||||
" highlight for matching parentheses
|
||||
highlight MatchParen cterm=underline gui=underline
|
||||
endfunction
|
||||
|
||||
augroup highlight_yank
|
||||
autocmd!
|
||||
au TextYankPost * silent! lua vim.highlight.on_yank{higroup="YankColor", timeout=300}
|
||||
augroup END
|
||||
|
||||
" Highlight groups for cursor color
|
||||
augroup cursor_color
|
||||
autocmd!
|
||||
autocmd ColorScheme * highlight Cursor cterm=bold gui=bold guibg=#00c918 guifg=black
|
||||
autocmd ColorScheme * highlight Cursor2 guifg=red guibg=red
|
||||
augroup END
|
||||
|
||||
augroup float_border_color
|
||||
autocmd!
|
||||
autocmd ColorScheme * highlight FloatBorder guifg=LightGreen guibg=NONE
|
||||
au TextYankPost * silent! lua vim.highlight.on_yank{higroup="YankColor", timeout=300, on_visual=false}
|
||||
augroup END
|
||||
|
||||
augroup auto_close_win
|
||||
|
||||
@ -458,18 +458,6 @@ let g:matchup_delim_noskips = 0
|
||||
" Show offscreen match pair in popup window
|
||||
let g:matchup_matchparen_offscreen = {'method': 'popup'}
|
||||
|
||||
" Change highlight color of matching bracket for better visual effects
|
||||
augroup matchup_matchparen_highlight
|
||||
autocmd!
|
||||
autocmd ColorScheme * highlight MatchParen cterm=underline gui=underline
|
||||
augroup END
|
||||
|
||||
" Show matching keyword as underlined text to reduce color clutter
|
||||
augroup matchup_matchword_highlight
|
||||
autocmd!
|
||||
autocmd ColorScheme * hi MatchWord cterm=underline gui=underline
|
||||
augroup END
|
||||
|
||||
"""""""""""""""""""""""""" asyncrun.vim settings """"""""""""""""""""""""""
|
||||
" Automatically open quickfix window of 6 line tall after asyncrun starts
|
||||
let g:asyncrun_open = 6
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user