2020-05-18 14:32:01 +00:00
|
|
|
let g:only_generic_hl=1
|
|
|
|
|
2024-02-28 22:21:58 +00:00
|
|
|
function! s:wez_color(value)
|
|
|
|
let g:__color = a:value
|
|
|
|
lua vim.g.__color = vim.base64.encode(vim.g.__color)
|
|
|
|
call chansend(v:stderr, "\x1b]1337;SetUserVar=bgcolor=".g:__color."\x07")
|
|
|
|
endfun
|
|
|
|
|
|
|
|
function! s:term_bg_color()
|
|
|
|
let l:num_color=synIDattr(hlID("normal"), "bg")
|
2021-12-21 14:45:37 +00:00
|
|
|
if $TERM=="xterm-kitty" || $KITTY_LISTEN_ON != ""
|
2020-08-17 13:54:59 +00:00
|
|
|
if l:num_color!=""
|
2023-05-08 13:51:51 +00:00
|
|
|
if match(l:num_color, "^\\d\\{3}$")==0
|
|
|
|
let l:color=system("kitty @ --to $KITTY_LISTEN_ON get-colors | grep 'color".l:num_color."'")
|
|
|
|
let l:color=l:color[match(l:color, "#"):]
|
|
|
|
elseif match(l:num_color, "^#\\x\\{6}$")==0
|
|
|
|
let l:color=l:num_color
|
|
|
|
end
|
2023-05-09 11:34:04 +00:00
|
|
|
call jobstart('kitty @ --to $KITTY_LISTEN_ON set-colors background="'.l:color.'"')
|
|
|
|
call jobstart("cat ".$HOME."/darkrc/kitty_".&bg.".conf | grep cursor | sed -e 's/ /=/' | xargs -L 1 kitty @ --to $KITTY_LISTEN_ON set-colors")
|
2020-08-17 13:54:59 +00:00
|
|
|
end
|
2024-02-28 22:21:58 +00:00
|
|
|
elseif $TERM_PROGRAM=="WezTerm"
|
|
|
|
call <SID>wez_color(l:num_color)
|
2020-08-17 13:54:59 +00:00
|
|
|
end
|
|
|
|
endfun
|
2021-12-21 14:45:37 +00:00
|
|
|
|
2024-02-28 22:21:58 +00:00
|
|
|
augroup termcolors
|
|
|
|
au ColorScheme * call <SID>term_bg_color()
|
2020-08-17 13:58:45 +00:00
|
|
|
augroup END
|
2020-08-17 13:54:59 +00:00
|
|
|
|
2024-02-28 22:21:58 +00:00
|
|
|
function! s:term_bg_color_reset()
|
|
|
|
if $TERM=="xterm-kitty" || $KITTY_LISTEN_ON != ""
|
|
|
|
if filereadable($HOME."/.dark")
|
|
|
|
let l:file = $HOME."/darkrc/kitty_dark.conf"
|
|
|
|
else
|
|
|
|
let l:file = $HOME."/darkrc/kitty_light.conf"
|
|
|
|
end
|
|
|
|
call system("kitty @ --to ".$KITTY_LISTEN_ON." set-colors ".l:file)
|
|
|
|
elseif $TERM_PROGRAM=="WezTerm"
|
2020-08-19 16:41:42 +00:00
|
|
|
end
|
|
|
|
endfun
|
|
|
|
|
2024-02-28 22:21:58 +00:00
|
|
|
augroup termcolors
|
|
|
|
au VimLeavePre * call <SID>term_bg_color_reset()
|
|
|
|
augroup END
|
2020-08-17 13:54:59 +00:00
|
|
|
|
2020-05-18 14:32:01 +00:00
|
|
|
com! Dark silent! let g:colors_name_bak = g:colors_name
|
2020-08-17 12:54:08 +00:00
|
|
|
\ | let g:ayucolor="dark"
|
|
|
|
\ | let g:arcadia_Daybreak=0
|
|
|
|
\ | let g:arcadia_Midnight=1
|
|
|
|
\ | let g:alduin_Shout_Become_Ethereal=1
|
|
|
|
\ | set bg=dark
|
|
|
|
\ | silent! exec "colorscheme ".g:colors_name_bak
|
|
|
|
\ | silent! delc PaperColor
|
2020-05-18 14:32:01 +00:00
|
|
|
com! Light silent! let g:colors_name_bak = g:colors_name
|
2020-08-17 12:54:08 +00:00
|
|
|
\ | let g:ayucolor="light"
|
|
|
|
\ | let g:arcadia_Daybreak=1
|
|
|
|
\ | let g:arcadia_Midnight=0
|
|
|
|
\ | let g:alduin_Shout_Become_Ethereal=0
|
|
|
|
\ | set bg=light
|
|
|
|
\ | silent! exec "colorscheme ".g:colors_name_bak
|
|
|
|
\ | silent! delc PaperColor
|
2020-05-18 14:32:01 +00:00
|
|
|
|
2020-08-17 15:27:04 +00:00
|
|
|
if filereadable($HOME."/.dark")
|
|
|
|
Dark
|
|
|
|
else
|
|
|
|
Light
|
|
|
|
end
|
|
|
|
|
2021-08-16 08:21:31 +00:00
|
|
|
if $TERM=="xterm-kitty" || match($TERM, '-256color$')
|
2023-06-21 07:51:25 +00:00
|
|
|
set termguicolors
|
2023-06-26 07:40:35 +00:00
|
|
|
if &bg=="dark"
|
|
|
|
colorscheme sierra
|
|
|
|
else
|
|
|
|
colorscheme PaperColor
|
|
|
|
end
|
2020-08-17 12:56:50 +00:00
|
|
|
end
|