neovim-confs/lua/vscode.lua

24 lines
857 B
Lua

vim.api.nvim_exec([[
" THEME CHANGER
function! SetCursorLineNrColorInsert(mode)
" Insert mode: blue
if a:mode == "i"
call VSCodeNotify('nvim-theme.insert')
" Replace mode: red
elseif a:mode == "r"
call VSCodeNotify('nvim-theme.replace')
endif
endfunction
augroup CursorLineNrColorSwap
autocmd!
autocmd ModeChanged *:[vV\x16]* call VSCodeNotify('nvim-theme.visual')
autocmd ModeChanged *:[R]* call VSCodeNotify('nvim-theme.replace')
autocmd InsertEnter * call SetCursorLineNrColorInsert(v:insertmode)
autocmd InsertLeave * call VSCodeNotify('nvim-theme.normal')
autocmd CursorHold * call VSCodeNotify('nvim-theme.normal')
autocmd ModeChanged [vV\x16]*:* call VSCodeNotify('nvim-theme.normal')
augroup END
]], false)