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.

34 lines
747 B

2 years ago
  1. require('gruvbox').setup {
  2. }
  3. local day = 9
  4. local night = 18
  5. local hour = os.date("*t").hour
  6. local themes = { "gruvbox", "gruvbox" }
  7. local theme = 1
  8. if day <= hour and hour < night then
  9. theme = 1
  10. else
  11. theme = 2
  12. end
  13. vim.cmd.colorscheme(themes[theme])
  14. vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
  15. vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
  16. local function toggletheme()
  17. if theme == 1 then
  18. theme = 2
  19. vim.cmd('set background=dark')
  20. else
  21. theme = 1
  22. vim.cmd('set background=light')
  23. end
  24. --vim.cmd.colorscheme(themes[theme])
  25. --vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
  26. --vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
  27. end
  28. vim.api.nvim_create_user_command("ToggleTheme", toggletheme, {})