require('catppuccin').setup { transparent_background = false, } local day = 9 local night = 18 local hour = os.date("*t").hour print("hour" .. hour) local themes = { "catppuccin-macchiato", "catppuccin-mocha" } local theme = 1 if day <= hour and hour < night then theme = 1 else theme = 2 end vim.cmd.colorscheme(themes[theme]) local function toggletheme() if theme == 1 then theme = 2 else theme = 1 end vim.cmd.colorscheme(themes[theme]) end vim.api.nvim_create_user_command("ToggleTheme", toggletheme, {})