Neovim configs for 2023. Hopefully they last.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
513 B

2 years ago
2 years ago
2 years ago
  1. require('catppuccin').setup {
  2. transparent_background = true,
  3. }
  4. local day = 9
  5. local night = 18
  6. local hour = os.date("*t").hour
  7. local themes = { "catppuccin-macchiato", "catppuccin-mocha" }
  8. local theme = 1
  9. if day <= hour and hour < night then
  10. theme = 1
  11. else
  12. theme = 2
  13. end
  14. vim.cmd.colorscheme(themes[theme])
  15. local function toggletheme()
  16. if theme == 1 then
  17. theme = 2
  18. else
  19. theme = 1
  20. end
  21. vim.cmd.colorscheme(themes[theme])
  22. end
  23. vim.api.nvim_create_user_command("ToggleTheme", toggletheme, {})