automatic light/dark toggle keymap

This commit is contained in:
Baipyrus 2024-06-01 13:01:11 +02:00
parent 2067f93aec
commit 0e848f1dac

View File

@ -10,6 +10,11 @@ return {
-- Load the colorscheme here. -- Load the colorscheme here.
vim.cmd.colorscheme 'catppuccin-mocha' vim.cmd.colorscheme 'catppuccin-mocha'
-- Toggle light/dark mode with mocha/latte
vim.keymap.set('n', '<leader>tt', function()
vim.cmd.colorscheme(vim.o.background == 'dark' and 'catppuccin-latte' or 'catppuccin-mocha')
end, { desc = '[T]oggle [T]heme' })
-- You can configure highlights by doing something like: -- You can configure highlights by doing something like:
vim.cmd.hi 'Comment gui=none' vim.cmd.hi 'Comment gui=none'
end, end,