diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 70d3657a..5c658123 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 25 +*LazyVim.txt* For Neovim Last change: 2024 September 16 ============================================================================== Table of Contents *LazyVim-table-of-contents* 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/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 18ded3ae..a57d9aeb 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -137,7 +137,7 @@ return { function() local grug = require("grug-far") local ext = vim.bo.buftype == "" and vim.fn.expand("%:e") - grug.grug_far({ + grug.open({ transient = true, prefills = { filesFilter = ext and ext ~= "" and "*." .. ext or nil, diff --git a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua index 7eb2d666..fd58b857 100644 --- a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua +++ b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua @@ -23,7 +23,6 @@ return { local user = vim.env.USER or "User" user = user:sub(1, 1):upper() .. user:sub(2) return { - model = "gpt-4", auto_insert_mode = true, show_help = true, question_header = " " .. user .. " ", diff --git a/lua/lazyvim/plugins/extras/lang/markdown.lua b/lua/lazyvim/plugins/extras/lang/markdown.lua index 0934f10a..7ecf01e8 100644 --- a/lua/lazyvim/plugins/extras/lang/markdown.lua +++ b/lua/lazyvim/plugins/extras/lang/markdown.lua @@ -76,6 +76,7 @@ return { "iamcco/markdown-preview.nvim", cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, build = function() + require("lazy").load({ plugins = { "markdown-preview.nvim" } }) vim.fn["mkdp#util#install"]() end, keys = { @@ -92,7 +93,7 @@ return { }, { - "MeanderingProgrammer/markdown.nvim", + "MeanderingProgrammer/render-markdown.nvim", opts = { file_types = { "markdown", "norg", "rmd", "org" }, code = { diff --git a/lua/lazyvim/plugins/util.lua b/lua/lazyvim/plugins/util.lua index 16706c51..22a3e734 100644 --- a/lua/lazyvim/plugins/util.lua +++ b/lua/lazyvim/plugins/util.lua @@ -10,6 +10,7 @@ return { -- stylua: ignore keys = { { "qs", function() require("persistence").load() end, desc = "Restore Session" }, + { "qS", function() require("persistence").select() end,desc = "Select Session" }, { "ql", function() require("persistence").load({ last = true }) end, desc = "Restore Last Session" }, { "qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" }, }, 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") diff --git a/lua/lazyvim/util/plugin.lua b/lua/lazyvim/util/plugin.lua index 1520bdce..92c75540 100644 --- a/lua/lazyvim/util/plugin.lua +++ b/lua/lazyvim/util/plugin.lua @@ -33,6 +33,7 @@ M.renames = { ["null-ls.nvim"] = "none-ls.nvim", ["romgrk/nvim-treesitter-context"] = "nvim-treesitter/nvim-treesitter-context", ["glepnir/dashboard-nvim"] = "nvimdev/dashboard-nvim", + ["markdown.nvim"] = "render-markdown.nvim", } function M.save_core() diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index 4e0ba494..46e92c78 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -127,9 +127,25 @@ M.number = M.wrap({ M.diagnostics = M.wrap({ name = "Diagnostics", get = function() - return vim.diagnostic.is_enabled and vim.diagnostic.is_enabled() + local enabled = false + if vim.diagnostic.is_enabled then + enabled = vim.diagnostic.is_enabled() + elseif vim.diagnostic.is_disabled then + enabled = not vim.diagnostic.is_disabled() + end + return enabled + end, + set = function(state) + if vim.fn.has("nvim-0.10") == 0 then + if state then + pcall(vim.diagnostic.enable) + else + pcall(vim.diagnostic.disable) + end + else + vim.diagnostic.enable(state) + end end, - set = vim.diagnostic.enable, }) M.inlay_hints = M.wrap({