Compare commits

..

No commits in common. "6720827d61277680738333e4d6e8492035e60ed6" and "90632d9d27b2c8c94ca62ad2fd6401fd2733ab4a" have entirely different histories.

2 changed files with 41 additions and 7 deletions

View file

@ -1,7 +0,0 @@
return function(variable, value)
vim.fn.chansend(vim.v.stderr, string.format(
"\x1b]1337;SetUserVar=%s=%s\x07\n",
variable,
vim.base64.encode(value)
))
end

View file

@ -1,5 +1,11 @@
let g:only_generic_hl=1 let g:only_generic_hl=1
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() function! s:term_bg_color()
let l:num_color=synIDattr(hlID("normal"), "bg") let l:num_color=synIDattr(hlID("normal"), "bg")
if $TERM=="xterm-kitty" || $KITTY_LISTEN_ON != "" if $TERM=="xterm-kitty" || $KITTY_LISTEN_ON != ""
@ -13,6 +19,8 @@ function! s:term_bg_color()
call jobstart('kitty @ --to $KITTY_LISTEN_ON set-colors background="'.l:color.'"') 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") call jobstart("cat ".$HOME."/darkrc/kitty_".&bg.".conf | grep cursor | sed -e 's/ /=/' | xargs -L 1 kitty @ --to $KITTY_LISTEN_ON set-colors")
end end
elseif $TERM_PROGRAM=="WezTerm"
call <SID>wez_color(l:num_color)
end end
endfun endfun
@ -28,9 +36,42 @@ function! s:term_bg_color_reset()
let l:file = $HOME."/darkrc/kitty_light.conf" let l:file = $HOME."/darkrc/kitty_light.conf"
end end
call system("kitty @ --to ".$KITTY_LISTEN_ON." set-colors ".l:file) call system("kitty @ --to ".$KITTY_LISTEN_ON." set-colors ".l:file)
elseif $TERM_PROGRAM=="WezTerm"
end end
endfun endfun
augroup termcolors augroup termcolors
au VimLeavePre * call <SID>term_bg_color_reset() au VimLeavePre * call <SID>term_bg_color_reset()
augroup END augroup END
com! Dark silent! let g:colors_name_bak = g:colors_name
\ | 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
com! Light silent! let g:colors_name_bak = g:colors_name
\ | 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
if filereadable($HOME."/.dark")
Dark
else
Light
end
if $TERM=="xterm-kitty" || match($TERM, '-256color$')
set termguicolors
if &bg=="dark"
colorscheme sierra
else
colorscheme PaperColor
end
end