This commit is contained in:
Christoph J. Scherr 2024-03-06 11:43:46 +01:00
parent bddb567c11
commit a07b964ee5
Signed by: cscherrNT
GPG Key ID: 8E2B45BC51A27EA7
3 changed files with 29 additions and 1 deletions

View File

@ -137,6 +137,11 @@ local function augroup(name)
return vim.api.nvim_create_augroup("plex_" .. name, {}) return vim.api.nvim_create_augroup("plex_" .. name, {})
end end
-- guis
if vim.g.vscode then
require("vscode")
end
-- mappings -- mappings
local load_mappings = function(section, mapping_opt) local load_mappings = function(section, mapping_opt)
vim.schedule(function() vim.schedule(function()

View File

@ -329,7 +329,7 @@ M.edit = {
-- format -- format
["<leader>ff"] = { ["<leader>ff"] = {
vim.lsp.buf.format(), "gg=G",
"format buffer", "format buffer",
}, },
}, },

23
lua/vscode.lua Normal file
View File

@ -0,0 +1,23 @@
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)