mirror of
https://github.com/osyo-manga/vim-brightest.git
synced 2025-11-11 21:13:51 -05:00
37 lines
913 B
VimL
37 lines
913 B
VimL
scriptencoding utf-8
|
|
if exists('g:loaded_brightest')
|
|
finish
|
|
endif
|
|
let g:loaded_brightest = 1
|
|
|
|
let s:save_cpo = &cpo
|
|
set cpo&vim
|
|
|
|
|
|
let g:brightest_enable = get(g:, "brightest_enable", 1)
|
|
|
|
|
|
function! s:init_hl()
|
|
highlight BrightestDefaultCursorWord gui=underline guifg=NONE
|
|
highlight BrightestUnderline term=underline cterm=underline gui=underline
|
|
highlight BrightestUndercurl term=undercurl cterm=undercurl gui=undercurl
|
|
highlight BrightestCursorLineBg NONE
|
|
endfunction
|
|
call s:init_hl()
|
|
|
|
|
|
command! -bar BrightestEnable let g:brightest_enable = 1 | call brightest#highlighting()
|
|
command! -bar BrightestDisable let g:brightest_enable = 0 | call brightest#hl_clear()
|
|
|
|
augroup brightest
|
|
autocmd!
|
|
autocmd CursorMoved * call brightest#highlighting()
|
|
autocmd BufLeave,WinLeave,InsertEnter * call brightest#hl_clear()
|
|
autocmd ColorScheme * call s:init_hl()
|
|
augroup END
|
|
|
|
|
|
|
|
let &cpo = s:save_cpo
|
|
unlet s:save_cpo
|