From 1d2c0a5cf4eb00542deb7f770e0b9816e28a7746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Guimar=C3=A3es?= Date: Sat, 31 Aug 2024 03:16:45 -0400 Subject: [PATCH 1/7] chore(markdown): markdown.nvim was renamed to render-markdown.nvim (#4259) As described in https://github.com/MeanderingProgrammer/render-markdown.nvim/commit/aeb5cec617c3bd5738ab82ba2c3f9ccdc27656c2 --- lua/lazyvim/plugins/extras/lang/markdown.lua | 2 +- lua/lazyvim/util/plugin.lua | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/markdown.lua b/lua/lazyvim/plugins/extras/lang/markdown.lua index 0934f10a..05bbe661 100644 --- a/lua/lazyvim/plugins/extras/lang/markdown.lua +++ b/lua/lazyvim/plugins/extras/lang/markdown.lua @@ -92,7 +92,7 @@ return { }, { - "MeanderingProgrammer/markdown.nvim", + "MeanderingProgrammer/render-markdown.nvim", opts = { file_types = { "markdown", "norg", "rmd", "org" }, code = { 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() From 393b7e4f4615d4a34db213d3aa4ad3803f6df9c3 Mon Sep 17 00:00:00 2001 From: folke Date: Sat, 31 Aug 2024 07:17:40 +0000 Subject: [PATCH 2/7] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 70d3657a..902f7a94 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 August 31 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 41a8f3a5fb2bb84036f33764d77049cafb0adedf Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Sat, 31 Aug 2024 10:18:20 +0300 Subject: [PATCH 3/7] feat(lazygit): allow user to override LazyVim config with custom file (#4367) ## Description This takes into consideration an additional file, if it exists, to extend `LG_CONFIG_FILE` environment variable, so that users can overwrite easier default LazyVim options set for lazygit in `lazygit-theme.yml`. It's not desirable to directly change `lazygit-theme.yml` as the values are hardcoded and regenerated upon colorscheme change. ## Related Issue(s) Fixes #4364. Ideally, the problem about `nvim-remote` on Windows should be fixed on lazygit's side, so this is just kind of a hotfix in the meantime. Feel free to disregard this if not desirable. ## Screenshots ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/config/options.lua | 5 ++++- lua/lazyvim/util/lazygit.lua | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) 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") From 5a0122b61977b5b2c392b64eb615025f49f2aef7 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 31 Aug 2024 09:27:14 +0200 Subject: [PATCH 4/7] feat(persistence): added leader-qS to select a session --- lua/lazyvim/plugins/util.lua | 1 + 1 file changed, 1 insertion(+) 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" }, }, From b892861bdee888f83401e745bda1798dc01e2c54 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Sat, 31 Aug 2024 10:43:48 +0300 Subject: [PATCH 5/7] fix(markdown-preview): unknown function `mkdp#util#install` (#4196) ## Description This fixes the problem when checking for updates and trying to build and the user encounters the error `unknown function mkdp#util#install`. As per https://github.com/iamcco/markdown-preview.nvim/pull/691 ## Related Issue(s) No, rather a discussion #4194 ## Screenshots ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/markdown.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/lang/markdown.lua b/lua/lazyvim/plugins/extras/lang/markdown.lua index 05bbe661..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 = { From c012f859597c4ba3e54dd26372351098a25379cd Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Sat, 31 Aug 2024 10:44:52 +0300 Subject: [PATCH 6/7] fix(toggle): make `diagnostics` compatible with nvim-0.9.5 (#4205) ## Description This makes `toggle.diagnostics` compatible with Neovim 0.9.5 (though not sure about the metatable callables, since `set` there accepts a boolean from `get` state). Please make whatever changes you deem necessary or disregard as a whole for a better approach I haven't been able to think of. ## Related Issue(s) Fixes #4203 ## Screenshots ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/util/toggle.lua | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index 4e0ba494..2bf13934 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -127,9 +127,32 @@ M.number = M.wrap({ M.diagnostics = M.wrap({ name = "Diagnostics", get = function() - return vim.diagnostic.is_enabled and vim.diagnostic.is_enabled() + local enabled + if vim.diagnostic.is_enabled then + enabled = vim.diagnostic.is_enabled() + else + enabled = not vim.diagnostic.is_disabled() + end + return enabled + end, + set = function() + local enabled + if vim.diagnostic.is_enabled then + enabled = vim.diagnostic.is_enabled() + else + enabled = not vim.diagnostic.is_disabled() + end + enabled = not enabled + if vim.fn.has("nvim-0.10") == 0 then + if enabled then + pcall(vim.diagnostic.enable) + else + vim.diagnostic.disable() + end + else + vim.diagnostic.enable(enabled) + end end, - set = vim.diagnostic.enable, }) M.inlay_hints = M.wrap({ From 3dbace941ee935c89c73fd774267043d12f57fe2 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 31 Aug 2024 12:34:45 +0200 Subject: [PATCH 7/7] fix(toggle): diagnostics enable/disable. See #4205 --- lua/lazyvim/util/toggle.lua | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index 2bf13934..46e92c78 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -127,30 +127,23 @@ M.number = M.wrap({ M.diagnostics = M.wrap({ name = "Diagnostics", get = function() - local enabled + local enabled = false if vim.diagnostic.is_enabled then enabled = vim.diagnostic.is_enabled() - else + elseif vim.diagnostic.is_disabled then enabled = not vim.diagnostic.is_disabled() end return enabled end, - set = function() - local enabled - if vim.diagnostic.is_enabled then - enabled = vim.diagnostic.is_enabled() - else - enabled = not vim.diagnostic.is_disabled() - end - enabled = not enabled + set = function(state) if vim.fn.has("nvim-0.10") == 0 then - if enabled then + if state then pcall(vim.diagnostic.enable) else - vim.diagnostic.disable() + pcall(vim.diagnostic.disable) end else - vim.diagnostic.enable(enabled) + vim.diagnostic.enable(state) end end, })