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.

29 lines
536 B

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