themes.lua 991 B

12345678910111213141516171819202122232425262728293031323334353637
  1. -- Theme configuration for Lumacs
  2. -- This file demonstrates how to configure and switch themes from Lua
  3. function switch_to_everforest()
  4. editor:set_theme("everforest-dark")
  5. message("Switched to Everforest dark theme")
  6. end
  7. function switch_to_default()
  8. editor:set_theme("default")
  9. message("Switched to default theme")
  10. end
  11. function switch_to_dracula()
  12. editor:set_theme("dracula")
  13. message("Switched to Dracula theme")
  14. end
  15. function list_themes()
  16. local themes = editor:theme_manager():theme_names()
  17. local theme_list = "Available themes: "
  18. for i, name in ipairs(themes) do
  19. theme_list = theme_list .. name
  20. if i < #themes then
  21. theme_list = theme_list .. ", "
  22. end
  23. end
  24. message(theme_list)
  25. end
  26. -- Key bindings for theme switching
  27. bind_key("C-x t e", switch_to_everforest)
  28. bind_key("C-x t d", switch_to_default)
  29. bind_key("C-x t v", switch_to_dracula)
  30. bind_key("C-x t l", list_themes)
  31. print("Theme configuration loaded")