From 0e848f1dac59af3919867aa04dd080f6f139b329 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Sat, 1 Jun 2024 13:01:11 +0200 Subject: [PATCH] automatic light/dark toggle keymap --- lua/custom/plugins/catppuccin.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/custom/plugins/catppuccin.lua b/lua/custom/plugins/catppuccin.lua index 4afdc4e..71f8716 100644 --- a/lua/custom/plugins/catppuccin.lua +++ b/lua/custom/plugins/catppuccin.lua @@ -10,6 +10,11 @@ return { -- Load the colorscheme here. vim.cmd.colorscheme 'catppuccin-mocha' + -- Toggle light/dark mode with mocha/latte + vim.keymap.set('n', '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: vim.cmd.hi 'Comment gui=none' end,