mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-02 21:44:37 +02:00
feat(colorscheme)!: LazyVim now loads the colorscheme configured with config.colorscheme. See the docs for more info
This commit is contained in:
parent
4d7455ad2c
commit
08f6375e4c
2 changed files with 20 additions and 8 deletions
|
@ -5,6 +5,12 @@ M.lazy_version = ">=9.1.0"
|
||||||
|
|
||||||
---@class LazyVimConfig
|
---@class LazyVimConfig
|
||||||
local defaults = {
|
local defaults = {
|
||||||
|
-- colorscheme can be a string like `catppuccin` or a function that will load the colorscheme
|
||||||
|
---@type string|fun()
|
||||||
|
colorscheme = function()
|
||||||
|
require("tokyonight").load()
|
||||||
|
end,
|
||||||
|
-- icons used by other plugins
|
||||||
icons = {
|
icons = {
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
Error = " ",
|
Error = " ",
|
||||||
|
@ -81,6 +87,20 @@ function M.setup(opts)
|
||||||
M.load("keymaps")
|
M.load("keymaps")
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
require("lazy.core.util").try(function()
|
||||||
|
if type(M.colorscheme) == "function" then
|
||||||
|
M.colorscheme()
|
||||||
|
else
|
||||||
|
vim.cmd.colorscheme(M.colorscheme)
|
||||||
|
end
|
||||||
|
end, {
|
||||||
|
msg = "Could not load your colorscheme",
|
||||||
|
on_error = function(msg)
|
||||||
|
require("lazy.core.util").error(msg)
|
||||||
|
vim.cmd.colorscheme("habamax")
|
||||||
|
end,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param range? string
|
---@param range? string
|
||||||
|
|
|
@ -3,20 +3,12 @@ return {
|
||||||
-- tokyonight
|
-- tokyonight
|
||||||
{
|
{
|
||||||
"folke/tokyonight.nvim",
|
"folke/tokyonight.nvim",
|
||||||
lazy = false,
|
|
||||||
priority = 1000,
|
|
||||||
opts = { style = "moon" },
|
opts = { style = "moon" },
|
||||||
config = function(_, opts)
|
|
||||||
local tokyonight = require("tokyonight")
|
|
||||||
tokyonight.setup(opts)
|
|
||||||
tokyonight.load()
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
-- catppuccin
|
-- catppuccin
|
||||||
{
|
{
|
||||||
"catppuccin/nvim",
|
"catppuccin/nvim",
|
||||||
name = "catppuccin",
|
name = "catppuccin",
|
||||||
priority = 1000,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue