diff --git a/lua/lazyvim/config/options.lua b/lua/lazyvim/config/options.lua index a8d512fc..81b5f081 100644 --- a/lua/lazyvim/config/options.lua +++ b/lua/lazyvim/config/options.lua @@ -20,9 +20,12 @@ vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" } -- LazyVim automatically configures lazygit: -- * theme, based on the active colorscheme. --- * editorPreset to nvim-remote +-- * editPreset to nvim-remote -- * enables nerd font icons -- Set to false to disable. +-- Set the options you want to override in `~/.config/lazygit/custom.yml` +-- WARN: on Windows you might want to set `editPreset: "nvim"` due to +-- this issue https://github.com/jesseduffield/lazygit/issues/3467 vim.g.lazygit_config = true -- Options for the LazyVim statuscolumn diff --git a/lua/lazyvim/util/lazygit.lua b/lua/lazyvim/util/lazygit.lua index 2532ad08..ff96c85c 100644 --- a/lua/lazyvim/util/lazygit.lua +++ b/lua/lazyvim/util/lazygit.lua @@ -70,6 +70,10 @@ function M.open(opts) if ok then M.config_dir = lines[1] vim.env.LG_CONFIG_FILE = LazyVim.norm(M.config_dir .. "/config.yml" .. "," .. M.theme_path) + local custom_config = LazyVim.norm(M.config_dir .. "/custom.yml") + if vim.uv.fs_stat(custom_config) and vim.uv.fs_stat(custom_config).type == "file" then + vim.env.LG_CONFIG_FILE = vim.env.LG_CONFIG_FILE .. "," .. custom_config + end else ---@diagnostic disable-next-line: cast-type-mismatch ---@cast lines string @@ -130,9 +134,9 @@ gui: ---@type string[] local lines = {} for k, v in pairs(theme) do - lines[#lines + 1] = (" %s:"):format(k) + lines[#lines + 1] = (" %s:"):format(k) for _, c in ipairs(v) do - lines[#lines + 1] = (" - %q"):format(c) + lines[#lines + 1] = (" - %q"):format(c) end end config = config .. table.concat(lines, "\n")