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.

25 lines
469 B

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