Add more colorscheme and ability to switch
This commit is contained in:
21
lua/utils/colorscheme.lua
Normal file
21
lua/utils/colorscheme.lua
Normal file
@ -0,0 +1,21 @@
|
||||
local M = {}
|
||||
|
||||
-- List of installed colorschemes
|
||||
M.themes = { "tokyonight", "catppuccin", "gruvbox" }
|
||||
|
||||
-- Picker function
|
||||
function M.pick()
|
||||
vim.ui.select(M.themes, {
|
||||
prompt = "Choose Colorscheme:",
|
||||
}, function(choice)
|
||||
if choice then
|
||||
-- Load lazy plugin if needed
|
||||
pcall(require, choice)
|
||||
|
||||
-- Apply the colorscheme
|
||||
vim.cmd.colorscheme(choice)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
return M
|
||||
Reference in New Issue
Block a user