From 39861698235c03d30096b3fb315ce38eeaef95e2 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 4 Nov 2023 10:14:31 +0100 Subject: [PATCH 001/526] fix(spectre): don't build nvim-spectre --- lua/lazyvim/plugins/editor.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 8c34f357..b5f529e5 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -98,6 +98,7 @@ return { -- search/replace in multiple files { "nvim-pack/nvim-spectre", + build = false, cmd = "Spectre", opts = { open_cmd = "noswapfile vnew" }, -- stylua: ignore From db31b4073bd18d7e2d8e09b2752d51da01fc7722 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 4 Nov 2023 09:15:11 +0000 Subject: [PATCH 002/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index bb2c94cd..44ba75b1 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2023 October 28 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2023 November 04 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 4312e5e28348560e018da4535de27dfcc675c32b Mon Sep 17 00:00:00 2001 From: Jorge Villalobos Date: Sat, 4 Nov 2023 06:09:01 -0400 Subject: [PATCH 003/526] feat(catppuccin): enable more integrations (#1922) --- lua/lazyvim/plugins/colorscheme.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/colorscheme.lua b/lua/lazyvim/plugins/colorscheme.lua index 8ed12bbd..bb63326e 100644 --- a/lua/lazyvim/plugins/colorscheme.lua +++ b/lua/lazyvim/plugins/colorscheme.lua @@ -14,14 +14,19 @@ return { name = "catppuccin", opts = { integrations = { + aerial = true, alpha = true, cmp = true, + dashboard = true, flash = true, gitsigns = true, + headlines = true, illuminate = true, indent_blankline = { enabled = true }, + leap = true, lsp_trouble = true, mason = true, + markdown = true, mini = true, native_lsp = { enabled = true, @@ -34,12 +39,13 @@ return { }, navic = { enabled = true, custom_bg = "lualine" }, neotest = true, + neotree = true, noice = true, notify = true, - neotree = true, semantic_tokens = true, telescope = true, treesitter = true, + treesitter_context = true, which_key = true, }, }, From 68ff818a5bb7549f90b05e412b76fe448f605ffb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 4 Nov 2023 11:12:37 +0100 Subject: [PATCH 004/526] chore(main): release 10.8.0 (#1874) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 16 ++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6de0da5..ce168232 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [10.8.0](https://github.com/LazyVim/LazyVim/compare/v10.7.1...v10.8.0) (2023-11-04) + + +### Features + +* **catppuccin:** enable more integrations ([#1922](https://github.com/LazyVim/LazyVim/issues/1922)) ([4312e5e](https://github.com/LazyVim/LazyVim/commit/4312e5e28348560e018da4535de27dfcc675c32b)) + + +### Bug Fixes + +* **extras:** dont show extras that give errors (user's extras). Fixes [#1895](https://github.com/LazyVim/LazyVim/issues/1895) ([b32b4fd](https://github.com/LazyVim/LazyVim/commit/b32b4fd581018cf14bf30ae4cd8d94cd43552813)) +* **mini.indentscope:** remove duplicated filetype ([#1871](https://github.com/LazyVim/LazyVim/issues/1871)) ([09eafc6](https://github.com/LazyVim/LazyVim/commit/09eafc60eff2ba7d7b78c1717d07ce26b762a8a8)) +* **plugin:** LazyFile now properly deals with deleted buffers. Fixes [#1877](https://github.com/LazyVim/LazyVim/issues/1877) ([4558407](https://github.com/LazyVim/LazyVim/commit/4558407574d0cdbe55720ab349df201bd4d5f5de)) +* **sessions:** added folds to sessions ([e01ad51](https://github.com/LazyVim/LazyVim/commit/e01ad513aa4f50bdb385a7454c9e1ec3a0d5dc94)) +* **spectre:** don't build nvim-spectre ([3986169](https://github.com/LazyVim/LazyVim/commit/39861698235c03d30096b3fb315ce38eeaef95e2)) + ## [10.7.1](https://github.com/LazyVim/LazyVim/compare/v10.7.0...v10.7.1) (2023-10-25) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 12d49ed6..d84e26cd 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ local Util = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "10.7.1" -- x-release-please-version +M.version = "10.8.0" -- x-release-please-version ---@class LazyVimOptions local defaults = { From 6853b785d9916be6ffe4965aefd8554ed276f802 Mon Sep 17 00:00:00 2001 From: Gary Murray Date: Thu, 30 Nov 2023 11:53:40 -0700 Subject: [PATCH 005/526] fix(lsp): detect if using nvim-0.10 and use new inlay_hint.enable method (#2007) * Detect if using nvim 0.10 and use new inlay_hint.enable method * Add lsp util for inlay-hints and update keymap * Remove the need to check vim version * Support older nightly builds * Move inlay_hint toggle in Util.toggle --------- Co-authored-by: Gary Murray --- lua/lazyvim/config/keymaps.lua | 4 ++-- lua/lazyvim/plugins/lsp/init.lua | 2 +- lua/lazyvim/util/toggle.lua | 11 +++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index c5f70016..f7fe57d6 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -119,8 +119,8 @@ map("n", "ul", function() Util.toggle.number() end, { desc = "Toggle Lin map("n", "ud", function() Util.toggle.diagnostics() end, { desc = "Toggle Diagnostics" }) local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3 map("n", "uc", function() Util.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" }) -if vim.lsp.inlay_hint then - map("n", "uh", function() vim.lsp.inlay_hint(0, nil) end, { desc = "Toggle Inlay Hints" }) +if vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint then + map( "n", "uh", function() Util.toggle.inlay_hints() end, { desc = "Toggle Inlay Hints" }) end map("n", "uT", function() if vim.b.ts_highlight then vim.treesitter.stop() else vim.treesitter.start() end end, { desc = "Toggle Treesitter Highlight" }) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index f0823e46..f454ac1c 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -115,7 +115,7 @@ return { vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) end - local inlay_hint = vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint + local inlay_hint = vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint.enable if opts.inlay_hints.enabled and inlay_hint then Util.lsp.on_attach(function(client, buffer) diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index b520070b..51e81744 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -53,6 +53,17 @@ function M.diagnostics() end end +---@param bufnr? number +function M.inlay_hints(bufnr) + bufnr = bufnr or 0 + local inlay_hint = vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint + if inlay_hint.enable then + vim.lsp.inlay_hint.enable(bufnr, not inlay_hint.is_enabled()) + else + vim.lsp.inlay_hint(bufnr, nil) + end +end + setmetatable(M, { __call = function(m, ...) return m.option(...) From 4ebda08d49edc2ce0f6a4841356fe6ed89427cc2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 30 Nov 2023 18:54:19 +0000 Subject: [PATCH 006/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 44ba75b1..2d805f3b 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2023 November 04 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2023 November 30 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 11a8a6bea7a26ca5257fa4cbef90e0abdb22c349 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 30 Nov 2023 20:10:41 +0100 Subject: [PATCH 007/526] fix(ui): signcolumn signs on nightly. Fixes #2039 --- lua/lazyvim/util/ui.lua | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lua/lazyvim/util/ui.lua b/lua/lazyvim/util/ui.lua index 68999eda..ce8b4780 100644 --- a/lua/lazyvim/util/ui.lua +++ b/lua/lazyvim/util/ui.lua @@ -10,12 +10,19 @@ local M = {} function M.get_signs(buf, lnum) -- Get regular signs ---@type Sign[] - local signs = vim.tbl_map(function(sign) - ---@type Sign - local ret = vim.fn.sign_getdefined(sign.name)[1] - ret.priority = sign.priority - return ret - end, vim.fn.sign_getplaced(buf, { group = "*", lnum = lnum })[1].signs) + local signs = {} + + if vim.fn.has("nvim-0.10") == 0 then + -- Only needed for Neovim <0.10 + -- Newer versions include legacy signs in nvim_buf_get_extmarks + for _, sign in ipairs(vim.fn.sign_getplaced(buf, { group = "*", lnum = lnum })[1].signs) do + local ret = vim.fn.sign_getdefined(sign.name)[1] --[[@as Sign]] + if ret then + ret.priority = sign.priority + signs[#signs + 1] = ret + end + end + end -- Get extmark signs local extmarks = vim.api.nvim_buf_get_extmarks( From e229988a98a81b000fda3aadbb4fc404aeaa599e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 30 Nov 2023 20:16:33 +0100 Subject: [PATCH 008/526] fix(lsp): inlay hints on stable. See #2007 --- lua/lazyvim/plugins/lsp/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index f454ac1c..048de5b8 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -115,7 +115,7 @@ return { vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) end - local inlay_hint = vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint.enable + local inlay_hint = vim.lsp.buf.inlay_hint or (vim.lsp.inlay_hint and vim.lsp.inlay_hint.enable) if opts.inlay_hints.enabled and inlay_hint then Util.lsp.on_attach(function(client, buffer) From 6ac331b588ab62f39c40a18c359d60e4dfba47ac Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 30 Nov 2023 20:20:39 +0100 Subject: [PATCH 009/526] chore(main): release 10.8.1 (#2095) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 9 +++++++++ lua/lazyvim/config/init.lua | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce168232..a3c33fe0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [10.8.1](https://github.com/LazyVim/LazyVim/compare/v10.8.0...v10.8.1) (2023-11-30) + + +### Bug Fixes + +* **lsp:** detect if using nvim-0.10 and use new inlay_hint.enable method ([#2007](https://github.com/LazyVim/LazyVim/issues/2007)) ([6853b78](https://github.com/LazyVim/LazyVim/commit/6853b785d9916be6ffe4965aefd8554ed276f802)) +* **lsp:** inlay hints on stable. See [#2007](https://github.com/LazyVim/LazyVim/issues/2007) ([e229988](https://github.com/LazyVim/LazyVim/commit/e229988a98a81b000fda3aadbb4fc404aeaa599e)) +* **ui:** signcolumn signs on nightly. Fixes [#2039](https://github.com/LazyVim/LazyVim/issues/2039) ([11a8a6b](https://github.com/LazyVim/LazyVim/commit/11a8a6bea7a26ca5257fa4cbef90e0abdb22c349)) + ## [10.8.0](https://github.com/LazyVim/LazyVim/compare/v10.7.1...v10.8.0) (2023-11-04) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index d84e26cd..09b80d86 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ local Util = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "10.8.0" -- x-release-please-version +M.version = "10.8.1" -- x-release-please-version ---@class LazyVimOptions local defaults = { From 8baf9b5459a903c783a1d34ad438e64036a8e15e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 30 Nov 2023 21:24:03 +0100 Subject: [PATCH 010/526] fix(lsp): fix inlay hints for older nightlies. See #2007 --- lua/lazyvim/plugins/lsp/init.lua | 6 ++---- lua/lazyvim/util/toggle.lua | 19 +++++++++++-------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 048de5b8..3b60d14b 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -115,12 +115,10 @@ return { vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) end - local inlay_hint = vim.lsp.buf.inlay_hint or (vim.lsp.inlay_hint and vim.lsp.inlay_hint.enable) - - if opts.inlay_hints.enabled and inlay_hint then + if opts.inlay_hints.enabled then Util.lsp.on_attach(function(client, buffer) if client.supports_method("textDocument/inlayHint") then - inlay_hint(buffer, true) + Util.toggle.inlay_hints(buffer, true) end end) end diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index 51e81744..db41c825 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -53,14 +53,17 @@ function M.diagnostics() end end ----@param bufnr? number -function M.inlay_hints(bufnr) - bufnr = bufnr or 0 - local inlay_hint = vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint - if inlay_hint.enable then - vim.lsp.inlay_hint.enable(bufnr, not inlay_hint.is_enabled()) - else - vim.lsp.inlay_hint(bufnr, nil) +---@param buf? number +---@param value? boolean +function M.inlay_hints(buf, value) + local ih = vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint + if type(ih) == "function" then + ih(buf, value) + elseif type(ih) == "table" and ih.enable then + if value == nil then + value = not ih.is_enabled(buf) + end + ih.enable(buf, value) end end From 879e29504d43e9f178d967ecc34d482f902e5a91 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 30 Nov 2023 21:27:02 +0100 Subject: [PATCH 011/526] chore(main): release 10.8.2 (#2097) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ lua/lazyvim/config/init.lua | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3c33fe0..318c543d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [10.8.2](https://github.com/LazyVim/LazyVim/compare/v10.8.1...v10.8.2) (2023-11-30) + + +### Bug Fixes + +* **lsp:** fix inlay hints for older nightlies. See [#2007](https://github.com/LazyVim/LazyVim/issues/2007) ([8baf9b5](https://github.com/LazyVim/LazyVim/commit/8baf9b5459a903c783a1d34ad438e64036a8e15e)) + ## [10.8.1](https://github.com/LazyVim/LazyVim/compare/v10.8.0...v10.8.1) (2023-11-30) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 09b80d86..a296ef56 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ local Util = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "10.8.1" -- x-release-please-version +M.version = "10.8.2" -- x-release-please-version ---@class LazyVimOptions local defaults = { From 979bb952a69d7dafac125da69cb27b70d5403f52 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 20 Jan 2024 12:50:34 +0100 Subject: [PATCH 012/526] fix(dot): treesitter for hypr was renamed to hyprlang --- lua/lazyvim/plugins/extras/util/dot.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/lazyvim/plugins/extras/util/dot.lua b/lua/lazyvim/plugins/extras/util/dot.lua index c25e0f6c..6fa4f2d6 100644 --- a/lua/lazyvim/plugins/extras/util/dot.lua +++ b/lua/lazyvim/plugins/extras/util/dot.lua @@ -10,7 +10,7 @@ return { -- Add Hyprland Parser { - "luckasRanarison/tree-sitter-hypr", + "luckasRanarison/tree-sitter-hyprlang", enabled = function() return have("hypr") end, @@ -19,11 +19,11 @@ return { config = function() -- Fix ft detection for hyprland vim.filetype.add({ - pattern = { [".*/hypr/.*%.conf"] = "hypr" }, + pattern = { [".*/hypr/.*%.conf"] = "hyprlang" }, }) - require("nvim-treesitter.parsers").get_parser_configs().hypr = { + require("nvim-treesitter.parsers").get_parser_configs().hyprlang = { install_info = { - url = "https://github.com/luckasRanarison/tree-sitter-hypr", + url = "https://github.com/luckasRanarison/tree-sitter-hyprlang", files = { "src/parser.c" }, branch = "master", }, From 23fe52acd78c8e8f7c35c3ce4c1bae830adfa357 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 21 Jan 2024 11:24:59 +0100 Subject: [PATCH 013/526] feat(autocmds): dont use conceal for json files --- lua/lazyvim/config/autocmds.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index 4cc6f1ec..bedea2e7 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -81,6 +81,15 @@ vim.api.nvim_create_autocmd("FileType", { end, }) +-- Fix conceallevel for json files +vim.api.nvim_create_autocmd({ "FileType" }, { + group = augroup("json_conceal"), + pattern = { "json", "jsonc", "json5" }, + callback = function() + vim.wo.conceallevel = 0 + end, +}) + -- Auto create dir when saving a file, in case some intermediate directory does not exist vim.api.nvim_create_autocmd({ "BufWritePre" }, { group = augroup("auto_create_dir"), From d0120ccdd11af8c421e23655c487c3cd68dc0199 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 21 Jan 2024 10:25:29 +0000 Subject: [PATCH 014/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 2d805f3b..35bc1618 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2023 November 30 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 January 21 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 33830f1e7d2e5a54fec676ce6e43a4a61882aaa9 Mon Sep 17 00:00:00 2001 From: Gary Murray Date: Sun, 21 Jan 2024 11:35:24 -0700 Subject: [PATCH 015/526] feat(lsp): add diagnostic signs to lsp options (#2192) Co-authored-by: Gary Murray --- lua/lazyvim/plugins/lsp/init.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 3b60d14b..8e39a055 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -26,6 +26,14 @@ return { -- prefix = "icons", }, severity_sort = true, + signs = { + text = { + [vim.diagnostic.severity.ERROR] = require("lazyvim.config").icons.diagnostics.Error, + [vim.diagnostic.severity.WARN] = require("lazyvim.config").icons.diagnostics.Warn, + [vim.diagnostic.severity.HINT] = require("lazyvim.config").icons.diagnostics.Hint, + [vim.diagnostic.severity.INFO] = require("lazyvim.config").icons.diagnostics.Info, + }, + }, }, -- Enable this to enable the builtin LSP inlay hints on Neovim >= 0.10.0 -- Be aware that you also will need to properly configure your LSP server to From b71feb7e45420a6e6dcac2f4491b73b70c32e5c7 Mon Sep 17 00:00:00 2001 From: Samuel Abreu Date: Sun, 21 Jan 2024 15:37:38 -0300 Subject: [PATCH 016/526] feat(test): Add tl to neotest.run_last() (#1968) --- lua/lazyvim/plugins/extras/test/core.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/test/core.lua b/lua/lazyvim/plugins/extras/test/core.lua index 321955ab..12ce90ba 100644 --- a/lua/lazyvim/plugins/extras/test/core.lua +++ b/lua/lazyvim/plugins/extras/test/core.lua @@ -110,6 +110,7 @@ return { { "tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" }, { "tT", function() require("neotest").run.run(vim.loop.cwd()) end, desc = "Run All Test Files" }, { "tr", function() require("neotest").run.run() end, desc = "Run Nearest" }, + { "tl", function() require("neotest").run.run_last() end, desc = "Run Last" }, { "ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" }, { "to", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output" }, { "tO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel" }, From f4ddb16b262e5ba14b417dc53bfd09d5b21f8a73 Mon Sep 17 00:00:00 2001 From: Sergey Kochetkov Date: Sun, 21 Jan 2024 19:49:41 +0100 Subject: [PATCH 017/526] feat(gitsigns): update gitsigns.nvim preview command (#2178) * chores(format.lua): Fix typo * Change gitsigns.nvim hunk preview shortcut Change `preview_hunk` to recently added `preview_hunk_inline` command --- lua/lazyvim/plugins/editor.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index b5f529e5..f23d4544 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -358,7 +358,7 @@ return { map("n", "ghS", gs.stage_buffer, "Stage Buffer") map("n", "ghu", gs.undo_stage_hunk, "Undo Stage Hunk") map("n", "ghR", gs.reset_buffer, "Reset Buffer") - map("n", "ghp", gs.preview_hunk, "Preview Hunk") + map("n", "ghp", gs.preview_hunk_inline, "Preview Hunk Inline") map("n", "ghb", function() gs.blame_line({ full = true }) end, "Blame Line") map("n", "ghd", gs.diffthis, "Diff This") map("n", "ghD", function() gs.diffthis("~") end, "Diff This ~") From fa6158a59500c816b652e0fcb4c343270be54b6c Mon Sep 17 00:00:00 2001 From: NickSager <121263610+NickSager@users.noreply.github.com> Date: Sun, 21 Jan 2024 12:52:36 -0600 Subject: [PATCH 018/526] feat(keymaps): add function to toggle between light/dark backgrounds (#2088) --- lua/lazyvim/config/keymaps.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index f7fe57d6..1e7cc1a2 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -123,6 +123,7 @@ if vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint then map( "n", "uh", function() Util.toggle.inlay_hints() end, { desc = "Toggle Inlay Hints" }) end map("n", "uT", function() if vim.b.ts_highlight then vim.treesitter.stop() else vim.treesitter.start() end end, { desc = "Toggle Treesitter Highlight" }) +map("n", "ub", function() Util.toggle("background", false, {"light", "dark"}) end, { desc = "Toggle Background" }) -- lazygit map("n", "gg", function() Util.terminal({ "lazygit" }, { cwd = Util.root(), esc_esc = false, ctrl_hjkl = false }) end, { desc = "Lazygit (root dir)" }) From 71a73e8334a3692c549a09169e0f7a33923520f1 Mon Sep 17 00:00:00 2001 From: Nick Hester Date: Sun, 21 Jan 2024 10:53:09 -0800 Subject: [PATCH 019/526] fix(eslint): correct working directories name (#2071) --- lua/lazyvim/plugins/extras/linting/eslint.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/linting/eslint.lua b/lua/lazyvim/plugins/extras/linting/eslint.lua index 9537303d..a92a2191 100644 --- a/lua/lazyvim/plugins/extras/linting/eslint.lua +++ b/lua/lazyvim/plugins/extras/linting/eslint.lua @@ -8,7 +8,7 @@ return { eslint = { settings = { -- helps eslint find the eslintrc when it's placed in a subfolder instead of the cwd root - workingDirectory = { mode = "auto" }, + workingDirectories = { mode = "auto" }, }, }, }, From 5296d42e6ab4f6df80e801542382a3d774298364 Mon Sep 17 00:00:00 2001 From: pr3c0g Date: Sun, 21 Jan 2024 18:53:57 +0000 Subject: [PATCH 020/526] feat(neo-tree): Adds copy file name command to Neo-Tree with 'Y' binding (#2137) Co-authored-by: Ricardo Rebelo --- lua/lazyvim/plugins/editor.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index f23d4544..153cb786 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -57,10 +57,16 @@ return { bind_to_cwd = false, follow_current_file = { enabled = true }, use_libuv_file_watcher = true, + commands = { + copy_file_name = function(state) + local node = state.tree:get_node() + vim.fn.setreg("*", node.name, "c") + end, }, window = { mappings = { [""] = "none", + ["Y"] = "copy_file_name", }, }, default_component_configs = { From adc0b36069c5be150af8d992a59d00d849e3dedb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 21 Jan 2024 20:00:03 +0100 Subject: [PATCH 021/526] chore(main): release 10.9.0 (#2391) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 18 ++++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 318c543d..53044510 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## [10.9.0](https://github.com/LazyVim/LazyVim/compare/v10.8.2...v10.9.0) (2024-01-21) + + +### Features + +* **autocmds:** dont use conceal for json files ([23fe52a](https://github.com/LazyVim/LazyVim/commit/23fe52acd78c8e8f7c35c3ce4c1bae830adfa357)) +* **gitsigns:** update gitsigns.nvim preview command ([#2178](https://github.com/LazyVim/LazyVim/issues/2178)) ([f4ddb16](https://github.com/LazyVim/LazyVim/commit/f4ddb16b262e5ba14b417dc53bfd09d5b21f8a73)) +* **keymaps:** add function to toggle between light/dark backgrounds ([#2088](https://github.com/LazyVim/LazyVim/issues/2088)) ([fa6158a](https://github.com/LazyVim/LazyVim/commit/fa6158a59500c816b652e0fcb4c343270be54b6c)) +* **lsp:** add diagnostic signs to lsp options ([#2192](https://github.com/LazyVim/LazyVim/issues/2192)) ([33830f1](https://github.com/LazyVim/LazyVim/commit/33830f1e7d2e5a54fec676ce6e43a4a61882aaa9)) +* **neo-tree:** Adds copy file name command to Neo-Tree with 'Y' binding ([#2137](https://github.com/LazyVim/LazyVim/issues/2137)) ([5296d42](https://github.com/LazyVim/LazyVim/commit/5296d42e6ab4f6df80e801542382a3d774298364)) +* **test:** Add <leader>tl to neotest.run_last() ([#1968](https://github.com/LazyVim/LazyVim/issues/1968)) ([b71feb7](https://github.com/LazyVim/LazyVim/commit/b71feb7e45420a6e6dcac2f4491b73b70c32e5c7)) + + +### Bug Fixes + +* **dot:** treesitter for hypr was renamed to hyprlang ([979bb95](https://github.com/LazyVim/LazyVim/commit/979bb952a69d7dafac125da69cb27b70d5403f52)) +* **eslint:** correct working directories name ([#2071](https://github.com/LazyVim/LazyVim/issues/2071)) ([71a73e8](https://github.com/LazyVim/LazyVim/commit/71a73e8334a3692c549a09169e0f7a33923520f1)) + ## [10.8.2](https://github.com/LazyVim/LazyVim/compare/v10.8.1...v10.8.2) (2023-11-30) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index a296ef56..508bfbf2 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ local Util = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "10.8.2" -- x-release-please-version +M.version = "10.9.0" -- x-release-please-version ---@class LazyVimOptions local defaults = { From fbe478ae3f84ff842d18ff880af5842a50ee8e50 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 21 Jan 2024 20:02:11 +0100 Subject: [PATCH 022/526] fix: fixup for #2137 --- lua/lazyvim/plugins/editor.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 153cb786..f96fff9a 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -62,6 +62,7 @@ return { local node = state.tree:get_node() vim.fn.setreg("*", node.name, "c") end, + }, }, window = { mappings = { From c433ea7aa842c446edc2b1570998bf5440c68188 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 21 Jan 2024 20:03:51 +0100 Subject: [PATCH 023/526] chore(main): release 10.9.1 (#2399) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ lua/lazyvim/config/init.lua | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53044510..7bee06d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [10.9.1](https://github.com/LazyVim/LazyVim/compare/v10.9.0...v10.9.1) (2024-01-21) + + +### Bug Fixes + +* fixup for [#2137](https://github.com/LazyVim/LazyVim/issues/2137) ([fbe478a](https://github.com/LazyVim/LazyVim/commit/fbe478ae3f84ff842d18ff880af5842a50ee8e50)) + ## [10.9.0](https://github.com/LazyVim/LazyVim/compare/v10.8.2...v10.9.0) (2024-01-21) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 508bfbf2..e259928a 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ local Util = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "10.9.0" -- x-release-please-version +M.version = "10.9.1" -- x-release-please-version ---@class LazyVimOptions local defaults = { From 37107cf2fcd534916482b82de7ad7d689c6505b0 Mon Sep 17 00:00:00 2001 From: Pablo <52180403+pablos123@users.noreply.github.com> Date: Sun, 21 Jan 2024 16:10:18 -0300 Subject: [PATCH 024/526] docs: typo in init.lua (#2365) --- lua/lazyvim/plugins/lsp/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 8e39a055..fbb4aeac 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -94,7 +94,7 @@ return { -- setup autoformat Util.format.register(Util.lsp.formatter()) - -- deprectaed options + -- deprecated options if opts.autoformat ~= nil then vim.g.autoformat = opts.autoformat Util.deprecate("nvim-lspconfig.opts.autoformat", "vim.g.autoformat") From c72db4938c693d51ff8079b451c84cc57e8dd8b3 Mon Sep 17 00:00:00 2001 From: tippfehlr Date: Sun, 21 Jan 2024 20:18:03 +0100 Subject: [PATCH 025/526] docs(README-DE): remove .txt extension (#2321) Probably some windows editor that added this automatically + known extensions hidden. --- README-DE.md.txt => README-DE.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename README-DE.md.txt => README-DE.md (100%) diff --git a/README-DE.md.txt b/README-DE.md similarity index 100% rename from README-DE.md.txt rename to README-DE.md From 8e2046f3d02a80558802b6cbcd4c8f7d44f7b6b4 Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Mon, 22 Jan 2024 06:20:54 +1100 Subject: [PATCH 026/526] fix(autocmds): avoid checktime when buftype=nofile (#2270) It triggered an 'E11: Invalid in command-line window; executes, CTRL-C quits' error when Neovim was in Command Line window and FocusGained. --- lua/lazyvim/config/autocmds.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index bedea2e7..e3fb1fda 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -7,7 +7,11 @@ end -- Check if we need to reload the file when it changed vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, { group = augroup("checktime"), - command = "checktime", + callback = function() + if vim.o.buftype ~= 'nofile' then + vim.cmd('checktime') + end + end }) -- Highlight on yank From cbd9d700dc964cf8c90759f8482911d03c72edc4 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis Date: Sun, 21 Jan 2024 21:28:16 +0200 Subject: [PATCH 027/526] fix(typescript): don't hardcode values in lua table (#2254) * fix(typescript): don't hardcode values in lua table When a user changes `vim.opt.shiftwidth` with some auto-command, it's not taken into account. Make `opts` a function, so that values get evaluated when `lspconfig` loads instead. * fix(typescript): remove format settings entirely * fix(typescript): add back comment and Lua annotations * fix(typescript): bring back function call completion snippets --- lua/lazyvim/plugins/extras/lang/typescript.lua | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua index 4f53ae8c..4bb280d6 100644 --- a/lua/lazyvim/plugins/extras/lang/typescript.lua +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -46,21 +46,8 @@ return { desc = "Remove Unused Imports", }, }, + ---@diagnostic disable-next-line: missing-fields settings = { - typescript = { - format = { - indentSize = vim.o.shiftwidth, - convertTabsToSpaces = vim.o.expandtab, - tabSize = vim.o.tabstop, - }, - }, - javascript = { - format = { - indentSize = vim.o.shiftwidth, - convertTabsToSpaces = vim.o.expandtab, - tabSize = vim.o.tabstop, - }, - }, completions = { completeFunctionCalls = true, }, @@ -69,6 +56,7 @@ return { }, }, }, + { "mfussenegger/nvim-dap", optional = true, From a43d8cf35857fae4aaf1ebbd3c280cdf5b5f9d10 Mon Sep 17 00:00:00 2001 From: Adrian Wilkins Date: Sun, 21 Jan 2024 19:34:07 +0000 Subject: [PATCH 028/526] fix(options): change default conceal level to 2 (#2053) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 3 hides all concealed text, even if there are replacement chars defined e.g. : for Markdown, 3 hides list item markers, dots for asterisk lists and em-dashes for dash lists If replacements are defined as defaults in a plugin, the "Laziest™" config would seem to be displaying them. Level 1 only seems useful when alignment really matters. --- lua/lazyvim/config/options.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/config/options.lua b/lua/lazyvim/config/options.lua index 3c9686b1..6d9f006b 100644 --- a/lua/lazyvim/config/options.lua +++ b/lua/lazyvim/config/options.lua @@ -17,7 +17,7 @@ local opt = vim.opt opt.autowrite = true -- Enable auto write opt.clipboard = "unnamedplus" -- Sync with system clipboard opt.completeopt = "menu,menuone,noselect" -opt.conceallevel = 3 -- Hide * markup for bold and italic +opt.conceallevel = 2 -- Hide * markup for bold and italic, but not markers with substitutions opt.confirm = true -- Confirm to save changes before exiting modified buffer opt.cursorline = true -- Enable highlighting of the current line opt.expandtab = true -- Use spaces instead of tabs From 93342f15badc6e7a3c213e27979b2ff31e0b393e Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis Date: Sun, 21 Jan 2024 21:41:11 +0200 Subject: [PATCH 029/526] feat(toggle): use `vim.diagnostic.is_disabled` when available (#2217) * feat(toggle-diagnostics): change logic based on `vim.diagnostic.is_disabled` After discussion in #2215, I thought maybe it would be beneficial if we could change the logic of the `toggle-diagnostics` function based on if the user has disabled diagnostics in his own configuration. * feat(toggle-diagnostics): revert to `enable` instead of `status` * fix(toggle): use vim.diagnostics enabled state when possible --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/util/toggle.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index db41c825..409556d1 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -43,7 +43,13 @@ end local enabled = true function M.diagnostics() + -- if this Neovim version supports checking if diagnostics are enabled + -- then use that for the current state + if vim.diagnostic.is_disabled then + enabled = not vim.diagnostic.is_disabled() + end enabled = not enabled + if enabled then vim.diagnostic.enable() Util.info("Enabled diagnostics", { title = "Diagnostics" }) From eccf3b5e68035516c879b3e2b4d6bf8512c87976 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 21 Jan 2024 21:32:09 +0100 Subject: [PATCH 030/526] fix(neo-tree): better copy file name with `Y` --- lua/lazyvim/plugins/editor.lua | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index f96fff9a..f9f162ad 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -57,17 +57,15 @@ return { bind_to_cwd = false, follow_current_file = { enabled = true }, use_libuv_file_watcher = true, - commands = { - copy_file_name = function(state) - local node = state.tree:get_node() - vim.fn.setreg("*", node.name, "c") - end, - }, }, window = { mappings = { [""] = "none", - ["Y"] = "copy_file_name", + ["Y"] = function(state) + local node = state.tree:get_node() + local path = node:get_id() + vim.fn.setreg("+", path, "c") + end, }, }, default_component_configs = { From 1dffb1d853df39e2232fd39d3cf47ba3da2e8b6c Mon Sep 17 00:00:00 2001 From: Binh Duc Tran Date: Mon, 22 Jan 2024 13:49:45 +0700 Subject: [PATCH 031/526] fix(hyprlang): use lazyvim way to install (#2404) --- lua/lazyvim/plugins/extras/util/dot.lua | 31 +++++++++++++------------ 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/lua/lazyvim/plugins/extras/util/dot.lua b/lua/lazyvim/plugins/extras/util/dot.lua index 6fa4f2d6..a37670ea 100644 --- a/lua/lazyvim/plugins/extras/util/dot.lua +++ b/lua/lazyvim/plugins/extras/util/dot.lua @@ -11,25 +11,26 @@ return { -- Add Hyprland Parser { "luckasRanarison/tree-sitter-hyprlang", + dependencies = { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + require("nvim-treesitter.parsers").get_parser_configs().hyprlang = { + install_info = { + url = "https://github.com/luckasRanarison/tree-sitter-hyprlang", + files = { "src/parser.c" }, + branch = "master", + }, + filetype = "hyprlang", + } + + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, { "hyprlang" }) + end, + }, enabled = function() return have("hypr") end, event = "BufRead */hypr/*.conf", - build = ":TSUpdate hypr", - config = function() - -- Fix ft detection for hyprland - vim.filetype.add({ - pattern = { [".*/hypr/.*%.conf"] = "hyprlang" }, - }) - require("nvim-treesitter.parsers").get_parser_configs().hyprlang = { - install_info = { - url = "https://github.com/luckasRanarison/tree-sitter-hyprlang", - files = { "src/parser.c" }, - branch = "master", - }, - filetype = "hypr", - } - end, }, -- add some stuff to treesitter From eb2674ce37d3ed7d4738f008f83269fd1af98111 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 22 Jan 2024 06:50:15 +0000 Subject: [PATCH 032/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 35bc1618..000a427e 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 January 21 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 January 22 ============================================================================== Table of Contents *LazyVim-table-of-contents* From f799b39eafedf58cdd7b123870a2c87d96eddb68 Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Mon, 22 Jan 2024 17:51:19 +1100 Subject: [PATCH 033/526] fix(rust): avoid resetting cmp group_index to 1 (#2332) For example, 'buffer' source by default has group_index = 2 [1], however if we take all the sources plus crates and run them through cmp.config.sources() again, since it's a one-dimensional list, all group_indexes will be reset to 1. [1] https://github.com/LazyVim/LazyVim/blob/879e29504d43e9f178d967ecc34d482f902e5a91/lua/lazyvim/plugins/coding.lua#L74-L80 --- lua/lazyvim/plugins/extras/lang/rust.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/rust.lua b/lua/lazyvim/plugins/extras/lang/rust.lua index 1e6e0594..bd8f7821 100644 --- a/lua/lazyvim/plugins/extras/lang/rust.lua +++ b/lua/lazyvim/plugins/extras/lang/rust.lua @@ -16,10 +16,8 @@ return { }, ---@param opts cmp.ConfigSchema opts = function(_, opts) - local cmp = require("cmp") - opts.sources = cmp.config.sources(vim.list_extend(opts.sources, { - { name = "crates" }, - })) + opts.sources = opts.sources or {} + table.insert(opts.sources, { name = "crates" }) end, }, From d9287391b7ca7153320d4654e148c33463eba3a6 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 22 Jan 2024 08:03:13 +0100 Subject: [PATCH 034/526] feat: added `LazyHealth` that loads all plugins and runs `:checkhealth` --- lua/lazyvim/config/init.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index e259928a..20aba534 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -185,6 +185,11 @@ function M.setup(opts) vim.api.nvim_create_user_command("LazyExtras", function() Util.extras.show() end, { desc = "Manage LazyVim extras" }) + + vim.api.nvim_create_user_command("LazyHealth", function() + vim.cmd([[Lazy! load all]]) + vim.cmd([[checkhealth]]) + end, { desc = "Load all plugins and run :checkhealth" }) end, }) From 7f9219162b54a717b7da5cb543ab1e778c9a124b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 22 Jan 2024 08:39:07 +0100 Subject: [PATCH 035/526] feat(snippets): added extra to use native snippets instead of LuaSnip. --- lua/lazyvim/plugins/coding.lua | 83 ++++++++++--------- .../plugins/extras/coding/native_snippets.lua | 59 +++++++++++++ 2 files changed, 105 insertions(+), 37 deletions(-) create mode 100644 lua/lazyvim/plugins/extras/coding/native_snippets.lua diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index c6571433..662977f0 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -1,35 +1,5 @@ return { - -- snippets - { - "L3MON4D3/LuaSnip", - build = (not jit.os:find("Windows")) - and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp" - or nil, - dependencies = { - "rafamadriz/friendly-snippets", - config = function() - require("luasnip.loaders.from_vscode").lazy_load() - end, - }, - opts = { - history = true, - delete_check_events = "TextChanged", - }, - -- stylua: ignore - keys = { - { - "", - function() - return require("luasnip").jumpable(1) and "luasnip-jump-next" or "" - end, - expr = true, silent = true, mode = "i", - }, - { "", function() require("luasnip").jump(1) end, mode = "s" }, - { "", function() require("luasnip").jump(-1) end, mode = { "i", "s" } }, - }, - }, - -- auto completion { "hrsh7th/nvim-cmp", @@ -39,7 +9,6 @@ return { "hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-buffer", "hrsh7th/cmp-path", - "saadparwaiz1/cmp_luasnip", }, opts = function() vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true }) @@ -49,11 +18,6 @@ return { completion = { completeopt = "menu,menuone,noinsert", }, - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, mapping = cmp.mapping.preset.insert({ [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), @@ -73,7 +37,6 @@ return { }), sources = cmp.config.sources({ { name = "nvim_lsp" }, - { name = "luasnip" }, { name = "path" }, }, { { name = "buffer" }, @@ -104,6 +67,52 @@ return { end, }, + -- snippets + { + "L3MON4D3/LuaSnip", + build = (not jit.os:find("Windows")) + and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp" + or nil, + dependencies = { + { + "rafamadriz/friendly-snippets", + config = function() + require("luasnip.loaders.from_vscode").lazy_load() + end, + }, + { + "nvim-cmp", + dependencies = { + "saadparwaiz1/cmp_luasnip", + }, + opts = function(_, opts) + opts.snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + } + table.insert(opts.sources, { name = "luasnip" }) + end, + }, + }, + opts = { + history = true, + delete_check_events = "TextChanged", + }, + -- stylua: ignore + keys = { + { + "", + function() + return require("luasnip").jumpable(1) and "luasnip-jump-next" or "" + end, + expr = true, silent = true, mode = "i", + }, + { "", function() require("luasnip").jump(1) end, mode = "s" }, + { "", function() require("luasnip").jump(-1) end, mode = { "i", "s" } }, + }, + }, + -- auto pairs { "echasnovski/mini.pairs", diff --git a/lua/lazyvim/plugins/extras/coding/native_snippets.lua b/lua/lazyvim/plugins/extras/coding/native_snippets.lua new file mode 100644 index 00000000..72080c92 --- /dev/null +++ b/lua/lazyvim/plugins/extras/coding/native_snippets.lua @@ -0,0 +1,59 @@ +return { + desc = "Use native snippets instead of LuaSnip. Only works on Neovim >= 0.10!", + { + "L3MON4D3/LuaSnip", + enabled = false, + }, + { + "nvim-cmp", + opts = { + snippet = { + expand = function(args) + vim.snippet.expand(args.body) + end, + }, + }, + keys = { + { + "", + function() + if vim.snippet.jumpable(1) then + vim.schedule(function() + vim.snippet.jump(1) + end) + return + end + return "" + end, + expr = true, + silent = true, + mode = "i", + }, + { + "", + function() + vim.schedule(function() + vim.snippet.jump(1) + end) + end, + silent = true, + mode = "s", + }, + { + "", + function() + if vim.snippet.jumpable(-1) then + vim.schedule(function() + vim.snippet.jump(-1) + end) + return + end + return "" + end, + expr = true, + silent = true, + mode = { "i", "s" }, + }, + }, + }, +} From 54ae77e164e62ae9f45e864dfd727bfe1809a419 Mon Sep 17 00:00:00 2001 From: Yi Date: Mon, 22 Jan 2024 02:58:51 -0800 Subject: [PATCH 036/526] feat(telescope): add fg for finding files using git-files (#2353) I found this to be more useful than the current ff and fF --- lua/lazyvim/plugins/editor.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index f9f162ad..46860e7b 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -146,6 +146,7 @@ return { { "fc", Util.telescope.config_files(), desc = "Find Config File" }, { "ff", Util.telescope("files"), desc = "Find Files (root dir)" }, { "fF", Util.telescope("files", { cwd = false }), desc = "Find Files (cwd)" }, + { "fg", "Telescope git_files", desc = "Find Files (git-files)" }, { "fr", "Telescope oldfiles", desc = "Recent" }, { "fR", Util.telescope("oldfiles", { cwd = vim.loop.cwd() }), desc = "Recent (cwd)" }, -- git From 591f850f8a30a08066022392fe3b23eb217dbb81 Mon Sep 17 00:00:00 2001 From: Michael Olson <48652773+m0lson84@users.noreply.github.com> Date: Tue, 23 Jan 2024 01:51:34 -0500 Subject: [PATCH 037/526] fix(autocmds): apply conceal level change to local buffer options (#2409) --- lua/lazyvim/config/autocmds.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index e3fb1fda..8e09ac0e 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -90,7 +90,7 @@ vim.api.nvim_create_autocmd({ "FileType" }, { group = augroup("json_conceal"), pattern = { "json", "jsonc", "json5" }, callback = function() - vim.wo.conceallevel = 0 + vim.opt_local.conceallevel = 0 end, }) From a50f92f7550fb6e9f21c0852e6cb190e6fcd50f5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 23 Jan 2024 06:52:05 +0000 Subject: [PATCH 038/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 000a427e..2fa95fdf 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 January 22 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 January 23 ============================================================================== Table of Contents *LazyVim-table-of-contents* From fe72424e77cb9c953084bbcaaa0eb7fe8056dc70 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 21 Feb 2024 08:48:55 +0100 Subject: [PATCH 039/526] chore(main): release 10.10.0 (#2400) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 21 +++++++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bee06d4..d034b13e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Changelog +## [10.10.0](https://github.com/LazyVim/LazyVim/compare/v10.9.1...v10.10.0) (2024-01-23) + + +### Features + +* added `LazyHealth` that loads all plugins and runs `:checkhealth` ([d928739](https://github.com/LazyVim/LazyVim/commit/d9287391b7ca7153320d4654e148c33463eba3a6)) +* **snippets:** added extra to use native snippets instead of LuaSnip. ([7f92191](https://github.com/LazyVim/LazyVim/commit/7f9219162b54a717b7da5cb543ab1e778c9a124b)) +* **telescope:** add <leader>fg for finding files using git-files ([#2353](https://github.com/LazyVim/LazyVim/issues/2353)) ([54ae77e](https://github.com/LazyVim/LazyVim/commit/54ae77e164e62ae9f45e864dfd727bfe1809a419)) +* **toggle:** use `vim.diagnostic.is_disabled` when available ([#2217](https://github.com/LazyVim/LazyVim/issues/2217)) ([93342f1](https://github.com/LazyVim/LazyVim/commit/93342f15badc6e7a3c213e27979b2ff31e0b393e)) + + +### Bug Fixes + +* **autocmds:** apply conceal level change to local buffer options ([#2409](https://github.com/LazyVim/LazyVim/issues/2409)) ([591f850](https://github.com/LazyVim/LazyVim/commit/591f850f8a30a08066022392fe3b23eb217dbb81)) +* **autocmds:** avoid checktime when buftype=nofile ([#2270](https://github.com/LazyVim/LazyVim/issues/2270)) ([8e2046f](https://github.com/LazyVim/LazyVim/commit/8e2046f3d02a80558802b6cbcd4c8f7d44f7b6b4)) +* **hyprlang:** use lazyvim way to install ([#2404](https://github.com/LazyVim/LazyVim/issues/2404)) ([1dffb1d](https://github.com/LazyVim/LazyVim/commit/1dffb1d853df39e2232fd39d3cf47ba3da2e8b6c)) +* **neo-tree:** better copy file name with `Y` ([eccf3b5](https://github.com/LazyVim/LazyVim/commit/eccf3b5e68035516c879b3e2b4d6bf8512c87976)) +* **options:** change default conceal level to 2 ([#2053](https://github.com/LazyVim/LazyVim/issues/2053)) ([a43d8cf](https://github.com/LazyVim/LazyVim/commit/a43d8cf35857fae4aaf1ebbd3c280cdf5b5f9d10)) +* **rust:** avoid resetting cmp group_index to 1 ([#2332](https://github.com/LazyVim/LazyVim/issues/2332)) ([f799b39](https://github.com/LazyVim/LazyVim/commit/f799b39eafedf58cdd7b123870a2c87d96eddb68)) +* **typescript:** don't hardcode values in lua table ([#2254](https://github.com/LazyVim/LazyVim/issues/2254)) ([cbd9d70](https://github.com/LazyVim/LazyVim/commit/cbd9d700dc964cf8c90759f8482911d03c72edc4)) + ## [10.9.1](https://github.com/LazyVim/LazyVim/compare/v10.9.0...v10.9.1) (2024-01-21) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 20aba534..74e29c14 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ local Util = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "10.9.1" -- x-release-please-version +M.version = "10.10.0" -- x-release-please-version ---@class LazyVimOptions local defaults = { From 91126b9896bebcea9a21bce43be4e613e7607164 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 21 Feb 2024 07:49:28 +0000 Subject: [PATCH 040/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 2fa95fdf..b971c30d 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 January 23 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 February 21 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 796112e1707ce1a693cd76a95b84dda5529fc990 Mon Sep 17 00:00:00 2001 From: Luckas Date: Thu, 7 Mar 2024 13:33:22 +0300 Subject: [PATCH 041/526] fix(dot): remove hyprlang plugin (#2623) --- lua/lazyvim/plugins/extras/util/dot.lua | 31 ++++--------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/lua/lazyvim/plugins/extras/util/dot.lua b/lua/lazyvim/plugins/extras/util/dot.lua index a37670ea..fabeec2c 100644 --- a/lua/lazyvim/plugins/extras/util/dot.lua +++ b/lua/lazyvim/plugins/extras/util/dot.lua @@ -7,32 +7,6 @@ local function have(path) end return { - - -- Add Hyprland Parser - { - "luckasRanarison/tree-sitter-hyprlang", - dependencies = { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - require("nvim-treesitter.parsers").get_parser_configs().hyprlang = { - install_info = { - url = "https://github.com/luckasRanarison/tree-sitter-hyprlang", - files = { "src/parser.c" }, - branch = "master", - }, - filetype = "hyprlang", - } - - opts.ensure_installed = opts.ensure_installed or {} - vim.list_extend(opts.ensure_installed, { "hyprlang" }) - end, - }, - enabled = function() - return have("hypr") - end, - event = "BufRead */hypr/*.conf", - }, - -- add some stuff to treesitter { "nvim-treesitter/nvim-treesitter", @@ -49,11 +23,16 @@ return { [".*/waybar/config"] = "jsonc", [".*/mako/config"] = "dosini", [".*/kitty/*.conf"] = "bash", + [".*/hypr/.*%.conf"] = "hyprlang", }, }) add("git_config") + if have("hypr") then + add("hyprlang") + end + if have("fish") then add("fish") end From c43afbbdbba97db32ff95e45f0c996bca0b86a2e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 7 Mar 2024 10:33:56 +0000 Subject: [PATCH 042/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index b971c30d..3a1fd8c1 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 February 21 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 07 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 1a417430fc388b9a0b063017188a92d8ad14534f Mon Sep 17 00:00:00 2001 From: Aman9das <39594914+Aman9das@users.noreply.github.com> Date: Thu, 7 Mar 2024 16:04:20 +0530 Subject: [PATCH 043/526] fix(neo-tree): Add description to "Y" in Neo-Tree (#2642) It copies the path of the file/directory --- lua/lazyvim/plugins/editor.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 46860e7b..62ab4d7a 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -61,11 +61,14 @@ return { window = { mappings = { [""] = "none", - ["Y"] = function(state) - local node = state.tree:get_node() - local path = node:get_id() - vim.fn.setreg("+", path, "c") - end, + ["Y"] = { + function(state) + local node = state.tree:get_node() + local path = node:get_id() + vim.fn.setreg("+", path, "c") + end, + desc = "copy path to clipboard", + }, }, }, default_component_configs = { From 16d6ac234a3fa813ed920d5e3a5fb2a8e35c20d6 Mon Sep 17 00:00:00 2001 From: Dennis Eriksen <796800+dennisse@users.noreply.github.com> Date: Thu, 7 Mar 2024 11:38:36 +0100 Subject: [PATCH 044/526] fix(autocmds): nvim already binds q to close for man-files (#2594) --- lua/lazyvim/config/autocmds.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index 8e09ac0e..f0db2774 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -57,7 +57,6 @@ vim.api.nvim_create_autocmd("FileType", { "PlenaryTestPopup", "help", "lspinfo", - "man", "notify", "qf", "query", @@ -75,6 +74,15 @@ vim.api.nvim_create_autocmd("FileType", { end, }) +-- make it easier to close man-files when opened inline +vim.api.nvim_create_autocmd("FileType", { + group = augroup("man_unlisted"), + pattern = { "man" }, + callback = function(event) + vim.bo[event.buf].buflisted = false + end, +}) + -- wrap and check for spell in text filetypes vim.api.nvim_create_autocmd("FileType", { group = augroup("wrap_spell"), From 29ed06e0007d645d7c26b22df1346150b8e28b7f Mon Sep 17 00:00:00 2001 From: mbhutton Date: Thu, 7 Mar 2024 23:39:57 +1300 Subject: [PATCH 045/526] fix(options): don't lower timeoutlen when in VS Code (#2568) Avoid lowering timeoutlen when running in VS Code, to avoid unwanted timeouts from key mappings. The lower value of 300ms (down from Neovim's default of 1000ms) works great outside of VS Code, where it helps trigger the which-key UI quickly, and where which-key prevents timeouts from occuring. But in VS Code (where which-key isn't applicable), the lower value makes it difficult to perform some key mappings in time, such as `]p`, which requires shifting hand position. --- lua/lazyvim/config/options.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/config/options.lua b/lua/lazyvim/config/options.lua index 6d9f006b..df259d4c 100644 --- a/lua/lazyvim/config/options.lua +++ b/lua/lazyvim/config/options.lua @@ -49,7 +49,9 @@ opt.splitkeep = "screen" opt.splitright = true -- Put new windows right of current opt.tabstop = 2 -- Number of spaces tabs count for opt.termguicolors = true -- True color support -opt.timeoutlen = 300 +if not vim.g.vscode then + opt.timeoutlen = 300 -- Lower than default (1000) to quickly trigger which-key +end opt.undofile = true opt.undolevels = 10000 opt.updatetime = 200 -- Save swap file and trigger CursorHold From d9f5e6db165167c80fe80ede68b0e1815a81cc43 Mon Sep 17 00:00:00 2001 From: MoetaYuko Date: Thu, 7 Mar 2024 18:40:51 +0800 Subject: [PATCH 046/526] fix(yanky): properly disable sqlite.lua on Windows (#2543) When directly modifying its `enabled` property, the plugin will remain disabled even if required by another plugin. --- lua/lazyvim/plugins/extras/coding/yanky.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/coding/yanky.lua b/lua/lazyvim/plugins/extras/coding/yanky.lua index 00b675e9..c48df709 100644 --- a/lua/lazyvim/plugins/extras/coding/yanky.lua +++ b/lua/lazyvim/plugins/extras/coding/yanky.lua @@ -2,7 +2,7 @@ return { -- better yank/paste { "gbprod/yanky.nvim", - dependencies = { { "kkharji/sqlite.lua", enabled = not jit.os:find("Windows") } }, + dependencies = not jit.os:find("Windows") and { "kkharji/sqlite.lua" } or {}, opts = { highlight = { timer = 250 }, ring = { storage = jit.os:find("Windows") and "shada" or "sqlite" }, From a8eeb1b75d9df360f2b63f0f52708f24172990e5 Mon Sep 17 00:00:00 2001 From: Daniel Mata <100956688+matadaniel@users.noreply.github.com> Date: Thu, 7 Mar 2024 04:41:34 -0600 Subject: [PATCH 047/526] feat(hipatterns): add shorthand hex color support (#2562) --- lua/lazyvim/plugins/extras/util/mini-hipatterns.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lua/lazyvim/plugins/extras/util/mini-hipatterns.lua b/lua/lazyvim/plugins/extras/util/mini-hipatterns.lua index 2add9c2f..c261b14f 100644 --- a/lua/lazyvim/plugins/extras/util/mini-hipatterns.lua +++ b/lua/lazyvim/plugins/extras/util/mini-hipatterns.lua @@ -19,6 +19,18 @@ M.plugin = { }, highlighters = { hex_color = hi.gen_highlighter.hex_color({ priority = 2000 }), + shorthand = { + pattern = "#%x%x%x%f[%X]", + group = function(_, _, data) + ---@type string + local match = data.full_match + local r, g, b = match:sub(2, 2), match:sub(3, 3), match:sub(4, 4) + local hex_color = "#" .. r .. r .. g .. g .. b .. b + + return MiniHipatterns.compute_hex_color_group(hex_color, "bg") + end, + extmark_opts = { priority = 2000 }, + }, }, } end, From 66bf7525e3b951c11860373c05582fe5e15f6d5e Mon Sep 17 00:00:00 2001 From: Andreas Gerlach Date: Thu, 7 Mar 2024 11:42:23 +0100 Subject: [PATCH 048/526] feat(lang) replace rust-tools.nvim with rustacean.nvim - fixes #2113 (#2198) * feat(lang) - move to rustacean.nvim, fixes #2113 * update rustacean plugin * PR comment for lsp settings --- lua/lazyvim/plugins/extras/lang/rust.lua | 141 +++++++++-------------- 1 file changed, 56 insertions(+), 85 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/rust.lua b/lua/lazyvim/plugins/extras/lang/rust.lua index bd8f7821..5a8fb1b4 100644 --- a/lua/lazyvim/plugins/extras/lang/rust.lua +++ b/lua/lazyvim/plugins/extras/lang/rust.lua @@ -25,9 +25,8 @@ return { { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) - if type(opts.ensure_installed) == "table" then - vim.list_extend(opts.ensure_installed, { "ron", "rust", "toml" }) - end + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, { "ron", "rust", "toml" }) end, }, @@ -36,51 +35,56 @@ return { "williamboman/mason.nvim", optional = true, opts = function(_, opts) - if type(opts.ensure_installed) == "table" then - vim.list_extend(opts.ensure_installed, { "codelldb" }) - end + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, { "codelldb" }) end, }, { - "simrat39/rust-tools.nvim", - lazy = true, - opts = function() - local ok, mason_registry = pcall(require, "mason-registry") - local adapter ---@type any - if ok then - -- rust tools configuration for debugging support - local codelldb = mason_registry.get_package("codelldb") - local extension_path = codelldb:get_install_path() .. "/extension/" - local codelldb_path = extension_path .. "adapter/codelldb" - local liblldb_path = "" - if vim.loop.os_uname().sysname:find("Windows") then - liblldb_path = extension_path .. "lldb\\bin\\liblldb.dll" - elseif vim.fn.has("mac") == 1 then - liblldb_path = extension_path .. "lldb/lib/liblldb.dylib" - else - liblldb_path = extension_path .. "lldb/lib/liblldb.so" - end - adapter = require("rust-tools.dap").get_codelldb_adapter(codelldb_path, liblldb_path) - end - return { - dap = { - adapter = adapter, - }, - tools = { - on_initialized = function() - vim.cmd([[ - augroup RustLSP - autocmd CursorHold *.rs silent! lua vim.lsp.buf.document_highlight() - autocmd CursorMoved,InsertEnter *.rs silent! lua vim.lsp.buf.clear_references() - autocmd BufEnter,CursorHold,InsertLeave *.rs silent! lua vim.lsp.codelens.refresh() - augroup END - ]]) - end, + "mrcjkb/rustaceanvim", + version = '^4', -- Recommended + ft = { "rust" }, + opts = { + server = { + on_attach = function(client, bufnr) + -- register which-key mappings + local wk = require("which-key") + wk.register({ + ["cR"] = { function() vim.cmd.RustLsp("codeAction") end, "Code Action" }, + ["dr"] = { function() vim.cmd.RustLsp("debuggables") end, "Rust debuggables" }, + }, { mode = "n", buffer = bufnr }) + end, + default_settings = { + -- rust-analyzer language server configuration + ["rust-analyzer"] = { + cargo = { + allFeatures = true, + loadOutDirsFromCheck = true, + runBuildScripts = true, + }, + -- Add clippy lints for Rust. + checkOnSave = { + allFeatures = true, + command = "clippy", + extraArgs = { "--no-deps" }, + }, + procMacro = { + enable = true, + ignored = { + ["async-trait"] = { "async_trait" }, + ["napi-derive"] = { "napi" }, + ["async-recursion"] = { "async_recursion" }, + }, + }, + }, }, } - end, - config = function() end, + }, + config = function(_, opts) + vim.g.rustaceanvim = vim.tbl_deep_extend("force", + {}, + opts or {}) + end }, -- Correctly setup lspconfig for Rust 🚀 @@ -88,37 +92,7 @@ return { "neovim/nvim-lspconfig", opts = { servers = { - -- Ensure mason installs the server - rust_analyzer = { - keys = { - { "K", "RustHoverActions", desc = "Hover Actions (Rust)" }, - { "cR", "RustCodeAction", desc = "Code Action (Rust)" }, - { "dr", "RustDebuggables", desc = "Run Debuggables (Rust)" }, - }, - settings = { - ["rust-analyzer"] = { - cargo = { - allFeatures = true, - loadOutDirsFromCheck = true, - runBuildScripts = true, - }, - -- Add clippy lints for Rust. - checkOnSave = { - allFeatures = true, - command = "clippy", - extraArgs = { "--no-deps" }, - }, - procMacro = { - enable = true, - ignored = { - ["async-trait"] = { "async_trait" }, - ["napi-derive"] = { "napi" }, - ["async-recursion"] = { "async_recursion" }, - }, - }, - }, - }, - }, + rust_analyzer = {}, taplo = { keys = { { @@ -136,9 +110,7 @@ return { }, }, setup = { - rust_analyzer = function(_, opts) - local rust_tools_opts = require("lazyvim.util").opts("rust-tools.nvim") - require("rust-tools").setup(vim.tbl_deep_extend("force", rust_tools_opts or {}, { server = opts })) + rust_analyzer = function() return true end, }, @@ -148,13 +120,12 @@ return { { "nvim-neotest/neotest", optional = true, - dependencies = { - "rouge8/neotest-rust", - }, - opts = { - adapters = { - ["neotest-rust"] = {}, - }, - }, + opts = function(_, opts) + opts.adapters = opts.adapters or {} + vim.list_extend(opts.adapters, { + require('rustaceanvim.neotest'), + }) + end }, -} + +} \ No newline at end of file From e7a58d94847e6f1b282a6a717794cc454fe51faa Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 27 Feb 2024 08:35:41 +0100 Subject: [PATCH 049/526] fix(telescope): dont use git_files when .ignore or .rgignore file is present --- lua/lazyvim/util/telescope.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/util/telescope.lua b/lua/lazyvim/util/telescope.lua index 1d816b80..fad24f46 100644 --- a/lua/lazyvim/util/telescope.lua +++ b/lua/lazyvim/util/telescope.lua @@ -24,7 +24,11 @@ function M.telescope(builtin, opts) opts = params.opts opts = vim.tbl_deep_extend("force", { cwd = Util.root() }, opts or {}) --[[@as lazyvim.util.telescope.opts]] if builtin == "files" then - if vim.loop.fs_stat((opts.cwd or vim.loop.cwd()) .. "/.git") then + if + vim.loop.fs_stat((opts.cwd or vim.loop.cwd()) .. "/.git") + and not vim.loop.fs_stat((opts.cwd or vim.loop.cwd()) .. "/.ignore") + and not vim.loop.fs_stat((opts.cwd or vim.loop.cwd()) .. "/.rgignore") + then opts.show_untracked = true builtin = "git_files" else From b7da44caaed0bf7da0fd81d56f00428ff8df59d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Koz=C5=82owicz?= Date: Thu, 7 Mar 2024 11:46:33 +0100 Subject: [PATCH 050/526] feat(lang): add ansible support (#1218) --- lua/lazyvim/plugins/extras/lang/ansible.lua | 36 +++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lang/ansible.lua diff --git a/lua/lazyvim/plugins/extras/lang/ansible.lua b/lua/lazyvim/plugins/extras/lang/ansible.lua new file mode 100644 index 00000000..e952a301 --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/ansible.lua @@ -0,0 +1,36 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + if type(opts.ensure_installed) == "table" then + vim.list_extend(opts.ensure_installed, { "yaml" }) + end + end, + }, + { + "williamboman/mason.nvim", + opts = function(_, opts) + opts.ensure_installed = opts.ensure_installed or {} + -- for ansiblels validation + vim.list_extend(opts.ensure_installed, { "ansible-lint" }) + end, + }, + { + "neovim/nvim-lspconfig", + opts = { + servers = { + ansiblels = {}, + }, + }, + }, + { + "mfussenegger/nvim-ansible", + keys = { + "tr", + function() + require("ansible").run() + end, + silent = true, + }, + }, +} From 1b0b899ab361cdabf74395449ff3c622ef74dcb1 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Thu, 7 Mar 2024 05:47:45 -0500 Subject: [PATCH 051/526] feat(treesitter): add xml to `ensure_installed` (#1962) --- lua/lazyvim/plugins/treesitter.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/treesitter.lua b/lua/lazyvim/plugins/treesitter.lua index e66725c0..dd746ba1 100644 --- a/lua/lazyvim/plugins/treesitter.lua +++ b/lua/lazyvim/plugins/treesitter.lua @@ -75,6 +75,7 @@ return { "typescript", "vim", "vimdoc", + "xml", "yaml", }, incremental_selection = { From ddbba85408ad903f9fbe9d52d2a3c99a69361ffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederik=20Buchl=C3=A1k?= <30214087+fbuchlak@users.noreply.github.com> Date: Thu, 7 Mar 2024 10:48:37 +0000 Subject: [PATCH 052/526] chore(treesitter.lua): fix typo (#2026) * fix typo * fix typo --- lua/lazyvim/plugins/treesitter.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/treesitter.lua b/lua/lazyvim/plugins/treesitter.lua index dd746ba1..7e4dd40a 100644 --- a/lua/lazyvim/plugins/treesitter.lua +++ b/lua/lazyvim/plugins/treesitter.lua @@ -10,8 +10,8 @@ return { init = function(plugin) -- PERF: add nvim-treesitter queries to the rtp and it's custom query predicates early -- This is needed because a bunch of plugins no longer `require("nvim-treesitter")`, which - -- no longer trigger the **nvim-treeitter** module to be loaded in time. - -- Luckily, the only thins that those plugins need are the custom queries, which we make available + -- no longer trigger the **nvim-treesitter** module to be loaded in time. + -- Luckily, the only things that those plugins need are the custom queries, which we make available -- during startup. require("lazy.core.loader").add_to_rtp(plugin) require("nvim-treesitter.query_predicates") From 36ae4213b89191e040405c5515c24d8021f277d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Freitas?= Date: Thu, 7 Mar 2024 10:49:50 +0000 Subject: [PATCH 053/526] fix(telescope): anonymous keymap (#1879) * fix(telescope): anonymous keymap * fix(telescope): add desc * fix(telescope): function name * fix(telescope): update description * fix(telescope): diagnostic disable --- lua/lazyvim/util/telescope.lua | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lua/lazyvim/util/telescope.lua b/lua/lazyvim/util/telescope.lua index fad24f46..0a51d6aa 100644 --- a/lua/lazyvim/util/telescope.lua +++ b/lua/lazyvim/util/telescope.lua @@ -36,16 +36,18 @@ function M.telescope(builtin, opts) end end if opts.cwd and opts.cwd ~= vim.loop.cwd() then + local function open_cwd_dir() + local action_state = require("telescope.actions.state") + local line = action_state.get_current_line() + M.telescope( + params.builtin, + vim.tbl_deep_extend("force", {}, params.opts or {}, { cwd = false, default_text = line }) + )() + end ---@diagnostic disable-next-line: inject-field opts.attach_mappings = function(_, map) - map("i", "", function() - local action_state = require("telescope.actions.state") - local line = action_state.get_current_line() - M.telescope( - params.builtin, - vim.tbl_deep_extend("force", {}, params.opts or {}, { cwd = false, default_text = line }) - )() - end) + -- opts.desc is overridden by telescope, until it's changed there is this fix + map("i", "", open_cwd_dir, { desc = "Open cwd directory" }) return true end end From c6c584f7c3263e685e064fb84f69e58d9b625f23 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Thu, 7 Mar 2024 11:51:08 +0100 Subject: [PATCH 054/526] feat(lang): add Haskell config (#2052) --- lua/lazyvim/plugins/extras/lang/haskell.lua | 98 +++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lang/haskell.lua diff --git a/lua/lazyvim/plugins/extras/lang/haskell.lua b/lua/lazyvim/plugins/extras/lang/haskell.lua new file mode 100644 index 00000000..764dc160 --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/haskell.lua @@ -0,0 +1,98 @@ +return { + + -- Add Haskell to treesitter + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + if type(opts.ensure_installed) == "table" then + vim.list_extend(opts.ensure_installed, { "haskell" }) + end + end, + }, + + { + "mrcjkb/haskell-tools.nvim", + version = "^3", + ft = { 'haskell', 'lhaskell', 'cabal', 'cabalproject' }, + dependencies = { + { "nvim-telescope/telescope.nvim", optional = true }, + }, + config = function() + local ok, telescope = pcall(require, 'telescope') + if ok then + telescope.load_extension('ht') + end + end, + }, + + { + "williamboman/mason.nvim", + opts = function(_, opts) + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, { "haskell-language-server" }) + end, + }, + + { + "mfussenegger/nvim-dap", + optional = true, + dependencies = { + { + "williamboman/mason.nvim", + opts = function(_, opts) + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, { "haskell-debug-adapter" }) + end, + }, + }, + }, + + { + "nvim-neotest/neotest", + optional = true, + dependencies = { + { "mrcjkb/neotest-haskell", } + }, + opts = { + adapters = { + ["neotest-haskell"] = {}, + }, + }, + }, + + { + "mrcjkb/haskell-snippets.nvim", + dependencies = { "L3MON4D3/LuaSnip", }, + config = function() + local haskell_snippets = require('haskell-snippets').all + require('luasnip').add_snippets('haskell', haskell_snippets, { key = 'haskell' }) + end, + }, + + { + "luc-tielen/telescope_hoogle", + ft = { 'haskell', 'lhaskell', 'cabal', 'cabalproject' }, + dependencies = { + { "nvim-telescope/telescope.nvim" }, + }, + config = function() + local ok, telescope = pcall(require, 'telescope') + if ok then + telescope.load_extension('hoogle') + end + end, + }, + + -- Make sure lspconfig doesn't start hls, + -- as it conflicts with haskell-tools + { + "neovim/nvim-lspconfig", + opts = { + setup = { + hls = function() + return true + end, + }, + }, + }, +} From 40a75e82f75d4a5c5fa56365809e61b04eb36bdb Mon Sep 17 00:00:00 2001 From: Andreas Gerlach Date: Thu, 7 Mar 2024 11:51:48 +0100 Subject: [PATCH 055/526] feat(util) create gitui extension (#2238) --- lua/lazyvim/plugins/extras/util/gitui.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/util/gitui.lua diff --git a/lua/lazyvim/plugins/extras/util/gitui.lua b/lua/lazyvim/plugins/extras/util/gitui.lua new file mode 100644 index 00000000..5c519ba4 --- /dev/null +++ b/lua/lazyvim/plugins/extras/util/gitui.lua @@ -0,0 +1,23 @@ +return { + + -- Ensure GitUI tool is installed + { + "williamboman/mason.nvim", + keys = { + { "gG", + function() + require("lazyvim.util").terminal.open({ "gitui" }, { esc_esc = false, ctrl_hjkl = false }) + end, + desc = "gitui (cwd)" }, + { "gg", + function() + require("lazyvim.util").terminal.open({ "gitui" }, { cwd = require("lazyvim.util").root.get(), esc_esc = false, ctrl_hjkl = false }) + end, + desc = "gitui (root dir)" } + }, + opts = function(_, opts) + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, { "gitui" }) + end, + }, +} From a48b14eb3e4ff03e55796dc50e08b6c8a42cccf4 Mon Sep 17 00:00:00 2001 From: Alafate Date: Thu, 7 Mar 2024 11:53:06 +0100 Subject: [PATCH 056/526] feat(symbols-outline): use outline.nvim instead of symbols-outline.nvim (#2535) --- .../{symbols-outline.lua => outline.lua} | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) rename lua/lazyvim/plugins/extras/editor/{symbols-outline.lua => outline.lua} (72%) diff --git a/lua/lazyvim/plugins/extras/editor/symbols-outline.lua b/lua/lazyvim/plugins/extras/editor/outline.lua similarity index 72% rename from lua/lazyvim/plugins/extras/editor/symbols-outline.lua rename to lua/lazyvim/plugins/extras/editor/outline.lua index 32cdd17f..841bf288 100644 --- a/lua/lazyvim/plugins/extras/editor/symbols-outline.lua +++ b/lua/lazyvim/plugins/extras/editor/outline.lua @@ -2,12 +2,12 @@ local Util = require("lazyvim.util") return { { - "simrat39/symbols-outline.nvim", - keys = { { "cs", "SymbolsOutline", desc = "Symbols Outline" } }, - cmd = "SymbolsOutline", + "hedyhli/outline.nvim", + keys = { { "cs", "Outline", desc = "Toggle Outline" } }, + cmd = "Outline", opts = function() local Config = require("lazyvim.config") - local defaults = require("symbols-outline.config").defaults + local defaults = require("outline.config").defaults local opts = { symbols = {}, symbol_blacklist = {}, @@ -38,23 +38,21 @@ return { optional = true, opts = function(_, opts) local edgy_idx = Util.plugin.extra_idx("ui.edgy") - local symbols_idx = Util.plugin.extra_idx("editor.symbols-outline") + local symbols_idx = Util.plugin.extra_idx("editor.outline") if edgy_idx and edgy_idx > symbols_idx then Util.warn( - "The `edgy.nvim` extra must be **imported** before the `symbols-outline.nvim` extra to work properly.", - { - title = "LazyVim", - } + "The `edgy.nvim` extra must be **imported** before the `outline.nvim` extra to work properly.", + { title = "LazyVim" } ) end opts.right = opts.right or {} table.insert(opts.right, { - title = "Symbols Outline", + title = "Outline", ft = "Outline", pinned = true, - open = "SymbolsOutline", + open = "Outline", }) end, }, From d2502613ff0fe8116a3a8891006b1a880834be15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Kleinb=C3=B6lting?= Date: Thu, 7 Mar 2024 11:54:16 +0100 Subject: [PATCH 057/526] feat(extras): Add scala support using nvim-metals (#1347) * Add scala support using nvim-metals nvim-metals: https://github.com/scalameta/nvim-metals minimal example configuration from their documentation: https://github.com/scalameta/nvim-metals/discussions/39 * add treesitter syntax highlighting --- lua/lazyvim/plugins/extras/lang/scala.lua | 74 +++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lang/scala.lua diff --git a/lua/lazyvim/plugins/extras/lang/scala.lua b/lua/lazyvim/plugins/extras/lang/scala.lua new file mode 100644 index 00000000..eca2db45 --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/scala.lua @@ -0,0 +1,74 @@ +-- NOTE: This setup does not define any lsp or dap specific key bindings +-- It is recommended that the LazyVim extras dap-core is imported "lazyvim.plugins.extras.dap.core" +-- If you like you can setup your own key bindings. +-- For minimalistic setup have a look at https://github.com/scalameta/nvim-metals/discussions/39 +return { + { + "hrsh7th/nvim-cmp", + requires = { + { "hrsh7th/cmp-nvim-lsp" }, + { "hrsh7th/cmp-vsnip" }, + { "hrsh7th/vim-vsnip" }, + }, + }, + { + "scalameta/nvim-metals", + dependencies = { + "nvim-lua/plenary.nvim", + "mfussenegger/nvim-dap", + }, + ft = { "scala", "sbt", "java" }, + init = function() + local metals_config = require("metals").bare_config() + metals_config.init_options.statusBarProvider = "on" + metals_config.settings = { + showImplicitArguments = true, + excludedPackages = { "akka.actor.typed.javadsl", "com.github.swagger.akka.javadsl" }, + } + metals_config.capabilities = require("cmp_nvim_lsp").default_capabilities() + metals_config.on_attach = function(client, bufnr) + require("metals").setup_dap() + end + + local nvim_metals_group = vim.api.nvim_create_augroup("nvim-metals", { clear = true }) + vim.api.nvim_create_autocmd("FileType", { + -- NOTE: You may or may not want java included here. You will need it if you + -- want basic Java support but it may also conflict if you are using + -- something like nvim-jdtls which also works on a java filetype autocmd. + pattern = { "scala", "sbt", "java" }, + callback = function() + require("metals").initialize_or_attach(metals_config) + end, + group = nvim_metals_group, + }) + + -- Debug settings + local dap = require("dap") + dap.configurations.scala = { + { + type = "scala", + request = "launch", + name = "RunOrTest", + metals = { + runType = "runOrTestFile", + --args = { "firstArg", "secondArg", "thirdArg" }, -- here just as an example + }, + }, + { + type = "scala", + request = "launch", + name = "Test Target", + metals = { + runType = "testTarget", + }, + }, + } + end, + }, + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + vim.list_extend(opts.ensure_installed, { "scala" }) + end, + }, +} From de01a37cb68c3ddfb64e9576df0878a4373a6dcb Mon Sep 17 00:00:00 2001 From: Peter Benjamin Date: Thu, 7 Mar 2024 02:55:58 -0800 Subject: [PATCH 058/526] feat(lang): add support for helm chart templates (#2273) * feat(lang): add support for helm chart templates * fix(helm): stop yamlls and disable autostart * fix(helm): stop yaml & docker compose lsp on helm file types Revert disabling `autostart` since that kills the LSP globally even when opening a standard yaml file, like GitHub Workflow file. * fix(helm): remove docker compose lsp overrides Since docker compose LSP does not seem to be triggered or started by opening *.yaml helm files, the config overrides were removed to simplify Helm config. * fix(helm): ensure mason installs helm lsp --- lua/lazyvim/plugins/extras/lang/helm.lua | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lang/helm.lua diff --git a/lua/lazyvim/plugins/extras/lang/helm.lua b/lua/lazyvim/plugins/extras/lang/helm.lua new file mode 100644 index 00000000..8af1b512 --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/helm.lua @@ -0,0 +1,30 @@ +require("lazyvim.util").lsp.on_attach(function(client, buffer) + if client.name == "yamlls" then + if vim.api.nvim_get_option_value("filetype", { buf = buffer }) == "helm" then + vim.schedule(function() + vim.cmd("LspStop ++force yamlls") + end) + end + end +end) + +return { + { "towolf/vim-helm", ft = "helm" }, + { + "neovim/nvim-lspconfig", + opts = { + servers = { + yamlls = {}, + helm_ls = {}, + }, + }, + }, + { + "williamboman/mason.nvim", + opts = function(_, opts) + vim.list_extend(opts.ensure_installed, { + "helm-ls", + }) + end, + }, +} From f23d3cee422a8b77572a8db6fe915d374625453f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=B5=20Quang=20Chi=E1=BA=BFn?= <87252943+2giosangmitom@users.noreply.github.com> Date: Thu, 7 Mar 2024 17:56:27 +0700 Subject: [PATCH 059/526] feat(omnisharp): add `nvim-dap` configuration (#2532) * feat(omnisharp): add `nvim-dap` configuration * chore(omnisharp): add `netcoredbg` to `ensure_installed` * chore: simplify get `netcoredbg` path --- lua/lazyvim/plugins/extras/lang/omnisharp.lua | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/omnisharp.lua b/lua/lazyvim/plugins/extras/lang/omnisharp.lua index 31162e0c..d4bd698b 100644 --- a/lua/lazyvim/plugins/extras/lang/omnisharp.lua +++ b/lua/lazyvim/plugins/extras/lang/omnisharp.lua @@ -35,8 +35,9 @@ return { { "williamboman/mason.nvim", opts = function(_, opts) - opts.ensure_installed = opts.ensure_installed or {} - table.insert(opts.ensure_installed, "csharpier") + if type(opts.ensure_installed) == "table" then + vim.list_extend(opts.ensure_installed, { "netcoredbg", "csharpier" }) + end end, }, { @@ -65,4 +66,34 @@ return { }, }, }, + { + "mfussenegger/nvim-dap", + optional = true, + opts = function() + local dap = require("dap") + if not dap.adapters["netcoredbg"] then + require("dap").adapters["netcoredbg"] = { + type = "executable", + command = vim.fn.exepath("netcoredbg"), + args = { "--interpreter=vscode" }, + } + end + for _, lang in ipairs({ "cs", "fsharp", "vb" }) do + if not dap.configurations[lang] then + dap.configurations[lang] = { + { + type = "netcoredbg", + name = "Launch file", + request = "launch", + ---@diagnostic disable-next-line: redundant-parameter + program = function() + return vim.fn.input("Path to dll: ", vim.fn.getcwd() .. "/", "file") + end, + cwd = "${workspaceFolder}", + }, + } + end + end + end, + }, } From 5012d7d839beede3d223c361449d0d8cb00fa098 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis Date: Thu, 7 Mar 2024 12:57:03 +0200 Subject: [PATCH 060/526] fix(util.ui.fg): Add `link=false` to show effective definition (#2542) Fixes #2540 by showing the effective definition instead of the linked group name. --- lua/lazyvim/util/ui.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/util/ui.lua b/lua/lazyvim/util/ui.lua index ce8b4780..6eaefdb3 100644 --- a/lua/lazyvim/util/ui.lua +++ b/lua/lazyvim/util/ui.lua @@ -142,7 +142,8 @@ end function M.fg(name) ---@type {foreground?:number}? ---@diagnostic disable-next-line: deprecated - local hl = vim.api.nvim_get_hl and vim.api.nvim_get_hl(0, { name = name }) or vim.api.nvim_get_hl_by_name(name, true) + local hl = vim.api.nvim_get_hl and vim.api.nvim_get_hl(0, { name = name, link = false }) + or vim.api.nvim_get_hl_by_name(name, true) ---@diagnostic disable-next-line: undefined-field local fg = hl and (hl.fg or hl.foreground) return fg and { fg = string.format("#%06x", fg) } or nil From b949835de50555b8a1c15b24361d6abb73d30808 Mon Sep 17 00:00:00 2001 From: abeldekat <58370433+abeldekat@users.noreply.github.com> Date: Thu, 7 Mar 2024 10:58:50 +0000 Subject: [PATCH 061/526] feat(extras): Enable project-specific plugin specs using local .lazy.lua (#2115) * feat(extras): Enable project-specific plugin specs using .lazy.lua * added a warning when extra lazyrc is not the last plugin spec --- lua/lazyvim/plugins/extras/lazyrc.lua | 39 +++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lazyrc.lua diff --git a/lua/lazyvim/plugins/extras/lazyrc.lua b/lua/lazyvim/plugins/extras/lazyrc.lua new file mode 100644 index 00000000..4ae88441 --- /dev/null +++ b/lua/lazyvim/plugins/extras/lazyrc.lua @@ -0,0 +1,39 @@ +--[[ +Enable project-specific plugin specs. + +File .lazy.lua: + is read when present in the current working directory + should return a plugin spec + has to be manually trusted for each instance of the file + +This extra should be the last plugin spec added to lazy.nvim + +See: + :h 'exrc' + :h :trust +--]] +local filepath = vim.fn.fnamemodify(".lazy.lua", ":p") +local file = vim.secure.read(filepath) +if not file then + return {} +end + +vim.api.nvim_create_autocmd("User", { + pattern = "VeryLazy", + once = true, + callback = function() + local Config = require("lazy.core.config") + local Util = require("lazyvim.util") + local lazyrc_idx = Util.plugin.extra_idx("lazyrc") + + if lazyrc_idx and lazyrc_idx ~= #Config.spec.modules then + Util.warn({ + "The `lazyrc` extra must be the last plugin spec added to **lazy.nvim**. ", + "", + "Add `{ import = 'lazyvim.plugins.extras.lazyrc' }` to file `config.lazy`. ", + "Do not use the `LazyExtras` command. ", + }, { title = "LazyVim", once = true }) + end + end, +}) +return loadstring(file)() From d57817d79b18a2e9aa39db129056be3adf3c8371 Mon Sep 17 00:00:00 2001 From: Peter Benjamin Date: Thu, 7 Mar 2024 02:59:38 -0800 Subject: [PATCH 062/526] feat(lang): add telescope terraform integrations (#2235) * feat(lang): add telescope terraform integrations Closes #2234 Add telescope integrations for: - https://github.com/ANGkeith/telescope-terraform-doc.nvim - https://github.com/cappyzawa/telescope-terraform.nvim * fix(lang): remove event from terraform telescope extensions --- lua/lazyvim/plugins/extras/lang/terraform.lua | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/terraform.lua b/lua/lazyvim/plugins/extras/lang/terraform.lua index ea7bd5de..d486faaf 100644 --- a/lua/lazyvim/plugins/extras/lang/terraform.lua +++ b/lua/lazyvim/plugins/extras/lang/terraform.lua @@ -1,3 +1,5 @@ +local Util = require("lazyvim.util") + vim.api.nvim_create_autocmd("FileType", { pattern = { "hcl", "terraform" }, desc = "terraform/hcl commentstring configuration", @@ -56,4 +58,25 @@ return { }, }, }, + { + "nvim-telescope/telescope.nvim", + dependencies = { + { + "ANGkeith/telescope-terraform-doc.nvim", + config = function() + Util.on_load("telescope.nvim", function() + require("telescope").load_extension("terraform_doc") + end) + end, + }, + { + "cappyzawa/telescope-terraform.nvim", + config = function() + Util.on_load("telescope.nvim", function() + require("telescope").load_extension("terraform") + end) + end, + }, + }, + }, } From 41e60af52cb77ac20374c504bce0ee7370f7c8d5 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 7 Mar 2024 12:00:44 +0100 Subject: [PATCH 063/526] style: formatting --- lua/lazyvim/config/autocmds.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index f0db2774..cd263948 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -8,10 +8,10 @@ end vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, { group = augroup("checktime"), callback = function() - if vim.o.buftype ~= 'nofile' then - vim.cmd('checktime') + if vim.o.buftype ~= "nofile" then + vim.cmd("checktime") end - end + end, }) -- Highlight on yank From 21ca466db13e68740aa3348c7406369c53062a9e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 7 Mar 2024 12:04:41 +0100 Subject: [PATCH 064/526] feat(autocmds): added support for copy/paste through ssh. Needs Neovim >= 0.10.0 --- lua/lazyvim/config/autocmds.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index cd263948..b326c79c 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -113,3 +113,26 @@ vim.api.nvim_create_autocmd({ "BufWritePre" }, { vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p") end, }) + +-- Copy/Paste when using ssh on a remote server +-- Only works on Neovim >= 0.10.0 +if vim.clipboard and vim.clipboard.osc52 then + vim.api.nvim_create_autocmd("VimEnter", { + group = augroup("ssh_clipboard"), + callback = function() + if vim.env.SSH_CONNECTION and vim.clipboard.osc52 then + vim.g.clipboard = { + name = "OSC 52", + copy = { + ["+"] = require("vim.clipboard.osc52").copy, + ["*"] = require("vim.clipboard.osc52").copy, + }, + paste = { + ["+"] = require("vim.clipboard.osc52").paste, + ["*"] = require("vim.clipboard.osc52").paste, + }, + } + end + end, + }) +end From cae22baf082dcf68c5a4074ca4f6534589d80f8d Mon Sep 17 00:00:00 2001 From: Nybkox Date: Thu, 7 Mar 2024 12:07:38 +0100 Subject: [PATCH 065/526] feat(extras): add harpoon2 (#2455) * feat(extras): add harpoon2 * Update lua/lazyvim/plugins/extras/editor/harpoon2.lua Co-authored-by: Iordanis Petkakis * chore: formatting --------- Co-authored-by: Iordanis Petkakis --- .../plugins/extras/editor/harpoon2.lua | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/editor/harpoon2.lua diff --git a/lua/lazyvim/plugins/extras/editor/harpoon2.lua b/lua/lazyvim/plugins/extras/editor/harpoon2.lua new file mode 100644 index 00000000..202f3c04 --- /dev/null +++ b/lua/lazyvim/plugins/extras/editor/harpoon2.lua @@ -0,0 +1,61 @@ +return { + "ThePrimeagen/harpoon", + branch = "harpoon2", + opts = { + menu = { + width = vim.api.nvim_win_get_width(0) - 4, + }, + }, + keys = { + { + "H", + function() + require("harpoon"):list():append() + end, + desc = "Harpoon file", + }, + { + "h", + function() + local harpoon = require("harpoon") + harpoon.ui:toggle_quick_menu(harpoon:list()) + end, + desc = "Harpoon quick menu", + }, + { + "1", + function() + require("harpoon"):list():select(1) + end, + desc = "Harpoon to file 1", + }, + { + "2", + function() + require("harpoon"):list():select(2) + end, + desc = "Harpoon to file 2", + }, + { + "3", + function() + require("harpoon"):list():select(3) + end, + desc = "Harpoon to file 3", + }, + { + "4", + function() + require("harpoon"):list():select(4) + end, + desc = "Harpoon to file 4", + }, + { + "5", + function() + require("harpoon"):list():select(5) + end, + desc = "Harpoon to file 5", + }, + }, +} From 66b3c0a19fe3024d4bf1da563f7ca5a9aff58dec Mon Sep 17 00:00:00 2001 From: Pedro Cattori Date: Thu, 7 Mar 2024 06:11:26 -0500 Subject: [PATCH 066/526] feat(ui): dashboard files searches git files if in git repo (#2240) just like `ff` keymap for telescope --- lua/lazyvim/plugins/ui.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 50efb153..2a5e5e3e 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -373,7 +373,7 @@ return { header = vim.split(logo, "\n"), -- stylua: ignore center = { - { action = "Telescope find_files", desc = " Find file", icon = " ", key = "f" }, + { action = Util.telescope("files"), desc = " Find file", icon = " ", key = "f" }, { action = "ene | startinsert", desc = " New file", icon = " ", key = "n" }, { action = "Telescope oldfiles", desc = " Recent files", icon = " ", key = "r" }, { action = "Telescope live_grep", desc = " Find text", icon = " ", key = "g" }, From ed135e6ffdd8dc9a43dabe62573688934e7a1bb0 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis Date: Thu, 7 Mar 2024 17:34:49 +0200 Subject: [PATCH 067/526] fix(lang): Change `rustacean` keymaps to `vim.keymap.set` instead of `which-key` (#2660) Based on this [comment](https://github.com/LazyVim/LazyVim/pull/2198#pullrequestreview-1873658780). --- lua/lazyvim/plugins/extras/lang/rust.lua | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/rust.lua b/lua/lazyvim/plugins/extras/lang/rust.lua index 5a8fb1b4..cea2ef1d 100644 --- a/lua/lazyvim/plugins/extras/lang/rust.lua +++ b/lua/lazyvim/plugins/extras/lang/rust.lua @@ -46,13 +46,11 @@ return { ft = { "rust" }, opts = { server = { - on_attach = function(client, bufnr) - -- register which-key mappings - local wk = require("which-key") - wk.register({ - ["cR"] = { function() vim.cmd.RustLsp("codeAction") end, "Code Action" }, - ["dr"] = { function() vim.cmd.RustLsp("debuggables") end, "Rust debuggables" }, - }, { mode = "n", buffer = bufnr }) + on_attach = function(_, bufnr) + vim.keymap.set("n", "cR", function() vim.cmd.RustLsp("codeAction") end, + { desc = "Code Action", buffer = bufnr }) + vim.keymap.set("n", "dr", function() vim.cmd.RustLsp("debuggables") end, + { desc = "Rust debuggables", buffer = bufnr }) end, default_settings = { -- rust-analyzer language server configuration @@ -128,4 +126,4 @@ return { end }, -} \ No newline at end of file +} From b2a0ae6d0d03270697359399bc33418493079a3d Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 7 Mar 2024 16:40:58 +0100 Subject: [PATCH 068/526] fix(ansible): incorrect key spec --- lua/lazyvim/plugins/extras/lang/ansible.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/ansible.lua b/lua/lazyvim/plugins/extras/lang/ansible.lua index e952a301..301fa494 100644 --- a/lua/lazyvim/plugins/extras/lang/ansible.lua +++ b/lua/lazyvim/plugins/extras/lang/ansible.lua @@ -26,11 +26,13 @@ return { { "mfussenegger/nvim-ansible", keys = { - "tr", - function() - require("ansible").run() - end, - silent = true, + { + "tr", + function() + require("ansible").run() + end, + silent = true, + }, }, }, } From 780b9bb337dc57bcd7f2bf4dc8bb5be62a6ce92b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 7 Mar 2024 17:04:18 +0100 Subject: [PATCH 069/526] feat(lsp): added native codelens support. Enable in lsp settings. (disabled by default). Fixes #2656 --- lua/lazyvim/plugins/lsp/init.lua | 24 ++++++++++++++++++++++++ lua/lazyvim/plugins/lsp/keymaps.lua | 2 ++ 2 files changed, 26 insertions(+) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index fbb4aeac..7d5fad0d 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -41,6 +41,12 @@ return { inlay_hints = { enabled = false, }, + -- Enable this to enable the builtin LSP code lenses on Neovim >= 0.10.0 + -- Be aware that you also will need to properly configure your LSP server to + -- provide the code lenses. + codelens = { + enabled = false, + }, -- add any global capabilities here capabilities = {}, -- options for vim.lsp.buf.format @@ -64,6 +70,9 @@ return { workspace = { checkThirdParty = false, }, + codeLens = { + enable = true, + }, completion = { callSnippet = "Replace", }, @@ -123,6 +132,7 @@ return { vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) end + -- inlay hints if opts.inlay_hints.enabled then Util.lsp.on_attach(function(client, buffer) if client.supports_method("textDocument/inlayHint") then @@ -131,6 +141,20 @@ return { end) end + -- code lens + if opts.codelens.enabled and vim.lsp.codelens then + Util.lsp.on_attach(function(client, buffer) + if client.supports_method("textDocument/codeLens") then + vim.lsp.codelens.refresh() + --- autocmd BufEnter,CursorHold,InsertLeave lua vim.lsp.codelens.refresh() + vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave" }, { + buffer = buffer, + callback = vim.lsp.codelens.refresh, + }) + end + end) + end + if type(opts.diagnostics.virtual_text) == "table" and opts.diagnostics.virtual_text.prefix == "icons" then opts.diagnostics.virtual_text.prefix = vim.fn.has("nvim-0.10.0") == 0 and "●" or function(diagnostic) diff --git a/lua/lazyvim/plugins/lsp/keymaps.lua b/lua/lazyvim/plugins/lsp/keymaps.lua index 10e5d86f..3e8976bb 100644 --- a/lua/lazyvim/plugins/lsp/keymaps.lua +++ b/lua/lazyvim/plugins/lsp/keymaps.lua @@ -23,6 +23,8 @@ function M.get() { "gK", vim.lsp.buf.signature_help, desc = "Signature Help", has = "signatureHelp" }, { "", vim.lsp.buf.signature_help, mode = "i", desc = "Signature Help", has = "signatureHelp" }, { "ca", vim.lsp.buf.code_action, desc = "Code Action", mode = { "n", "v" }, has = "codeAction" }, + { "cc", vim.lsp.codelens.run, desc = "Run Codelens", mode = { "n", "v" }, has = "codeLens" }, + { "cC", vim.lsp.codelens.refresh, desc = "Refresh & Display Codelens", mode = { "n" }, has = "codeLens" }, { "cA", function() From a7c16f8efd145122869ffb272d70a1229907a823 Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Fri, 8 Mar 2024 03:48:00 +1100 Subject: [PATCH 070/526] feat(java): allow opts for setup_dap_main_class_configs() (#2581) [1] https://github.com/mfussenegger/nvim-jdtls/blob/382b9f625861f47d95876bcfb4c261f3b96077cb/doc/jdtls.txt#L206-L210 --- lua/lazyvim/plugins/extras/lang/java.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/java.lua b/lua/lazyvim/plugins/extras/lang/java.lua index f7e7ca5f..fcc35b07 100644 --- a/lua/lazyvim/plugins/extras/lang/java.lua +++ b/lua/lazyvim/plugins/extras/lang/java.lua @@ -104,6 +104,7 @@ return { -- These depend on nvim-dap, but can additionally be disabled by setting false here. dap = { hotcodereplace = "auto", config_overrides = {} }, + dap_main = {}, test = true, } end, @@ -198,7 +199,7 @@ return { if opts.dap and Util.has("nvim-dap") and mason_registry.is_installed("java-debug-adapter") then -- custom init for Java debugger require("jdtls").setup_dap(opts.dap) - require("jdtls.dap").setup_dap_main_class_configs() + require("jdtls.dap").setup_dap_main_class_configs(opts.dap_main) -- Java Test require Java debugger to work if opts.test and mason_registry.is_installed("java-test") then From e8e7d22f56f2a2dc2ca0c28b02884c0356df2015 Mon Sep 17 00:00:00 2001 From: Wellington Lopes Souza Date: Thu, 7 Mar 2024 13:49:06 -0300 Subject: [PATCH 071/526] fix(go): adding opts recursive_run (#2520) Adding opts recursive_run to fix the error 'no Go files in /path/project.' This issue is caused by a recent change in the 'nvim-neotest/neotest-go' project, which now [defaults to non-recursive behavior](https://github.com/nvim-neotest/neotest-go/pull/72) --- lua/lazyvim/plugins/extras/lang/go.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/lang/go.lua b/lua/lazyvim/plugins/extras/lang/go.lua index aaad0128..c6b18093 100644 --- a/lua/lazyvim/plugins/extras/lang/go.lua +++ b/lua/lazyvim/plugins/extras/lang/go.lua @@ -148,6 +148,7 @@ return { ["neotest-go"] = { -- Here we can set options for neotest-go, e.g. -- args = { "-tags=integration" } + recursive_run = true, }, }, }, From 8386d23c817a3e3e4ee6302bd8e2902f7e297cf5 Mon Sep 17 00:00:00 2001 From: Tang-Tang Zhou Date: Thu, 7 Mar 2024 17:49:39 +0100 Subject: [PATCH 072/526] fix(util): clear buffer root cache when cwd change (#2502) --- lua/lazyvim/util/root.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/root.lua b/lua/lazyvim/util/root.lua index 29581975..942cf413 100644 --- a/lua/lazyvim/util/root.lua +++ b/lua/lazyvim/util/root.lua @@ -144,7 +144,7 @@ function M.setup() Util.root.info() end, { desc = "LazyVim roots for the current buffer" }) - vim.api.nvim_create_autocmd({ "LspAttach", "BufWritePost" }, { + vim.api.nvim_create_autocmd({ "LspAttach", "BufWritePost", "DirChanged" }, { group = vim.api.nvim_create_augroup("lazyvim_root_cache", { clear = true }), callback = function(event) M.cache[event.buf] = nil From 8ade97a42c9cf8416574f91560d697a69d8222fe Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 17:51:41 +0100 Subject: [PATCH 073/526] chore(main): release 10.11.0 (#2659) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 37 +++++++++++++++++++++++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d034b13e..bf6f6368 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,42 @@ # Changelog +## [10.11.0](https://github.com/LazyVim/LazyVim/compare/v10.10.0...v10.11.0) (2024-03-07) + + +### Features + +* **autocmds:** added support for copy/paste through ssh. Needs Neovim >= 0.10.0 ([21ca466](https://github.com/LazyVim/LazyVim/commit/21ca466db13e68740aa3348c7406369c53062a9e)) +* **extras:** add harpoon2 ([#2455](https://github.com/LazyVim/LazyVim/issues/2455)) ([cae22ba](https://github.com/LazyVim/LazyVim/commit/cae22baf082dcf68c5a4074ca4f6534589d80f8d)) +* **extras:** Add scala support using nvim-metals ([#1347](https://github.com/LazyVim/LazyVim/issues/1347)) ([d250261](https://github.com/LazyVim/LazyVim/commit/d2502613ff0fe8116a3a8891006b1a880834be15)) +* **extras:** Enable project-specific plugin specs using local .lazy.lua ([#2115](https://github.com/LazyVim/LazyVim/issues/2115)) ([b949835](https://github.com/LazyVim/LazyVim/commit/b949835de50555b8a1c15b24361d6abb73d30808)) +* **hipatterns:** add shorthand hex color support ([#2562](https://github.com/LazyVim/LazyVim/issues/2562)) ([a8eeb1b](https://github.com/LazyVim/LazyVim/commit/a8eeb1b75d9df360f2b63f0f52708f24172990e5)) +* **java:** allow opts for setup_dap_main_class_configs() ([#2581](https://github.com/LazyVim/LazyVim/issues/2581)) ([a7c16f8](https://github.com/LazyVim/LazyVim/commit/a7c16f8efd145122869ffb272d70a1229907a823)) +* **lang:** add ansible support ([#1218](https://github.com/LazyVim/LazyVim/issues/1218)) ([b7da44c](https://github.com/LazyVim/LazyVim/commit/b7da44caaed0bf7da0fd81d56f00428ff8df59d2)) +* **lang:** add Haskell config ([#2052](https://github.com/LazyVim/LazyVim/issues/2052)) ([c6c584f](https://github.com/LazyVim/LazyVim/commit/c6c584f7c3263e685e064fb84f69e58d9b625f23)) +* **lang:** add support for helm chart templates ([#2273](https://github.com/LazyVim/LazyVim/issues/2273)) ([de01a37](https://github.com/LazyVim/LazyVim/commit/de01a37cb68c3ddfb64e9576df0878a4373a6dcb)) +* **lang:** add telescope terraform integrations ([#2235](https://github.com/LazyVim/LazyVim/issues/2235)) ([d57817d](https://github.com/LazyVim/LazyVim/commit/d57817d79b18a2e9aa39db129056be3adf3c8371)) +* **lsp:** added native codelens support. Enable in lsp settings. (disabled by default). Fixes [#2656](https://github.com/LazyVim/LazyVim/issues/2656) ([780b9bb](https://github.com/LazyVim/LazyVim/commit/780b9bb337dc57bcd7f2bf4dc8bb5be62a6ce92b)) +* **omnisharp:** add `nvim-dap` configuration ([#2532](https://github.com/LazyVim/LazyVim/issues/2532)) ([f23d3ce](https://github.com/LazyVim/LazyVim/commit/f23d3cee422a8b77572a8db6fe915d374625453f)) +* **symbols-outline:** use outline.nvim instead of symbols-outline.nvim ([#2535](https://github.com/LazyVim/LazyVim/issues/2535)) ([a48b14e](https://github.com/LazyVim/LazyVim/commit/a48b14eb3e4ff03e55796dc50e08b6c8a42cccf4)) +* **treesitter:** add xml to `ensure_installed` ([#1962](https://github.com/LazyVim/LazyVim/issues/1962)) ([1b0b899](https://github.com/LazyVim/LazyVim/commit/1b0b899ab361cdabf74395449ff3c622ef74dcb1)) +* **ui:** dashboard files searches git files if in git repo ([#2240](https://github.com/LazyVim/LazyVim/issues/2240)) ([66b3c0a](https://github.com/LazyVim/LazyVim/commit/66b3c0a19fe3024d4bf1da563f7ca5a9aff58dec)) + + +### Bug Fixes + +* **ansible:** incorrect key spec ([b2a0ae6](https://github.com/LazyVim/LazyVim/commit/b2a0ae6d0d03270697359399bc33418493079a3d)) +* **autocmds:** nvim already binds q to close for man-files ([#2594](https://github.com/LazyVim/LazyVim/issues/2594)) ([16d6ac2](https://github.com/LazyVim/LazyVim/commit/16d6ac234a3fa813ed920d5e3a5fb2a8e35c20d6)) +* **dot:** remove hyprlang plugin ([#2623](https://github.com/LazyVim/LazyVim/issues/2623)) ([796112e](https://github.com/LazyVim/LazyVim/commit/796112e1707ce1a693cd76a95b84dda5529fc990)) +* **go:** adding opts recursive_run ([#2520](https://github.com/LazyVim/LazyVim/issues/2520)) ([e8e7d22](https://github.com/LazyVim/LazyVim/commit/e8e7d22f56f2a2dc2ca0c28b02884c0356df2015)) +* **lang:** Change `rustacean` keymaps to `vim.keymap.set` instead of `which-key` ([#2660](https://github.com/LazyVim/LazyVim/issues/2660)) ([ed135e6](https://github.com/LazyVim/LazyVim/commit/ed135e6ffdd8dc9a43dabe62573688934e7a1bb0)) +* **neo-tree:** Add description to "Y" in Neo-Tree ([#2642](https://github.com/LazyVim/LazyVim/issues/2642)) ([1a41743](https://github.com/LazyVim/LazyVim/commit/1a417430fc388b9a0b063017188a92d8ad14534f)) +* **options:** don't lower timeoutlen when in VS Code ([#2568](https://github.com/LazyVim/LazyVim/issues/2568)) ([29ed06e](https://github.com/LazyVim/LazyVim/commit/29ed06e0007d645d7c26b22df1346150b8e28b7f)) +* **telescope:** anonymous keymap ([#1879](https://github.com/LazyVim/LazyVim/issues/1879)) ([36ae421](https://github.com/LazyVim/LazyVim/commit/36ae4213b89191e040405c5515c24d8021f277d2)) +* **telescope:** dont use git_files when .ignore or .rgignore file is present ([e7a58d9](https://github.com/LazyVim/LazyVim/commit/e7a58d94847e6f1b282a6a717794cc454fe51faa)) +* **util.ui.fg:** Add `link=false` to show effective definition ([#2542](https://github.com/LazyVim/LazyVim/issues/2542)) ([5012d7d](https://github.com/LazyVim/LazyVim/commit/5012d7d839beede3d223c361449d0d8cb00fa098)) +* **util:** clear buffer root cache when cwd change ([#2502](https://github.com/LazyVim/LazyVim/issues/2502)) ([8386d23](https://github.com/LazyVim/LazyVim/commit/8386d23c817a3e3e4ee6302bd8e2902f7e297cf5)) +* **yanky:** properly disable sqlite.lua on Windows ([#2543](https://github.com/LazyVim/LazyVim/issues/2543)) ([d9f5e6d](https://github.com/LazyVim/LazyVim/commit/d9f5e6db165167c80fe80ede68b0e1815a81cc43)) + ## [10.10.0](https://github.com/LazyVim/LazyVim/compare/v10.9.1...v10.10.0) (2024-01-23) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 74e29c14..16bbbe46 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ local Util = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "10.10.0" -- x-release-please-version +M.version = "10.11.0" -- x-release-please-version ---@class LazyVimOptions local defaults = { From c6736ef2b8962a9b0a8d5cb5916f1b11835ac090 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 7 Mar 2024 18:59:10 +0100 Subject: [PATCH 074/526] fix(extras): show rename of symbols-outline => outline --- lua/lazyvim/util/plugin.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/util/plugin.lua b/lua/lazyvim/util/plugin.lua index 7ab69134..ee8ef0e2 100644 --- a/lua/lazyvim/util/plugin.lua +++ b/lua/lazyvim/util/plugin.lua @@ -12,6 +12,7 @@ M.deprecated_extras = { ["lazyvim.plugins.extras.formatting.conform"] = "`conform.nvim` is now the default **LazyVim** formatter.", ["lazyvim.plugins.extras.linting.nvim-lint"] = "`nvim-lint` is now the default **LazyVim** linter.", ["lazyvim.plugins.extras.ui.dashboard"] = "`dashboard.nvim` is now the default **LazyVim** starter.", + ["lazyvim.plugins.extras.editor.symbols-outline"] = "The `symbols-outline` has been replaced by `outline`.", } M.deprecated_modules = { From 5cabc2ff5b52405c0d41f1a06329567e84d15d3b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 19:04:38 +0100 Subject: [PATCH 075/526] chore(main): release 10.11.1 (#2664) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ lua/lazyvim/config/init.lua | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf6f6368..37bc118c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [10.11.1](https://github.com/LazyVim/LazyVim/compare/v10.11.0...v10.11.1) (2024-03-07) + + +### Bug Fixes + +* **extras:** show rename of symbols-outline => outline ([c6736ef](https://github.com/LazyVim/LazyVim/commit/c6736ef2b8962a9b0a8d5cb5916f1b11835ac090)) + ## [10.11.0](https://github.com/LazyVim/LazyVim/compare/v10.10.0...v10.11.0) (2024-03-07) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 16bbbe46..00f00e95 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ local Util = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "10.11.0" -- x-release-please-version +M.version = "10.11.1" -- x-release-please-version ---@class LazyVimOptions local defaults = { From 139c41c18ed7bde8dbaf5ef18afc063a96092954 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 7 Mar 2024 20:41:12 +0100 Subject: [PATCH 076/526] feat(lang): replace rust-tools.nvim with rustacean.nvim #2198 dummy commit to trigger changelog. original commit message was not correct and didnt get picked up by the changelog --- lua/lazyvim/plugins/extras/lang/rust.lua | 25 ++++++++++++------------ 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/rust.lua b/lua/lazyvim/plugins/extras/lang/rust.lua index cea2ef1d..0fa76725 100644 --- a/lua/lazyvim/plugins/extras/lang/rust.lua +++ b/lua/lazyvim/plugins/extras/lang/rust.lua @@ -42,15 +42,17 @@ return { { "mrcjkb/rustaceanvim", - version = '^4', -- Recommended + version = "^4", -- Recommended ft = { "rust" }, opts = { server = { on_attach = function(_, bufnr) - vim.keymap.set("n", "cR", function() vim.cmd.RustLsp("codeAction") end, - { desc = "Code Action", buffer = bufnr }) - vim.keymap.set("n", "dr", function() vim.cmd.RustLsp("debuggables") end, - { desc = "Rust debuggables", buffer = bufnr }) + vim.keymap.set("n", "cR", function() + vim.cmd.RustLsp("codeAction") + end, { desc = "Code Action", buffer = bufnr }) + vim.keymap.set("n", "dr", function() + vim.cmd.RustLsp("debuggables") + end, { desc = "Rust debuggables", buffer = bufnr }) end, default_settings = { -- rust-analyzer language server configuration @@ -76,13 +78,11 @@ return { }, }, }, - } + }, }, config = function(_, opts) - vim.g.rustaceanvim = vim.tbl_deep_extend("force", - {}, - opts or {}) - end + vim.g.rustaceanvim = vim.tbl_deep_extend("force", {}, opts or {}) + end, }, -- Correctly setup lspconfig for Rust 🚀 @@ -121,9 +121,8 @@ return { opts = function(_, opts) opts.adapters = opts.adapters or {} vim.list_extend(opts.adapters, { - require('rustaceanvim.neotest'), + require("rustaceanvim.neotest"), }) - end + end, }, - } From 474531407454cb69f1d09e4bc1120b9571dc8697 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 7 Mar 2024 20:43:13 +0100 Subject: [PATCH 077/526] fix(extras): set correct priority for outline extra. Fixes #2666 --- lua/lazyvim/plugins/xtras.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/xtras.lua b/lua/lazyvim/plugins/xtras.lua index 4eb73804..938087c7 100644 --- a/lua/lazyvim/plugins/xtras.lua +++ b/lua/lazyvim/plugins/xtras.lua @@ -3,7 +3,7 @@ local Config = require("lazyvim.config") -- Some extras need to be loaded before others local prios = { ["lazyvim.plugins.extras.editor.aerial"] = 100, - ["lazyvim.plugins.extras.editor.symbols-outline"] = 100, + ["lazyvim.plugins.extras.editor.outline"] = 100, ["lazyvim.plugins.extras.test.core"] = 1, ["lazyvim.plugins.extras.dap.core"] = 1, } From c0ad2209b67f125a1f1a1ae3ccd6e89b7ffc8946 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 20:45:12 +0100 Subject: [PATCH 078/526] chore(main): release 10.12.0 (#2667) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 12 ++++++++++++ lua/lazyvim/config/init.lua | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37bc118c..d57faef8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [10.12.0](https://github.com/LazyVim/LazyVim/compare/v10.11.1...v10.12.0) (2024-03-07) + + +### Features + +* **lang:** replace rust-tools.nvim with rustacean.nvim [#2198](https://github.com/LazyVim/LazyVim/issues/2198) ([139c41c](https://github.com/LazyVim/LazyVim/commit/139c41c18ed7bde8dbaf5ef18afc063a96092954)) + + +### Bug Fixes + +* **extras:** set correct priority for outline extra. Fixes [#2666](https://github.com/LazyVim/LazyVim/issues/2666) ([4745314](https://github.com/LazyVim/LazyVim/commit/474531407454cb69f1d09e4bc1120b9571dc8697)) + ## [10.11.1](https://github.com/LazyVim/LazyVim/compare/v10.11.0...v10.11.1) (2024-03-07) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 00f00e95..d2ff1b48 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ local Util = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "10.11.1" -- x-release-please-version +M.version = "10.12.0" -- x-release-please-version ---@class LazyVimOptions local defaults = { From 04bc5718a51364dddf365ba9163b2a1c7d74071d Mon Sep 17 00:00:00 2001 From: Uthman Mohamed <83053931+uthmanmoh@users.noreply.github.com> Date: Fri, 8 Mar 2024 05:22:36 -0500 Subject: [PATCH 079/526] fix(haskell): Make Haskell-snippets lazy load for performance (#2676) * fix(haskell): add filetype to haskell-snippets for lazy load * format haskell.lua --------- Co-authored-by: Uthman Mohamed <83053931+1239uth@users.noreply.github.com> --- lua/lazyvim/plugins/extras/lang/haskell.lua | 27 +++++++++++---------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/haskell.lua b/lua/lazyvim/plugins/extras/lang/haskell.lua index 764dc160..be1636bf 100644 --- a/lua/lazyvim/plugins/extras/lang/haskell.lua +++ b/lua/lazyvim/plugins/extras/lang/haskell.lua @@ -13,14 +13,14 @@ return { { "mrcjkb/haskell-tools.nvim", version = "^3", - ft = { 'haskell', 'lhaskell', 'cabal', 'cabalproject' }, + ft = { "haskell", "lhaskell", "cabal", "cabalproject" }, dependencies = { { "nvim-telescope/telescope.nvim", optional = true }, }, config = function() - local ok, telescope = pcall(require, 'telescope') + local ok, telescope = pcall(require, "telescope") if ok then - telescope.load_extension('ht') + telescope.load_extension("ht") end end, }, @@ -33,8 +33,8 @@ return { end, }, - { - "mfussenegger/nvim-dap", + { + "mfussenegger/nvim-dap", optional = true, dependencies = { { @@ -51,7 +51,7 @@ return { "nvim-neotest/neotest", optional = true, dependencies = { - { "mrcjkb/neotest-haskell", } + { "mrcjkb/neotest-haskell" }, }, opts = { adapters = { @@ -62,23 +62,24 @@ return { { "mrcjkb/haskell-snippets.nvim", - dependencies = { "L3MON4D3/LuaSnip", }, + dependencies = { "L3MON4D3/LuaSnip" }, + ft = { "haskell", "lhaskell", "cabal", "cabalproject" }, config = function() - local haskell_snippets = require('haskell-snippets').all - require('luasnip').add_snippets('haskell', haskell_snippets, { key = 'haskell' }) + local haskell_snippets = require("haskell-snippets").all + require("luasnip").add_snippets("haskell", haskell_snippets, { key = "haskell" }) end, }, { "luc-tielen/telescope_hoogle", - ft = { 'haskell', 'lhaskell', 'cabal', 'cabalproject' }, + ft = { "haskell", "lhaskell", "cabal", "cabalproject" }, dependencies = { { "nvim-telescope/telescope.nvim" }, }, config = function() - local ok, telescope = pcall(require, 'telescope') + local ok, telescope = pcall(require, "telescope") if ok then - telescope.load_extension('hoogle') + telescope.load_extension("hoogle") end end, }, @@ -90,7 +91,7 @@ return { opts = { setup = { hls = function() - return true + return true end, }, }, From 166942251dae9cc12f47edaf2aa8b2063c61e4dc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 8 Mar 2024 10:23:09 +0000 Subject: [PATCH 080/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 3a1fd8c1..8feb91bb 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 07 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 08 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 7415231855f8173e9664c035a1a631da8c664948 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 8 Mar 2024 11:31:42 +0100 Subject: [PATCH 081/526] fix(hi-patterns): correct regex for shorthand hex colors. See ##2562 --- lua/lazyvim/plugins/extras/util/mini-hipatterns.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/util/mini-hipatterns.lua b/lua/lazyvim/plugins/extras/util/mini-hipatterns.lua index c261b14f..66e34c30 100644 --- a/lua/lazyvim/plugins/extras/util/mini-hipatterns.lua +++ b/lua/lazyvim/plugins/extras/util/mini-hipatterns.lua @@ -20,7 +20,7 @@ M.plugin = { highlighters = { hex_color = hi.gen_highlighter.hex_color({ priority = 2000 }), shorthand = { - pattern = "#%x%x%x%f[%X]", + pattern = "()#%x%x%x()%f[^%x%w]", group = function(_, _, data) ---@type string local match = data.full_match From ee2e876252c82458d47617b6d87d827ea442ddcd Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 8 Mar 2024 11:46:56 +0100 Subject: [PATCH 082/526] fix(extras): automatically rename extra symbols-outline => outline. Fixes #2675 --- lua/lazyvim/config/init.lua | 2 +- lua/lazyvim/util/json.lua | 5 +++++ lua/lazyvim/util/plugin.lua | 1 - 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index d2ff1b48..0a5e874a 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -131,7 +131,7 @@ local defaults = { } M.json = { - version = 2, + version = 3, data = { version = nil, ---@type string? news = {}, ---@type table diff --git a/lua/lazyvim/util/json.lua b/lua/lazyvim/util/json.lua index d98d0382..83aee5a3 100644 --- a/lua/lazyvim/util/json.lua +++ b/lua/lazyvim/util/json.lua @@ -74,6 +74,11 @@ function M.migrate() -- replace double extras module name return extra:gsub("^lazyvim%.plugins%.extras%.lazyvim%.plugins%.extras%.", "lazyvim.plugins.extras.") end, json.data.extras or {}) + elseif json.data.version == 2 then + json.data.extras = vim.tbl_map(function(extra) + return extra == "lazyvim.plugins.extras.editor.symbols-outline" and "lazyvim.plugins.extras.editor.outline" + or extra + end, json.data.extras or {}) end M.save() diff --git a/lua/lazyvim/util/plugin.lua b/lua/lazyvim/util/plugin.lua index ee8ef0e2..7ab69134 100644 --- a/lua/lazyvim/util/plugin.lua +++ b/lua/lazyvim/util/plugin.lua @@ -12,7 +12,6 @@ M.deprecated_extras = { ["lazyvim.plugins.extras.formatting.conform"] = "`conform.nvim` is now the default **LazyVim** formatter.", ["lazyvim.plugins.extras.linting.nvim-lint"] = "`nvim-lint` is now the default **LazyVim** linter.", ["lazyvim.plugins.extras.ui.dashboard"] = "`dashboard.nvim` is now the default **LazyVim** starter.", - ["lazyvim.plugins.extras.editor.symbols-outline"] = "The `symbols-outline` has been replaced by `outline`.", } M.deprecated_modules = { From 935bc2283f9968a8fb1fc2466a14618a838cb904 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 8 Mar 2024 11:51:18 +0100 Subject: [PATCH 083/526] fix(extras): prevent duplicate extra imports --- lua/lazyvim/plugins/xtras.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lua/lazyvim/plugins/xtras.lua b/lua/lazyvim/plugins/xtras.lua index 938087c7..a130da1e 100644 --- a/lua/lazyvim/plugins/xtras.lua +++ b/lua/lazyvim/plugins/xtras.lua @@ -8,6 +8,17 @@ local prios = { ["lazyvim.plugins.extras.dap.core"] = 1, } +local used = {} ---@type table + +---@type string[] +Config.json.data.extras = vim.tbl_filter(function(extra) + if used[extra] then + return false + end + used[extra] = true + return true +end, Config.json.data.extras) + table.sort(Config.json.data.extras, function(a, b) local pa = prios[a] or 10 local pb = prios[b] or 10 From e3bfcb9bf74292dc846f5d1710fbb2e8f36a687a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 8 Mar 2024 11:55:40 +0100 Subject: [PATCH 084/526] chore(main): release 10.12.1 (#2677) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 10 ++++++++++ lua/lazyvim/config/init.lua | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d57faef8..6b5c7ae4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [10.12.1](https://github.com/LazyVim/LazyVim/compare/v10.12.0...v10.12.1) (2024-03-08) + + +### Bug Fixes + +* **extras:** automatically rename extra symbols-outline => outline. Fixes [#2675](https://github.com/LazyVim/LazyVim/issues/2675) ([ee2e876](https://github.com/LazyVim/LazyVim/commit/ee2e876252c82458d47617b6d87d827ea442ddcd)) +* **extras:** prevent duplicate extra imports ([935bc22](https://github.com/LazyVim/LazyVim/commit/935bc2283f9968a8fb1fc2466a14618a838cb904)) +* **haskell:** Make Haskell-snippets lazy load for performance ([#2676](https://github.com/LazyVim/LazyVim/issues/2676)) ([04bc571](https://github.com/LazyVim/LazyVim/commit/04bc5718a51364dddf365ba9163b2a1c7d74071d)) +* **hi-patterns:** correct regex for shorthand hex colors. See #[#2562](https://github.com/LazyVim/LazyVim/issues/2562) ([7415231](https://github.com/LazyVim/LazyVim/commit/7415231855f8173e9664c035a1a631da8c664948)) + ## [10.12.0](https://github.com/LazyVim/LazyVim/compare/v10.11.1...v10.12.0) (2024-03-07) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 0a5e874a..ca85d3bd 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ local Util = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "10.12.0" -- x-release-please-version +M.version = "10.12.1" -- x-release-please-version ---@class LazyVimOptions local defaults = { From b12e7424580d4b524755eec33006d4517fa3182e Mon Sep 17 00:00:00 2001 From: Adam Stracener <6558867+NeckBeardPrince@users.noreply.github.com> Date: Sat, 9 Mar 2024 01:59:44 -0600 Subject: [PATCH 085/526] fix(terraform-extra): Drop unnecessary commentstring config for terraform (#2680) * fix(terraform-extra): Drop unnecessary commentstring config for terraform The commentstring for terraform and hcl files is now handled by nvim-ts-context-commentstring: JoosepAlviste/nvim-ts-context-commentstring#94 * Fixed terraform.lua issues. I'm bad. --- lua/lazyvim/plugins/extras/lang/terraform.lua | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/terraform.lua b/lua/lazyvim/plugins/extras/lang/terraform.lua index d486faaf..faa3c1e1 100644 --- a/lua/lazyvim/plugins/extras/lang/terraform.lua +++ b/lua/lazyvim/plugins/extras/lang/terraform.lua @@ -1,11 +1,5 @@ local Util = require("lazyvim.util") -vim.api.nvim_create_autocmd("FileType", { - pattern = { "hcl", "terraform" }, - desc = "terraform/hcl commentstring configuration", - command = "setlocal commentstring=#\\ %s", -}) - return { { "nvim-treesitter/nvim-treesitter", From aa9fb1fd2335055ad96943d13397db2a72355dcf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 9 Mar 2024 08:00:17 +0000 Subject: [PATCH 086/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 8feb91bb..25620e69 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 08 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 09 ============================================================================== Table of Contents *LazyVim-table-of-contents* From d3761eded733b5f00e1ee14fef3fb2ce0dfb7dd0 Mon Sep 17 00:00:00 2001 From: Pete Kazmier Date: Sun, 10 Mar 2024 04:45:40 -0400 Subject: [PATCH 087/526] feat(lualine): add more hl options to pretty_path (#2687) * feat(lualine): add more hl options to pretty_path Adds two additional options to pretty_path: filename_hl and dirpath_hl. This allows users to customize the highlight group of both the directory component of the path name and the filenname independently. modified_hl is still used when the buffer has been modified. Thanks to dpetka2001 (Iordanis Petkakis) for the changes to the format function. * feat: cleanup --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/util/lualine.lua | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/util/lualine.lua b/lua/lazyvim/util/lualine.lua index 3e3cdb9a..d7789b57 100644 --- a/lua/lazyvim/util/lualine.lua +++ b/lua/lazyvim/util/lualine.lua @@ -48,7 +48,7 @@ end ---@param hl_group? string ---@return string function M.format(component, text, hl_group) - if not hl_group then + if not hl_group or hl_group == "" then return text end ---@type table @@ -56,17 +56,30 @@ function M.format(component, text, hl_group) local lualine_hl_group = component.hl_cache[hl_group] if not lualine_hl_group then local utils = require("lualine.utils.utils") - lualine_hl_group = component:create_hl({ fg = utils.extract_highlight_colors(hl_group, "fg") }, "LV_" .. hl_group) + ---@type string[] + local gui = vim.tbl_filter(function(x) + return x + end, { + utils.extract_highlight_colors(hl_group, "bold") and "bold", + utils.extract_highlight_colors(hl_group, "italic") and "italic", + }) + + lualine_hl_group = component:create_hl({ + fg = utils.extract_highlight_colors(hl_group, "fg"), + gui = #gui > 0 and table.concat(gui, ",") or nil, + }, "LV_" .. hl_group) --[[@as string]] component.hl_cache[hl_group] = lualine_hl_group end return component:format_hl(lualine_hl_group) .. text .. component:get_default_hl() end ----@param opts? {relative: "cwd"|"root", modified_hl: string?} +---@param opts? {relative: "cwd"|"root", modified_hl: string?, directory_hl: string?, filename_hl: string?} function M.pretty_path(opts) opts = vim.tbl_extend("force", { relative = "cwd", - modified_hl = "Constant", + modified_hl = "MatchParen", + directory_hl = "", + filename_hl = "Bold", }, opts or {}) return function(self) @@ -75,6 +88,7 @@ function M.pretty_path(opts) if path == "" then return "" end + local root = Util.root.get({ normalize = true }) local cwd = Util.root.cwd() @@ -86,15 +100,23 @@ function M.pretty_path(opts) local sep = package.config:sub(1, 1) local parts = vim.split(path, "[\\/]") + if #parts > 3 then parts = { parts[1], "…", parts[#parts - 1], parts[#parts] } end if opts.modified_hl and vim.bo.modified then parts[#parts] = M.format(self, parts[#parts], opts.modified_hl) + else + parts[#parts] = M.format(self, parts[#parts], opts.filename_hl) end - return table.concat(parts, sep) + local dir = "" + if #parts > 1 then + dir = table.concat({ unpack(parts, 1, #parts - 1) }, sep) + dir = M.format(self, dir .. sep, opts.directory_hl) + end + return dir .. parts[#parts] end end From 78e6405f90eeb76fdf8f1a51f9b8a81d2647a698 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 10 Mar 2024 08:46:17 +0000 Subject: [PATCH 088/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 25620e69..2f012e96 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 09 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 10 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 1c9f4160a22dbdca2db36169460fcf28641607e7 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 11 Mar 2024 23:13:48 +0100 Subject: [PATCH 089/526] fix(options): dont set clipboard in an SSH session, so that OSC52 can be enabled (when supported) --- lua/lazyvim/config/autocmds.lua | 23 ----------------------- lua/lazyvim/config/options.lua | 8 +++++++- 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index b326c79c..cd263948 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -113,26 +113,3 @@ vim.api.nvim_create_autocmd({ "BufWritePre" }, { vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p") end, }) - --- Copy/Paste when using ssh on a remote server --- Only works on Neovim >= 0.10.0 -if vim.clipboard and vim.clipboard.osc52 then - vim.api.nvim_create_autocmd("VimEnter", { - group = augroup("ssh_clipboard"), - callback = function() - if vim.env.SSH_CONNECTION and vim.clipboard.osc52 then - vim.g.clipboard = { - name = "OSC 52", - copy = { - ["+"] = require("vim.clipboard.osc52").copy, - ["*"] = require("vim.clipboard.osc52").copy, - }, - paste = { - ["+"] = require("vim.clipboard.osc52").paste, - ["*"] = require("vim.clipboard.osc52").paste, - }, - } - end - end, - }) -end diff --git a/lua/lazyvim/config/options.lua b/lua/lazyvim/config/options.lua index df259d4c..a9b3bec8 100644 --- a/lua/lazyvim/config/options.lua +++ b/lua/lazyvim/config/options.lua @@ -15,7 +15,13 @@ vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" } local opt = vim.opt opt.autowrite = true -- Enable auto write -opt.clipboard = "unnamedplus" -- Sync with system clipboard + +if not vim.env.SSH_TTY then + -- only set clipboard if not in ssh, to make sure the OSC 52 + -- integration works automatically. Requires Neovim >= 0.10.0 + opt.clipboard = "unnamedplus" -- Sync with system clipboard +end + opt.completeopt = "menu,menuone,noselect" opt.conceallevel = 2 -- Hide * markup for bold and italic, but not markers with substitutions opt.confirm = true -- Confirm to save changes before exiting modified buffer From cca2e091490fc87eafd7ee27a965e4cbcacdc012 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 11 Mar 2024 22:14:34 +0000 Subject: [PATCH 090/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 2f012e96..b998bc9c 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 10 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 11 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 0ec7a9040b60943597649940619f23bfa4b46990 Mon Sep 17 00:00:00 2001 From: Uthman Mohamed <83053931+uthmanmoh@users.noreply.github.com> Date: Wed, 13 Mar 2024 19:06:47 -0400 Subject: [PATCH 091/526] feat(git): add gf for lazygit commit history on current file (#2728) * Add gf for lazygit commit history on current file * Change root dir to git root using git command * refactor: cleanup --------- Co-authored-by: Uthman Mohamed <83053931+1239uth@users.noreply.github.com> Co-authored-by: Folke Lemaitre --- lua/lazyvim/config/keymaps.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 1e7cc1a2..e829973d 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -129,6 +129,11 @@ map("n", "ub", function() Util.toggle("background", false, {"light", "da map("n", "gg", function() Util.terminal({ "lazygit" }, { cwd = Util.root(), esc_esc = false, ctrl_hjkl = false }) end, { desc = "Lazygit (root dir)" }) map("n", "gG", function() Util.terminal({ "lazygit" }, {esc_esc = false, ctrl_hjkl = false}) end, { desc = "Lazygit (cwd)" }) +map("n", "gf", function() + local git_path = vim.fn.system("git ls-files --full-name " .. vim.api.nvim_buf_get_name(0)) + Util.terminal({ "lazygit", "-f", vim.trim(git_path) }, { esc_esc = false, ctrl_hjkl = false }) +end, { desc = "Lazygit current file history" }) + -- quit map("n", "qq", "qa", { desc = "Quit all" }) From d2f7cb0462600aa3cdd796e338f14bdffb15a635 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 13 Mar 2024 23:07:24 +0000 Subject: [PATCH 092/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index b998bc9c..0893b891 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 11 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 13 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 2a666ac5f2d91f0a1f1b711281dd72725f9759a1 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Thu, 14 Mar 2024 00:07:40 +0100 Subject: [PATCH 093/526] fix(rust): don't overwrite `vim.g.rustaceanvim` if it is defined (#2720) --- lua/lazyvim/plugins/extras/lang/rust.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/rust.lua b/lua/lazyvim/plugins/extras/lang/rust.lua index 0fa76725..397b6fc2 100644 --- a/lua/lazyvim/plugins/extras/lang/rust.lua +++ b/lua/lazyvim/plugins/extras/lang/rust.lua @@ -81,7 +81,7 @@ return { }, }, config = function(_, opts) - vim.g.rustaceanvim = vim.tbl_deep_extend("force", {}, opts or {}) + vim.g.rustaceanvim = vim.tbl_deep_extend("keep", vim.g.rustaceanvim or {}, opts or {}) end, }, From afca0b7876abf9022ee0754270f603e981ea42a5 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis Date: Thu, 14 Mar 2024 15:14:41 +0200 Subject: [PATCH 094/526] fix(conform): make `lsp_fallback` option user configurable (#2616) --- lua/lazyvim/plugins/formatting.lua | 1 + lua/lazyvim/util/lsp.lua | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/formatting.lua b/lua/lazyvim/plugins/formatting.lua index eb2dd1a8..e1aefe18 100644 --- a/lua/lazyvim/plugins/formatting.lua +++ b/lua/lazyvim/plugins/formatting.lua @@ -84,6 +84,7 @@ return { timeout_ms = 3000, async = false, -- not recommended to change quiet = false, -- not recommended to change + lsp_fallback = true, -- not recommended to change }, ---@type table formatters_by_ft = { diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index b34a2afe..a40e9415 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -109,13 +109,18 @@ end ---@param opts? lsp.Client.format function M.format(opts) - opts = vim.tbl_deep_extend("force", {}, opts or {}, require("lazyvim.util").opts("nvim-lspconfig").format or {}) + opts = vim.tbl_deep_extend( + "force", + {}, + opts or {}, + require("lazyvim.util").opts("nvim-lspconfig").format or {}, + require("lazyvim.util").opts("conform.nvim").format or {} + ) local ok, conform = pcall(require, "conform") -- use conform for formatting with LSP when available, -- since it has better format diffing if ok then opts.formatters = {} - opts.lsp_fallback = true conform.format(opts) else vim.lsp.buf.format(opts) From 98c8226e21e66cd996aadebcbfe0fedd8f26a9a1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 14 Mar 2024 13:15:16 +0000 Subject: [PATCH 095/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 0893b891..bd57e9bc 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 13 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 14 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 0ba731a87977e98f2420e2c6d2c4cabbcedaff60 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 14 Mar 2024 16:39:23 +0100 Subject: [PATCH 096/526] fix(markdown): disable headlines.nvim in insert mode. Fixes #2717 --- lua/lazyvim/plugins/extras/lang/markdown.lua | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/markdown.lua b/lua/lazyvim/plugins/extras/lang/markdown.lua index 5aa9dc33..1be5b21d 100644 --- a/lua/lazyvim/plugins/extras/lang/markdown.lua +++ b/lua/lazyvim/plugins/extras/lang/markdown.lua @@ -82,8 +82,20 @@ return { config = function(_, opts) -- PERF: schedule to prevent headlines slowing down opening a file vim.schedule(function() - require("headlines").setup(opts) - require("headlines").refresh() + local hl = require("headlines") + hl.setup(opts) + local md = hl.config.markdown + hl.refresh() + + -- Toggle markdown headlines on insert enter/leave + vim.api.nvim_create_autocmd({ "InsertEnter", "InsertLeave" }, { + callback = function(data) + if vim.bo.filetype == "markdown" then + hl.config.markdown = data.event == "InsertLeave" and md or nil + hl.refresh() + end + end, + }) end) end, }, From 843032ef1c751abf732b6f1d989584c199f049fb Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 14 Mar 2024 16:53:00 +0100 Subject: [PATCH 097/526] fix(markdown): disable headlines.nvim bullets for now --- lua/lazyvim/plugins/extras/lang/markdown.lua | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/markdown.lua b/lua/lazyvim/plugins/extras/lang/markdown.lua index 1be5b21d..e56e6de2 100644 --- a/lua/lazyvim/plugins/extras/lang/markdown.lua +++ b/lua/lazyvim/plugins/extras/lang/markdown.lua @@ -69,6 +69,8 @@ return { for _, ft in ipairs({ "markdown", "norg", "rmd", "org" }) do opts[ft] = { headline_highlights = {}, + -- disable bullets for now. See https://github.com/lukas-reineke/headlines.nvim/issues/66 + bullets = {}, } for i = 1, 6 do local hl = "Headline" .. i @@ -82,20 +84,8 @@ return { config = function(_, opts) -- PERF: schedule to prevent headlines slowing down opening a file vim.schedule(function() - local hl = require("headlines") - hl.setup(opts) - local md = hl.config.markdown - hl.refresh() - - -- Toggle markdown headlines on insert enter/leave - vim.api.nvim_create_autocmd({ "InsertEnter", "InsertLeave" }, { - callback = function(data) - if vim.bo.filetype == "markdown" then - hl.config.markdown = data.event == "InsertLeave" and md or nil - hl.refresh() - end - end, - }) + require("headlines").setup(opts) + require("headlines").refresh() end) end, }, From 991523431ff779b3bfe8ae133fa8109d8950d361 Mon Sep 17 00:00:00 2001 From: Dusty Phillips <86920+dusty-phillips@users.noreply.github.com> Date: Thu, 14 Mar 2024 13:12:23 -0300 Subject: [PATCH 098/526] fix(mini.files): description for `g.` keybinding in mini.files (#2693) If you press `g` in a mini.files menu, the `.` key shows up but doesn't have a description. This adds a desc attribute to the binding so the menu shows a correct description. --- lua/lazyvim/plugins/extras/editor/mini-files.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/mini-files.lua b/lua/lazyvim/plugins/extras/editor/mini-files.lua index 55fc768c..9f359b7b 100644 --- a/lua/lazyvim/plugins/extras/editor/mini-files.lua +++ b/lua/lazyvim/plugins/extras/editor/mini-files.lua @@ -50,7 +50,7 @@ return { callback = function(args) local buf_id = args.data.buf_id -- Tweak left-hand side of mapping to your liking - vim.keymap.set("n", "g.", toggle_dotfiles, { buffer = buf_id }) + vim.keymap.set("n", "g.", toggle_dotfiles, { buffer = buf_id, desc = "Toggle hidden files" }) end, }) From 623297efa688283b54f1b9ad169feca69aaaae67 Mon Sep 17 00:00:00 2001 From: Jeff Davis Date: Thu, 14 Mar 2024 12:12:47 -0400 Subject: [PATCH 099/526] fix(which-key): add group description for folds (#2496) Signed-off-by: Jeff Davis --- lua/lazyvim/plugins/editor.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 62ab4d7a..a2ba5e35 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -315,6 +315,7 @@ return { mode = { "n", "v" }, ["g"] = { name = "+goto" }, ["gs"] = { name = "+surround" }, + ["z"] = { name = "+fold" }, ["]"] = { name = "+next" }, ["["] = { name = "+prev" }, [""] = { name = "+tabs" }, From 0107a1079be7fb92f7d5b7e2c40818f47cf425d9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 17:16:28 +0100 Subject: [PATCH 100/526] chore(main): release 10.13.0 (#2684) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 20 ++++++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b5c7ae4..de7c8029 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [10.13.0](https://github.com/LazyVim/LazyVim/compare/v10.12.1...v10.13.0) (2024-03-14) + + +### Features + +* **git:** add <leader>gf for lazygit commit history on current file ([#2728](https://github.com/LazyVim/LazyVim/issues/2728)) ([0ec7a90](https://github.com/LazyVim/LazyVim/commit/0ec7a9040b60943597649940619f23bfa4b46990)) +* **lualine:** add more hl options to pretty_path ([#2687](https://github.com/LazyVim/LazyVim/issues/2687)) ([d3761ed](https://github.com/LazyVim/LazyVim/commit/d3761eded733b5f00e1ee14fef3fb2ce0dfb7dd0)) + + +### Bug Fixes + +* **conform:** make `lsp_fallback` option user configurable ([#2616](https://github.com/LazyVim/LazyVim/issues/2616)) ([afca0b7](https://github.com/LazyVim/LazyVim/commit/afca0b7876abf9022ee0754270f603e981ea42a5)) +* **markdown:** disable headlines.nvim bullets for now ([843032e](https://github.com/LazyVim/LazyVim/commit/843032ef1c751abf732b6f1d989584c199f049fb)) +* **markdown:** disable headlines.nvim in insert mode. Fixes [#2717](https://github.com/LazyVim/LazyVim/issues/2717) ([0ba731a](https://github.com/LazyVim/LazyVim/commit/0ba731a87977e98f2420e2c6d2c4cabbcedaff60)) +* **mini.files:** description for `g.` keybinding in mini.files ([#2693](https://github.com/LazyVim/LazyVim/issues/2693)) ([9915234](https://github.com/LazyVim/LazyVim/commit/991523431ff779b3bfe8ae133fa8109d8950d361)) +* **options:** dont set clipboard in an SSH session, so that OSC52 can be enabled (when supported) ([1c9f416](https://github.com/LazyVim/LazyVim/commit/1c9f4160a22dbdca2db36169460fcf28641607e7)) +* **rust:** don't overwrite `vim.g.rustaceanvim` if it is defined ([#2720](https://github.com/LazyVim/LazyVim/issues/2720)) ([2a666ac](https://github.com/LazyVim/LazyVim/commit/2a666ac5f2d91f0a1f1b711281dd72725f9759a1)) +* **terraform-extra:** Drop unnecessary commentstring config for terraform ([#2680](https://github.com/LazyVim/LazyVim/issues/2680)) ([b12e742](https://github.com/LazyVim/LazyVim/commit/b12e7424580d4b524755eec33006d4517fa3182e)) +* **which-key:** add group description for folds ([#2496](https://github.com/LazyVim/LazyVim/issues/2496)) ([623297e](https://github.com/LazyVim/LazyVim/commit/623297efa688283b54f1b9ad169feca69aaaae67)) + ## [10.12.1](https://github.com/LazyVim/LazyVim/compare/v10.12.0...v10.12.1) (2024-03-08) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index ca85d3bd..2e9fb4c6 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ local Util = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "10.12.1" -- x-release-please-version +M.version = "10.13.0" -- x-release-please-version ---@class LazyVimOptions local defaults = { From 42a7e79d5a09936ee521cab29d601d336c396c18 Mon Sep 17 00:00:00 2001 From: craempler <74294267+msMatix@users.noreply.github.com> Date: Fri, 15 Mar 2024 18:01:33 +0100 Subject: [PATCH 101/526] fix(git): use compatible function for windows and linux (#2740) --- lua/lazyvim/config/keymaps.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index e829973d..eca24617 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -130,7 +130,7 @@ map("n", "gg", function() Util.terminal({ "lazygit" }, { cwd = Util.root map("n", "gG", function() Util.terminal({ "lazygit" }, {esc_esc = false, ctrl_hjkl = false}) end, { desc = "Lazygit (cwd)" }) map("n", "gf", function() - local git_path = vim.fn.system("git ls-files --full-name " .. vim.api.nvim_buf_get_name(0)) + local git_path = vim.api.nvim_buf_get_name(0) Util.terminal({ "lazygit", "-f", vim.trim(git_path) }, { esc_esc = false, ctrl_hjkl = false }) end, { desc = "Lazygit current file history" }) From 864c58cae6df28c602ecb4c94bc12a46206760aa Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 15 Mar 2024 17:02:05 +0000 Subject: [PATCH 102/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index bd57e9bc..9a2b8195 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 14 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 15 ============================================================================== Table of Contents *LazyVim-table-of-contents* From d8d380a60e7dc396fcf2fee90ace77760585d685 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 18 Mar 2024 11:23:55 +0100 Subject: [PATCH 103/526] fix(lazygit): make sure we start lazygit in a valid git root --- lua/lazyvim/config/keymaps.lua | 2 +- lua/lazyvim/util/root.lua | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index eca24617..e6bbc2ab 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -126,7 +126,7 @@ map("n", "uT", function() if vim.b.ts_highlight then vim.treesitter.stop map("n", "ub", function() Util.toggle("background", false, {"light", "dark"}) end, { desc = "Toggle Background" }) -- lazygit -map("n", "gg", function() Util.terminal({ "lazygit" }, { cwd = Util.root(), esc_esc = false, ctrl_hjkl = false }) end, { desc = "Lazygit (root dir)" }) +map("n", "gg", function() Util.terminal({ "lazygit" }, { cwd = Util.root.git(), esc_esc = false, ctrl_hjkl = false }) end, { desc = "Lazygit (root dir)" }) map("n", "gG", function() Util.terminal({ "lazygit" }, {esc_esc = false, ctrl_hjkl = false}) end, { desc = "Lazygit (cwd)" }) map("n", "gf", function() diff --git a/lua/lazyvim/util/root.lua b/lua/lazyvim/util/root.lua index 942cf413..ea0ba3be 100644 --- a/lua/lazyvim/util/root.lua +++ b/lua/lazyvim/util/root.lua @@ -173,6 +173,13 @@ function M.get(opts) return Util.is_win() and ret:gsub("/", "\\") or ret end +function M.git() + local root = M.get() + local git_root = vim.fs.find(".git", { path = root, upward = true })[1] + local ret = git_root and vim.fn.fnamemodify(git_root, ":h") or root + return ret +end + ---@param opts? {hl_last?: string} function M.pretty_path(opts) return "" From e1d39b624f8dffadd787de5a83c81540919d953e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 18 Mar 2024 10:24:36 +0000 Subject: [PATCH 104/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 9a2b8195..43b6afac 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 15 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 18 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 393a9c7c7ab2c37a69a9b5da609c27fa2fd3816c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Kr=C3=BCger?= Date: Tue, 19 Mar 2024 22:02:22 +0100 Subject: [PATCH 105/526] fix(neotest): add required nvim-nio to test and dap extra (neotest and nvim-dap-ui respectively) (#2763) * Adding required nvim-nio to neotest in test-core neotest now requires nvim-neotest/nvim-nio to be installed as per BREAKING CHANGE: https://github.com/nvim-neotest/neotest/pull/337 * Adding nvim-nio as dependency nvim-dap-ui now requires nvim-neotest/nvim-nio as a dependency as of recent changes --- lua/lazyvim/plugins/extras/dap/core.lua | 1 + lua/lazyvim/plugins/extras/test/core.lua | 1 + 2 files changed, 2 insertions(+) diff --git a/lua/lazyvim/plugins/extras/dap/core.lua b/lua/lazyvim/plugins/extras/dap/core.lua index c9aa291a..343e35b9 100644 --- a/lua/lazyvim/plugins/extras/dap/core.lua +++ b/lua/lazyvim/plugins/extras/dap/core.lua @@ -18,6 +18,7 @@ return { -- fancy UI for the debugger { "rcarriga/nvim-dap-ui", + dependencies = { "nvim-neotest/nvim-nio" }, -- stylua: ignore keys = { { "du", function() require("dapui").toggle({ }) end, desc = "Dap UI" }, diff --git a/lua/lazyvim/plugins/extras/test/core.lua b/lua/lazyvim/plugins/extras/test/core.lua index 12ce90ba..4fec1425 100644 --- a/lua/lazyvim/plugins/extras/test/core.lua +++ b/lua/lazyvim/plugins/extras/test/core.lua @@ -10,6 +10,7 @@ return { }, { "nvim-neotest/neotest", + dependencies = { "nvim-neotest/nvim-nio" }, opts = { -- Can be a list of adapters like what neotest expects, -- or a list of adapter names, From b8c6d87825f32ca0db500ddafb57df67ee839f10 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 19 Mar 2024 21:02:56 +0000 Subject: [PATCH 106/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 43b6afac..790c8460 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 18 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 19 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 6a37171df6391482a3440cf607c173525bc875ba Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis Date: Tue, 19 Mar 2024 23:28:00 +0200 Subject: [PATCH 107/526] fix(extras): accept symlinks in User `extras` directory (#2745) --- lua/lazyvim/util/extras.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/extras.lua b/lua/lazyvim/util/extras.lua index 4e2f0bc1..a75c8413 100644 --- a/lua/lazyvim/util/extras.lua +++ b/lua/lazyvim/util/extras.lua @@ -42,7 +42,7 @@ function M.get() local root = Util.find_root(source.module) if root then Util.walk(root, function(path, name, type) - if type == "file" and name:match("%.lua$") then + if (type == "file" or type == "link") and name:match("%.lua$") then name = path:sub(#root + 2, -5):gsub("/", ".") local ok, extra = pcall(M.get_extra, source, source.module .. "." .. name) if ok then From ed44b246b443939ca7755bef1522c68df94c2a76 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis Date: Tue, 19 Mar 2024 23:28:31 +0200 Subject: [PATCH 108/526] feat(lualine): add `modified_sign` to `pretty_path` (#2754) Closes #2752 I left the initial text blank on purpose, so that it doesn't change anything stylistically and let the user decide what he wants to add in his personal configuration for `lualine` spec. --- lua/lazyvim/util/lualine.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/lazyvim/util/lualine.lua b/lua/lazyvim/util/lualine.lua index d7789b57..b4ffd633 100644 --- a/lua/lazyvim/util/lualine.lua +++ b/lua/lazyvim/util/lualine.lua @@ -80,6 +80,7 @@ function M.pretty_path(opts) modified_hl = "MatchParen", directory_hl = "", filename_hl = "Bold", + modified_sign = "", }, opts or {}) return function(self) @@ -106,6 +107,7 @@ function M.pretty_path(opts) end if opts.modified_hl and vim.bo.modified then + parts[#parts] = parts[#parts] .. opts.modified_sign parts[#parts] = M.format(self, parts[#parts], opts.modified_hl) else parts[#parts] = M.format(self, parts[#parts], opts.filename_hl) From 52ee7ef6962f499114f8e91230ef5558444e3a0c Mon Sep 17 00:00:00 2001 From: Aman9das <39594914+Aman9das@users.noreply.github.com> Date: Wed, 20 Mar 2024 02:59:56 +0530 Subject: [PATCH 109/526] fix(format): format injected langs does not wait 300ms (#2737) --- lua/lazyvim/plugins/formatting.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/formatting.lua b/lua/lazyvim/plugins/formatting.lua index e1aefe18..296cd944 100644 --- a/lua/lazyvim/plugins/formatting.lua +++ b/lua/lazyvim/plugins/formatting.lua @@ -39,7 +39,7 @@ return { { "cF", function() - require("conform").format({ formatters = { "injected" } }) + require("conform").format({ formatters = { "injected" }, timeout_ms = 3000 }) end, mode = { "n", "v" }, desc = "Format Injected Langs", From f65513928127ec4e2e4187af36ec49255bd0f5fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ph=C3=BAc=20H=2E=20L=C3=AA=20Kh=E1=BA=AFc?= Date: Tue, 19 Mar 2024 21:31:00 +0000 Subject: [PATCH 110/526] feat(mini.ai): add more objects d,e,g,u,U (#2769) --- lua/lazyvim/plugins/coding.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 662977f0..6b30614d 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -212,6 +212,26 @@ return { f = ai.gen_spec.treesitter({ a = "@function.outer", i = "@function.inner" }, {}), c = ai.gen_spec.treesitter({ a = "@class.outer", i = "@class.inner" }, {}), t = { "<([%p%w]-)%f[^<%w][^<>]->.-", "^<.->().*()$" }, + d = { "%f[%d]%d+" }, -- digits + e = { -- Word with case + { + "%u[%l%d]+%f[^%l%d]", + "%f[%S][%l%d]+%f[^%l%d]", + "%f[%P][%l%d]+%f[^%l%d]", + "^[%l%d]+%f[^%l%d]", + }, + "^().*()$", + }, + g = function() -- Whole buffer, similar to `gg` and 'G' motion + local from = { line = 1, col = 1 } + local to = { + line = vim.fn.line("$"), + col = math.max(vim.fn.getline("$"):len(), 1), + } + return { from = from, to = to } + end, + u = ai.gen_spec.function_call(), -- u for "Usage" + U = ai.gen_spec.function_call({ name_pattern = "[%w_]" }), -- without dot in function name }, } end, @@ -238,10 +258,15 @@ return { a = "Argument", b = "Balanced ), ], }", c = "Class", + d = "Digit(s)", + e = "Word in CamelCase & snake_case", f = "Function", + g = "Entire file", o = "Block, conditional, loop", q = "Quote `, \", '", t = "Tag", + u = "Use/call function & method", + U = "Use/call without dot in name", } local a = vim.deepcopy(i) for k, v in pairs(a) do From 1432f318b6b061d3da510ebd795a3292b10e636b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 19 Mar 2024 22:44:49 +0100 Subject: [PATCH 111/526] chore(main): release 10.14.0 (#2741) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 17 +++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de7c8029..26b47006 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [10.14.0](https://github.com/LazyVim/LazyVim/compare/v10.13.0...v10.14.0) (2024-03-19) + + +### Features + +* **lualine:** add `modified_sign` to `pretty_path` ([#2754](https://github.com/LazyVim/LazyVim/issues/2754)) ([ed44b24](https://github.com/LazyVim/LazyVim/commit/ed44b246b443939ca7755bef1522c68df94c2a76)) +* **mini.ai:** add more objects d,e,g,u,U ([#2769](https://github.com/LazyVim/LazyVim/issues/2769)) ([f655139](https://github.com/LazyVim/LazyVim/commit/f65513928127ec4e2e4187af36ec49255bd0f5fb)) + + +### Bug Fixes + +* **extras:** accept symlinks in User `extras` directory ([#2745](https://github.com/LazyVim/LazyVim/issues/2745)) ([6a37171](https://github.com/LazyVim/LazyVim/commit/6a37171df6391482a3440cf607c173525bc875ba)) +* **format:** format injected langs does not wait 300ms ([#2737](https://github.com/LazyVim/LazyVim/issues/2737)) ([52ee7ef](https://github.com/LazyVim/LazyVim/commit/52ee7ef6962f499114f8e91230ef5558444e3a0c)) +* **git:** use compatible function for windows and linux ([#2740](https://github.com/LazyVim/LazyVim/issues/2740)) ([42a7e79](https://github.com/LazyVim/LazyVim/commit/42a7e79d5a09936ee521cab29d601d336c396c18)) +* **lazygit:** make sure we start lazygit in a valid git root ([d8d380a](https://github.com/LazyVim/LazyVim/commit/d8d380a60e7dc396fcf2fee90ace77760585d685)) +* **neotest:** add required nvim-nio to test and dap extra (neotest and nvim-dap-ui respectively) ([#2763](https://github.com/LazyVim/LazyVim/issues/2763)) ([393a9c7](https://github.com/LazyVim/LazyVim/commit/393a9c7c7ab2c37a69a9b5da609c27fa2fd3816c)) + ## [10.13.0](https://github.com/LazyVim/LazyVim/compare/v10.12.1...v10.13.0) (2024-03-14) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 2e9fb4c6..bcde15e3 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ local Util = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "10.13.0" -- x-release-please-version +M.version = "10.14.0" -- x-release-please-version ---@class LazyVimOptions local defaults = { From fa0e538838f2bd3b429a98a6d676dacb7b0916af Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 20 Mar 2024 14:13:28 +0100 Subject: [PATCH 112/526] fix(lsp): dont auto install disabled lsp servers --- lua/lazyvim/plugins/lsp/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 7d5fad0d..86f9d7e4 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -210,7 +210,7 @@ return { -- run manual setup if mason=false or if this is a server that cannot be installed with mason-lspconfig if server_opts.mason == false or not vim.tbl_contains(all_mslp_servers, server) then setup(server) - else + elseif server_opts.enabled ~= false then ensure_installed[#ensure_installed + 1] = server end end From f055265bff24f047320bca1a402ab55a32b35111 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 20 Mar 2024 17:18:11 +0100 Subject: [PATCH 113/526] feat(python): added option to configure basedpyright as lsp. Check the python extra docs. Fixes #2787 --- lua/lazyvim/plugins/extras/lang/python.lua | 25 +++++++++++++++++++++- lua/lazyvim/types.lua | 4 ++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 lua/lazyvim/types.lua diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index cc9bc52e..559594db 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -1,3 +1,9 @@ +if lazyvim_docs then + -- LSP Server to use for Python. + -- Set to "basedpyright" to use basedpyright instead of pyright. + vim.g.lazyvim_python_lsp = "pyright" +end + return { { "nvim-treesitter/nvim-treesitter", @@ -7,11 +13,28 @@ return { end end, }, + -- basedpyright support. + -- Remove when merged: https://github.com/williamboman/mason-lspconfig.nvim/pull/379 + { + "williamboman/mason.nvim", + optional = true, + opts = function(_, opts) + if vim.g.lazyvim_python_lsp == "basedpyright" then + opts.ensure_installed = opts.ensure_installed or {} + table.insert(opts.ensure_installed, "basedpyright") + end + end, + }, { "neovim/nvim-lspconfig", opts = { servers = { - pyright = {}, + pyright = { + enabled = vim.g.lazyvim_python_lsp ~= "basedpyright", + }, + basedpyright = { + enabled = vim.g.lazyvim_python_lsp == "basedpyright", + }, ruff_lsp = { keys = { { diff --git a/lua/lazyvim/types.lua b/lua/lazyvim/types.lua new file mode 100644 index 00000000..73a5fe7b --- /dev/null +++ b/lua/lazyvim/types.lua @@ -0,0 +1,4 @@ +---@class LazyVimGlobals +vim.g = {} + +_G.lazyvim_docs = true From f6db6054e3e0594be32529e43d155c3aa807ff7c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 20 Mar 2024 16:18:58 +0000 Subject: [PATCH 114/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 790c8460..adbaac61 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 19 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 20 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 642bcf168b9330dd98de9647e5d49a79a38e78a4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 20 Mar 2024 17:19:56 +0100 Subject: [PATCH 115/526] chore(main): release 10.15.0 (#2790) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 12 ++++++++++++ lua/lazyvim/config/init.lua | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26b47006..1c5ad27d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [10.15.0](https://github.com/LazyVim/LazyVim/compare/v10.14.0...v10.15.0) (2024-03-20) + + +### Features + +* **python:** added option to configure basedpyright as lsp. Check the python extra docs. Fixes [#2787](https://github.com/LazyVim/LazyVim/issues/2787) ([f055265](https://github.com/LazyVim/LazyVim/commit/f055265bff24f047320bca1a402ab55a32b35111)) + + +### Bug Fixes + +* **lsp:** dont auto install disabled lsp servers ([fa0e538](https://github.com/LazyVim/LazyVim/commit/fa0e538838f2bd3b429a98a6d676dacb7b0916af)) + ## [10.14.0](https://github.com/LazyVim/LazyVim/compare/v10.13.0...v10.14.0) (2024-03-19) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index bcde15e3..8225e753 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ local Util = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "10.14.0" -- x-release-please-version +M.version = "10.15.0" -- x-release-please-version ---@class LazyVimOptions local defaults = { From 1661759d3358dbaa4be834f0022d53071b6fb21c Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis Date: Wed, 20 Mar 2024 18:25:39 +0200 Subject: [PATCH 116/526] fix(util.telescope): make `show_untracked` configurable (#2789) --- lua/lazyvim/util/telescope.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/util/telescope.lua b/lua/lazyvim/util/telescope.lua index 0a51d6aa..478876f5 100644 --- a/lua/lazyvim/util/telescope.lua +++ b/lua/lazyvim/util/telescope.lua @@ -29,7 +29,9 @@ function M.telescope(builtin, opts) and not vim.loop.fs_stat((opts.cwd or vim.loop.cwd()) .. "/.ignore") and not vim.loop.fs_stat((opts.cwd or vim.loop.cwd()) .. "/.rgignore") then - opts.show_untracked = true + if opts.show_untracked == nil then + opts.show_untracked = true + end builtin = "git_files" else builtin = "find_files" From 6e57e86c9952986a0e90055e13aa86dcde5e478e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 20 Mar 2024 17:26:47 +0100 Subject: [PATCH 117/526] feat: added LazyVim global. Will refactor specs later to use that --- lua/lazyvim/config/init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 8225e753..b84130b6 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -1,5 +1,7 @@ local Util = require("lazyvim.util") +_G.LazyVim = Util + ---@class LazyVimConfig: LazyVimOptions local M = {} From 4187417158a22ff80a059a73f2eddb113f59c113 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 20 Mar 2024 22:25:59 +0100 Subject: [PATCH 118/526] fix(python): basedpyright is now supported by mason-lspconfig --- lua/lazyvim/plugins/extras/lang/python.lua | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index 559594db..f5948903 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -13,18 +13,6 @@ return { end end, }, - -- basedpyright support. - -- Remove when merged: https://github.com/williamboman/mason-lspconfig.nvim/pull/379 - { - "williamboman/mason.nvim", - optional = true, - opts = function(_, opts) - if vim.g.lazyvim_python_lsp == "basedpyright" then - opts.ensure_installed = opts.ensure_installed or {} - table.insert(opts.ensure_installed, "basedpyright") - end - end, - }, { "neovim/nvim-lspconfig", opts = { From 70bc8803306ba26a6362d489751da48633c1164c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 21 Mar 2024 13:51:23 +0000 Subject: [PATCH 119/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index adbaac61..b7091159 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 20 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 21 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 213493e766df7a5405050205f6050ff24e5a2d6d Mon Sep 17 00:00:00 2001 From: Alexander Arvidsson Date: Fri, 22 Mar 2024 07:18:15 +0100 Subject: [PATCH 120/526] fix(format): Don't leak bufnr into opts tables (#2794) --- lua/lazyvim/plugins/formatting.lua | 2 +- lua/lazyvim/util/lsp.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/lazyvim/plugins/formatting.lua b/lua/lazyvim/plugins/formatting.lua index 296cd944..d1c9a34c 100644 --- a/lua/lazyvim/plugins/formatting.lua +++ b/lua/lazyvim/plugins/formatting.lua @@ -56,7 +56,7 @@ return { local plugin = require("lazy.core.config").plugins["conform.nvim"] local Plugin = require("lazy.core.plugin") local opts = Plugin.values(plugin, "opts", false) - require("conform").format(Util.merge(opts.format, { bufnr = buf })) + require("conform").format(Util.merge({}, opts.format, { bufnr = buf })) end, sources = function(buf) local ret = require("conform").list_formatters(buf) diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index a40e9415..d9ef04e6 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -87,10 +87,10 @@ function M.formatter(opts) primary = true, priority = 1, format = function(buf) - M.format(Util.merge(filter, { bufnr = buf })) + M.format(Util.merge({}, filter, { bufnr = buf })) end, sources = function(buf) - local clients = M.get_clients(Util.merge(filter, { bufnr = buf })) + local clients = M.get_clients(Util.merge({}, filter, { bufnr = buf })) ---@param client lsp.Client local ret = vim.tbl_filter(function(client) return client.supports_method("textDocument/formatting") From 7f333f006fa6a2b5bb39a00749f0815b75c366e3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 22 Mar 2024 06:18:48 +0000 Subject: [PATCH 121/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index b7091159..3df0cbf4 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 21 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 22 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 3a87c08cdadb23ae88bd6eb193e8392e986df6bb Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 22 Mar 2024 09:02:34 +0100 Subject: [PATCH 122/526] feat: use `vim.uv` everywhere instead of `vim.loop` --- lua/lazyvim/config/autocmds.lua | 2 +- lua/lazyvim/plugins/editor.lua | 6 +++--- lua/lazyvim/plugins/extras/editor/mini-files.lua | 2 +- lua/lazyvim/plugins/extras/test/core.lua | 2 +- lua/lazyvim/plugins/extras/util/dot.lua | 2 +- lua/lazyvim/plugins/linting.lua | 2 +- lua/lazyvim/util/init.lua | 6 +++--- lua/lazyvim/util/news.lua | 2 +- lua/lazyvim/util/root.lua | 12 ++++++------ lua/lazyvim/util/telescope.lua | 8 ++++---- lua/lazyvim/util/ui.lua | 2 +- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index cd263948..dc89b750 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -109,7 +109,7 @@ vim.api.nvim_create_autocmd({ "BufWritePre" }, { if event.match:match("^%w%w+://") then return end - local file = vim.loop.fs_realpath(event.match) or event.match + local file = vim.uv.fs_realpath(event.match) or event.match vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p") end, }) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index a2ba5e35..805be479 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -18,7 +18,7 @@ return { { "fE", function() - require("neo-tree.command").execute({ toggle = true, dir = vim.loop.cwd() }) + require("neo-tree.command").execute({ toggle = true, dir = vim.uv.cwd() }) end, desc = "Explorer NeoTree (cwd)", }, @@ -44,7 +44,7 @@ return { end, init = function() if vim.fn.argc(-1) == 1 then - local stat = vim.loop.fs_stat(vim.fn.argv(0)) + local stat = vim.uv.fs_stat(vim.fn.argv(0)) if stat and stat.type == "directory" then require("neo-tree") end @@ -151,7 +151,7 @@ return { { "fF", Util.telescope("files", { cwd = false }), desc = "Find Files (cwd)" }, { "fg", "Telescope git_files", desc = "Find Files (git-files)" }, { "fr", "Telescope oldfiles", desc = "Recent" }, - { "fR", Util.telescope("oldfiles", { cwd = vim.loop.cwd() }), desc = "Recent (cwd)" }, + { "fR", Util.telescope("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" }, -- git { "gc", "Telescope git_commits", desc = "commits" }, { "gs", "Telescope git_status", desc = "status" }, diff --git a/lua/lazyvim/plugins/extras/editor/mini-files.lua b/lua/lazyvim/plugins/extras/editor/mini-files.lua index 9f359b7b..1d6dd560 100644 --- a/lua/lazyvim/plugins/extras/editor/mini-files.lua +++ b/lua/lazyvim/plugins/extras/editor/mini-files.lua @@ -23,7 +23,7 @@ return { { "fM", function() - require("mini.files").open(vim.loop.cwd(), true) + require("mini.files").open(vim.uv.cwd(), true) end, desc = "Open mini.files (cwd)", }, diff --git a/lua/lazyvim/plugins/extras/test/core.lua b/lua/lazyvim/plugins/extras/test/core.lua index 4fec1425..5554b6af 100644 --- a/lua/lazyvim/plugins/extras/test/core.lua +++ b/lua/lazyvim/plugins/extras/test/core.lua @@ -109,7 +109,7 @@ return { -- stylua: ignore keys = { { "tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" }, - { "tT", function() require("neotest").run.run(vim.loop.cwd()) end, desc = "Run All Test Files" }, + { "tT", function() require("neotest").run.run(vim.uv.cwd()) end, desc = "Run All Test Files" }, { "tr", function() require("neotest").run.run() end, desc = "Run Nearest" }, { "tl", function() require("neotest").run.run_last() end, desc = "Run Last" }, { "ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" }, diff --git a/lua/lazyvim/plugins/extras/util/dot.lua b/lua/lazyvim/plugins/extras/util/dot.lua index fabeec2c..8ba24b51 100644 --- a/lua/lazyvim/plugins/extras/util/dot.lua +++ b/lua/lazyvim/plugins/extras/util/dot.lua @@ -3,7 +3,7 @@ local xdg_config = vim.env.XDG_CONFIG_HOME or vim.env.HOME .. "/.config" ---@param path string local function have(path) - return vim.loop.fs_stat(xdg_config .. "/" .. path) ~= nil + return vim.uv.fs_stat(xdg_config .. "/" .. path) ~= nil end return { diff --git a/lua/lazyvim/plugins/linting.lua b/lua/lazyvim/plugins/linting.lua index 2d2527c1..b9b83165 100644 --- a/lua/lazyvim/plugins/linting.lua +++ b/lua/lazyvim/plugins/linting.lua @@ -42,7 +42,7 @@ return { lint.linters_by_ft = opts.linters_by_ft function M.debounce(ms, fn) - local timer = vim.loop.new_timer() + local timer = vim.uv.new_timer() return function(...) local argv = { ... } timer:start(ms, 0, function() diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index 24fd0a1b..54c8706c 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -50,7 +50,7 @@ setmetatable(M, { }) function M.is_win() - return vim.loop.os_uname().sysname:find("Windows") ~= nil + return vim.uv.os_uname().sysname:find("Windows") ~= nil end ---@param plugin string @@ -97,8 +97,8 @@ function M.lazy_notify() local orig = vim.notify vim.notify = temp - local timer = vim.loop.new_timer() - local check = assert(vim.loop.new_check()) + local timer = vim.uv.new_timer() + local check = assert(vim.uv.new_check()) local replay = function() timer:stop() diff --git a/lua/lazyvim/util/news.lua b/lua/lazyvim/util/news.lua index 4c212470..ae71e67c 100644 --- a/lua/lazyvim/util/news.lua +++ b/lua/lazyvim/util/news.lua @@ -5,7 +5,7 @@ local Util = require("lazyvim.util") local M = {} function M.hash(file) - local stat = vim.loop.fs_stat(file) + local stat = vim.uv.fs_stat(file) if not stat then return end diff --git a/lua/lazyvim/util/root.lua b/lua/lazyvim/util/root.lua index ea0ba3be..e4bdeab1 100644 --- a/lua/lazyvim/util/root.lua +++ b/lua/lazyvim/util/root.lua @@ -22,7 +22,7 @@ M.spec = { "lsp", { ".git", "lua" }, "cwd" } M.detectors = {} function M.detectors.cwd() - return { vim.loop.cwd() } + return { vim.uv.cwd() } end function M.detectors.lsp(buf) @@ -48,7 +48,7 @@ end ---@param patterns string[]|string function M.detectors.pattern(buf, patterns) patterns = type(patterns) == "string" and { patterns } or patterns - local path = M.bufpath(buf) or vim.loop.cwd() + local path = M.bufpath(buf) or vim.uv.cwd() local pattern = vim.fs.find(patterns, { path = path, upward = true })[1] return pattern and { vim.fs.dirname(pattern) } or {} end @@ -58,14 +58,14 @@ function M.bufpath(buf) end function M.cwd() - return M.realpath(vim.loop.cwd()) or "" + return M.realpath(vim.uv.cwd()) or "" end function M.realpath(path) if path == "" or path == nil then return nil end - path = vim.loop.fs_realpath(path) or path + path = vim.uv.fs_realpath(path) or path return Util.norm(path) end @@ -133,7 +133,7 @@ function M.info() lines[#lines + 1] = "vim.g.root_spec = " .. vim.inspect(spec) lines[#lines + 1] = "```" require("lazyvim.util").info(lines, { title = "LazyVim Roots" }) - return roots[1] and roots[1].paths[1] or vim.loop.cwd() + return roots[1] and roots[1].paths[1] or vim.uv.cwd() end ---@type table @@ -164,7 +164,7 @@ function M.get(opts) local ret = M.cache[buf] if not ret then local roots = M.detect({ all = false }) - ret = roots[1] and roots[1].paths[1] or vim.loop.cwd() + ret = roots[1] and roots[1].paths[1] or vim.uv.cwd() M.cache[buf] = ret end if opts and opts.normalize then diff --git a/lua/lazyvim/util/telescope.lua b/lua/lazyvim/util/telescope.lua index 478876f5..86dc02f0 100644 --- a/lua/lazyvim/util/telescope.lua +++ b/lua/lazyvim/util/telescope.lua @@ -25,9 +25,9 @@ function M.telescope(builtin, opts) opts = vim.tbl_deep_extend("force", { cwd = Util.root() }, opts or {}) --[[@as lazyvim.util.telescope.opts]] if builtin == "files" then if - vim.loop.fs_stat((opts.cwd or vim.loop.cwd()) .. "/.git") - and not vim.loop.fs_stat((opts.cwd or vim.loop.cwd()) .. "/.ignore") - and not vim.loop.fs_stat((opts.cwd or vim.loop.cwd()) .. "/.rgignore") + vim.uv.fs_stat((opts.cwd or vim.uv.cwd()) .. "/.git") + and not vim.uv.fs_stat((opts.cwd or vim.uv.cwd()) .. "/.ignore") + and not vim.uv.fs_stat((opts.cwd or vim.uv.cwd()) .. "/.rgignore") then if opts.show_untracked == nil then opts.show_untracked = true @@ -37,7 +37,7 @@ function M.telescope(builtin, opts) builtin = "find_files" end end - if opts.cwd and opts.cwd ~= vim.loop.cwd() then + if opts.cwd and opts.cwd ~= vim.uv.cwd() then local function open_cwd_dir() local action_state = require("telescope.actions.state") local line = action_state.get_current_line() diff --git a/lua/lazyvim/util/ui.lua b/lua/lazyvim/util/ui.lua index 6eaefdb3..1de0730b 100644 --- a/lua/lazyvim/util/ui.lua +++ b/lua/lazyvim/util/ui.lua @@ -150,7 +150,7 @@ function M.fg(name) end M.skip_foldexpr = {} ---@type table -local skip_check = assert(vim.loop.new_check()) +local skip_check = assert(vim.uv.new_check()) function M.foldexpr() local buf = vim.api.nvim_get_current_buf() From 7a5dbeae75b553b489af8074e9a87207edf1395c Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 22 Mar 2024 09:15:09 +0100 Subject: [PATCH 123/526] feat: use LazyVim everywhere instead of `require("lazyvim.util")` --- lua/lazyvim/config/init.lua | 32 +++++++-------- lua/lazyvim/config/keymaps.lua | 37 +++++++++-------- lua/lazyvim/plugins/coding.lua | 7 ++-- lua/lazyvim/plugins/editor.lua | 40 +++++++++---------- lua/lazyvim/plugins/extras/coding/codeium.lua | 2 +- lua/lazyvim/plugins/extras/coding/copilot.lua | 13 +++--- lua/lazyvim/plugins/extras/coding/tabnine.lua | 8 ++-- lua/lazyvim/plugins/extras/editor/aerial.lua | 9 ++--- .../plugins/extras/editor/mini-files.lua | 2 +- lua/lazyvim/plugins/extras/editor/navic.lua | 2 +- lua/lazyvim/plugins/extras/editor/outline.lua | 8 ++-- lua/lazyvim/plugins/extras/lang/clangd.lua | 2 +- lua/lazyvim/plugins/extras/lang/go.lua | 2 +- lua/lazyvim/plugins/extras/lang/helm.lua | 2 +- lua/lazyvim/plugins/extras/lang/java.lua | 8 ++-- lua/lazyvim/plugins/extras/lang/python.lua | 4 +- lua/lazyvim/plugins/extras/lang/terraform.lua | 6 +-- lua/lazyvim/plugins/extras/lang/yaml.lua | 2 +- lua/lazyvim/plugins/extras/lazyrc.lua | 5 +-- lua/lazyvim/plugins/extras/linting/eslint.lua | 6 +-- lua/lazyvim/plugins/extras/lsp/none-ls.lua | 8 ++-- lua/lazyvim/plugins/extras/test/core.lua | 4 +- lua/lazyvim/plugins/extras/util/gitui.lua | 4 +- lua/lazyvim/plugins/extras/util/project.lua | 2 +- lua/lazyvim/plugins/formatting.lua | 17 ++++---- lua/lazyvim/plugins/linting.lua | 4 +- lua/lazyvim/plugins/lsp/init.lua | 22 +++++----- lua/lazyvim/plugins/lsp/keymaps.lua | 8 ++-- lua/lazyvim/plugins/treesitter.lua | 7 ++-- lua/lazyvim/plugins/ui.lua | 26 ++++++------ lua/lazyvim/util/extras.lua | 11 +++-- lua/lazyvim/util/format.lua | 12 +++--- lua/lazyvim/util/init.lua | 2 +- lua/lazyvim/util/json.lua | 7 ++-- lua/lazyvim/util/lsp.lua | 12 +++--- lua/lazyvim/util/lualine.lua | 18 ++++----- lua/lazyvim/util/news.lua | 9 ++--- lua/lazyvim/util/plugin.lua | 11 +++-- lua/lazyvim/util/root.lua | 14 +++---- lua/lazyvim/util/telescope.lua | 6 +-- lua/lazyvim/util/toggle.lua | 16 ++++---- 41 files changed, 188 insertions(+), 229 deletions(-) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index b84130b6..5b087513 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -1,6 +1,4 @@ -local Util = require("lazyvim.util") - -_G.LazyVim = Util +_G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} @@ -151,7 +149,7 @@ function M.json.load() if ok then M.json.data = vim.tbl_deep_extend("force", M.json.data, json or {}) if M.json.data.version ~= M.json.version then - Util.json.migrate() + LazyVim.json.migrate() end end end @@ -180,12 +178,12 @@ function M.setup(opts) end M.load("keymaps") - Util.format.setup() - Util.news.setup() - Util.root.setup() + LazyVim.format.setup() + LazyVim.news.setup() + LazyVim.root.setup() vim.api.nvim_create_user_command("LazyExtras", function() - Util.extras.show() + LazyVim.extras.show() end, { desc = "Manage LazyVim extras" }) vim.api.nvim_create_user_command("LazyHealth", function() @@ -195,8 +193,8 @@ function M.setup(opts) end, }) - Util.track("colorscheme") - Util.try(function() + LazyVim.track("colorscheme") + LazyVim.try(function() if type(M.colorscheme) == "function" then M.colorscheme() else @@ -205,11 +203,11 @@ function M.setup(opts) end, { msg = "Could not load your colorscheme", on_error = function(msg) - Util.error(msg) + LazyVim.error(msg) vim.cmd.colorscheme("habamax") end, }) - Util.track() + LazyVim.track() end ---@param buf? number @@ -231,7 +229,7 @@ end function M.load(name) local function _load(mod) if require("lazy.core.cache").find(mod)[1] then - Util.try(function() + LazyVim.try(function() require(mod) end, { msg = "Failed loading " .. mod }) end @@ -261,19 +259,19 @@ function M.init() end package.preload["lazyvim.plugins.lsp.format"] = function() - Util.deprecate([[require("lazyvim.plugins.lsp.format")]], [[require("lazyvim.util").format]]) - return Util.format + LazyVim.deprecate([[require("lazyvim.plugins.lsp.format")]], [[LazyVim.format]]) + return LazyVim.format end -- delay notifications till vim.notify was replaced or after 500ms - require("lazyvim.util").lazy_notify() + LazyVim.lazy_notify() -- load options here, before lazy init while sourcing plugin modules -- this is needed to make sure options will be correctly applied -- after installing missing plugins M.load("options") - Util.plugin.setup() + LazyVim.plugin.setup() M.json.load() end diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index e6bbc2ab..e5790d8f 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -1,9 +1,8 @@ -- This file is automatically loaded by lazyvim.config.init -local Util = require("lazyvim.util") -- DO NOT USE THIS IN YOU OWN CONFIG!! -- use `vim.keymap.set` instead -local map = Util.safe_keymap_set +local map = LazyVim.safe_keymap_set -- better up/down map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) @@ -88,7 +87,7 @@ map("n", "]q", vim.cmd.cnext, { desc = "Next quickfix" }) -- formatting map({ "n", "v" }, "cf", function() - Util.format({ force = true }) + LazyVim.format({ force = true }) end, { desc = "Format" }) -- diagnostic @@ -110,28 +109,28 @@ map("n", "[w", diagnostic_goto(false, "WARN"), { desc = "Prev Warning" }) -- stylua: ignore start -- toggle options -map("n", "uf", function() Util.format.toggle() end, { desc = "Toggle auto format (global)" }) -map("n", "uF", function() Util.format.toggle(true) end, { desc = "Toggle auto format (buffer)" }) -map("n", "us", function() Util.toggle("spell") end, { desc = "Toggle Spelling" }) -map("n", "uw", function() Util.toggle("wrap") end, { desc = "Toggle Word Wrap" }) -map("n", "uL", function() Util.toggle("relativenumber") end, { desc = "Toggle Relative Line Numbers" }) -map("n", "ul", function() Util.toggle.number() end, { desc = "Toggle Line Numbers" }) -map("n", "ud", function() Util.toggle.diagnostics() end, { desc = "Toggle Diagnostics" }) +map("n", "uf", function() LazyVim.format.toggle() end, { desc = "Toggle auto format (global)" }) +map("n", "uF", function() LazyVim.format.toggle(true) end, { desc = "Toggle auto format (buffer)" }) +map("n", "us", function() LazyVim.toggle("spell") end, { desc = "Toggle Spelling" }) +map("n", "uw", function() LazyVim.toggle("wrap") end, { desc = "Toggle Word Wrap" }) +map("n", "uL", function() LazyVim.toggle("relativenumber") end, { desc = "Toggle Relative Line Numbers" }) +map("n", "ul", function() LazyVim.toggle.number() end, { desc = "Toggle Line Numbers" }) +map("n", "ud", function() LazyVim.toggle.diagnostics() end, { desc = "Toggle Diagnostics" }) local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3 -map("n", "uc", function() Util.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" }) +map("n", "uc", function() LazyVim.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" }) if vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint then - map( "n", "uh", function() Util.toggle.inlay_hints() end, { desc = "Toggle Inlay Hints" }) + map( "n", "uh", function() LazyVim.toggle.inlay_hints() end, { desc = "Toggle Inlay Hints" }) end map("n", "uT", function() if vim.b.ts_highlight then vim.treesitter.stop() else vim.treesitter.start() end end, { desc = "Toggle Treesitter Highlight" }) -map("n", "ub", function() Util.toggle("background", false, {"light", "dark"}) end, { desc = "Toggle Background" }) +map("n", "ub", function() LazyVim.toggle("background", false, {"light", "dark"}) end, { desc = "Toggle Background" }) -- lazygit -map("n", "gg", function() Util.terminal({ "lazygit" }, { cwd = Util.root.git(), esc_esc = false, ctrl_hjkl = false }) end, { desc = "Lazygit (root dir)" }) -map("n", "gG", function() Util.terminal({ "lazygit" }, {esc_esc = false, ctrl_hjkl = false}) end, { desc = "Lazygit (cwd)" }) +map("n", "gg", function() LazyVim.terminal({ "lazygit" }, { cwd = LazyVim.root.git(), esc_esc = false, ctrl_hjkl = false }) end, { desc = "Lazygit (root dir)" }) +map("n", "gG", function() LazyVim.terminal({ "lazygit" }, {esc_esc = false, ctrl_hjkl = false}) end, { desc = "Lazygit (cwd)" }) map("n", "gf", function() local git_path = vim.api.nvim_buf_get_name(0) - Util.terminal({ "lazygit", "-f", vim.trim(git_path) }, { esc_esc = false, ctrl_hjkl = false }) + LazyVim.terminal({ "lazygit", "-f", vim.trim(git_path) }, { esc_esc = false, ctrl_hjkl = false }) end, { desc = "Lazygit current file history" }) -- quit @@ -141,12 +140,12 @@ map("n", "qq", "qa", { desc = "Quit all" }) map("n", "ui", vim.show_pos, { desc = "Inspect Pos" }) -- LazyVim Changelog -map("n", "L", function() Util.news.changelog() end, { desc = "LazyVim Changelog" }) +map("n", "L", function() LazyVim.news.changelog() end, { desc = "LazyVim Changelog" }) -- floating terminal -local lazyterm = function() Util.terminal(nil, { cwd = Util.root() }) end +local lazyterm = function() LazyVim.terminal(nil, { cwd = LazyVim.root() }) end map("n", "ft", lazyterm, { desc = "Terminal (root dir)" }) -map("n", "fT", function() Util.terminal() end, { desc = "Terminal (cwd)" }) +map("n", "fT", function() LazyVim.terminal() end, { desc = "Terminal (cwd)" }) map("n", "", lazyterm, { desc = "Terminal (root dir)" }) map("n", "", lazyterm, { desc = "which_key_ignore" }) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 6b30614d..6aec8b85 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -122,12 +122,11 @@ return { { "up", function() - local Util = require("lazy.core.util") vim.g.minipairs_disable = not vim.g.minipairs_disable if vim.g.minipairs_disable then - Util.warn("Disabled auto pairs", { title = "Option" }) + LazyVim.warn("Disabled auto pairs", { title = "Option" }) else - Util.info("Enabled auto pairs", { title = "Option" }) + LazyVim.info("Enabled auto pairs", { title = "Option" }) end end, desc = "Toggle auto pairs", @@ -238,7 +237,7 @@ return { config = function(_, opts) require("mini.ai").setup(opts) -- register all text objects with which-key - require("lazyvim.util").on_load("which-key.nvim", function() + LazyVim.on_load("which-key.nvim", function() ---@type table local i = { [" "] = "Whitespace", diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 805be479..73063a57 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -1,5 +1,3 @@ -local Util = require("lazyvim.util") - return { -- file explorer @@ -11,7 +9,7 @@ return { { "fe", function() - require("neo-tree.command").execute({ toggle = true, dir = Util.root() }) + require("neo-tree.command").execute({ toggle = true, dir = LazyVim.root() }) end, desc = "Explorer NeoTree (root dir)", }, @@ -82,7 +80,7 @@ return { }, config = function(_, opts) local function on_move(data) - Util.lsp.on_rename(data.source, data.destination) + LazyVim.lsp.on_rename(data.source, data.destination) end local events = require("neo-tree.events") @@ -129,7 +127,7 @@ return { build = "make", enabled = vim.fn.executable("make") == 1, config = function() - Util.on_load("telescope.nvim", function() + LazyVim.on_load("telescope.nvim", function() require("telescope").load_extension("fzf") end) end, @@ -141,17 +139,17 @@ return { "Telescope buffers sort_mru=true sort_lastused=true", desc = "Switch Buffer", }, - { "/", Util.telescope("live_grep"), desc = "Grep (root dir)" }, + { "/", LazyVim.telescope("live_grep"), desc = "Grep (root dir)" }, { ":", "Telescope command_history", desc = "Command History" }, - { "", Util.telescope("files"), desc = "Find Files (root dir)" }, + { "", LazyVim.telescope("files"), desc = "Find Files (root dir)" }, -- find { "fb", "Telescope buffers sort_mru=true sort_lastused=true", desc = "Buffers" }, - { "fc", Util.telescope.config_files(), desc = "Find Config File" }, - { "ff", Util.telescope("files"), desc = "Find Files (root dir)" }, - { "fF", Util.telescope("files", { cwd = false }), desc = "Find Files (cwd)" }, + { "fc", LazyVim.telescope.config_files(), desc = "Find Config File" }, + { "ff", LazyVim.telescope("files"), desc = "Find Files (root dir)" }, + { "fF", LazyVim.telescope("files", { cwd = false }), desc = "Find Files (cwd)" }, { "fg", "Telescope git_files", desc = "Find Files (git-files)" }, { "fr", "Telescope oldfiles", desc = "Recent" }, - { "fR", Util.telescope("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" }, + { "fR", LazyVim.telescope("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" }, -- git { "gc", "Telescope git_commits", desc = "commits" }, { "gs", "Telescope git_status", desc = "status" }, @@ -163,8 +161,8 @@ return { { "sC", "Telescope commands", desc = "Commands" }, { "sd", "Telescope diagnostics bufnr=0", desc = "Document diagnostics" }, { "sD", "Telescope diagnostics", desc = "Workspace diagnostics" }, - { "sg", Util.telescope("live_grep"), desc = "Grep (root dir)" }, - { "sG", Util.telescope("live_grep", { cwd = false }), desc = "Grep (cwd)" }, + { "sg", LazyVim.telescope("live_grep"), desc = "Grep (root dir)" }, + { "sG", LazyVim.telescope("live_grep", { cwd = false }), desc = "Grep (cwd)" }, { "sh", "Telescope help_tags", desc = "Help Pages" }, { "sH", "Telescope highlights", desc = "Search Highlight Groups" }, { "sk", "Telescope keymaps", desc = "Key Maps" }, @@ -172,11 +170,11 @@ return { { "sm", "Telescope marks", desc = "Jump to Mark" }, { "so", "Telescope vim_options", desc = "Options" }, { "sR", "Telescope resume", desc = "Resume" }, - { "sw", Util.telescope("grep_string", { word_match = "-w" }), desc = "Word (root dir)" }, - { "sW", Util.telescope("grep_string", { cwd = false, word_match = "-w" }), desc = "Word (cwd)" }, - { "sw", Util.telescope("grep_string"), mode = "v", desc = "Selection (root dir)" }, - { "sW", Util.telescope("grep_string", { cwd = false }), mode = "v", desc = "Selection (cwd)" }, - { "uC", Util.telescope("colorscheme", { enable_preview = true }), desc = "Colorscheme with preview" }, + { "sw", LazyVim.telescope("grep_string", { word_match = "-w" }), desc = "Word (root dir)" }, + { "sW", LazyVim.telescope("grep_string", { cwd = false, word_match = "-w" }), desc = "Word (cwd)" }, + { "sw", LazyVim.telescope("grep_string"), mode = "v", desc = "Selection (root dir)" }, + { "sW", LazyVim.telescope("grep_string", { cwd = false }), mode = "v", desc = "Selection (cwd)" }, + { "uC", LazyVim.telescope("colorscheme", { enable_preview = true }), desc = "Colorscheme with preview" }, { "ss", function() @@ -208,12 +206,12 @@ return { local find_files_no_ignore = function() local action_state = require("telescope.actions.state") local line = action_state.get_current_line() - Util.telescope("find_files", { no_ignore = true, default_text = line })() + LazyVim.telescope("find_files", { no_ignore = true, default_text = line })() end local find_files_with_hidden = function() local action_state = require("telescope.actions.state") local line = action_state.get_current_line() - Util.telescope("find_files", { hidden = true, default_text = line })() + LazyVim.telescope("find_files", { hidden = true, default_text = line })() end return { @@ -277,7 +275,7 @@ return { "nvim-telescope/telescope.nvim", optional = true, opts = function(_, opts) - if not Util.has("flash.nvim") then + if not LazyVim.has("flash.nvim") then return end local function flash(prompt_bufnr) diff --git a/lua/lazyvim/plugins/extras/coding/codeium.lua b/lua/lazyvim/plugins/extras/coding/codeium.lua index a9f40624..b95ad433 100644 --- a/lua/lazyvim/plugins/extras/coding/codeium.lua +++ b/lua/lazyvim/plugins/extras/coding/codeium.lua @@ -27,7 +27,7 @@ return { optional = true, event = "VeryLazy", opts = function(_, opts) - table.insert(opts.sections.lualine_x, 2, require("lazyvim.util").lualine.cmp_source("codeium")) + table.insert(opts.sections.lualine_x, 2, LazyVim.lualine.cmp_source("codeium")) end, }, } diff --git a/lua/lazyvim/plugins/extras/coding/copilot.lua b/lua/lazyvim/plugins/extras/coding/copilot.lua index 279a974f..86c54a6e 100644 --- a/lua/lazyvim/plugins/extras/coding/copilot.lua +++ b/lua/lazyvim/plugins/extras/coding/copilot.lua @@ -19,12 +19,11 @@ return { optional = true, event = "VeryLazy", opts = function(_, opts) - local Util = require("lazyvim.util") local colors = { - [""] = Util.ui.fg("Special"), - ["Normal"] = Util.ui.fg("Special"), - ["Warning"] = Util.ui.fg("DiagnosticError"), - ["InProgress"] = Util.ui.fg("DiagnosticWarn"), + [""] = LazyVim.ui.fg("Special"), + ["Normal"] = LazyVim.ui.fg("Special"), + ["Warning"] = LazyVim.ui.fg("DiagnosticError"), + ["InProgress"] = LazyVim.ui.fg("DiagnosticWarn"), } table.insert(opts.sections.lualine_x, 2, { function() @@ -36,7 +35,7 @@ return { if not package.loaded["copilot"] then return end - local ok, clients = pcall(require("lazyvim.util").lsp.get_clients, { name = "copilot", bufnr = 0 }) + local ok, clients = pcall(LazyVim.lsp.get_clients, { name = "copilot", bufnr = 0 }) if not ok then return false end @@ -66,7 +65,7 @@ return { copilot_cmp.setup(opts) -- attach cmp source whenever copilot attaches -- fixes lazy-loading issues with the copilot cmp source - require("lazyvim.util").lsp.on_attach(function(client) + LazyVim.lsp.on_attach(function(client) if client.name == "copilot" then copilot_cmp._on_insert_enter({}) end diff --git a/lua/lazyvim/plugins/extras/coding/tabnine.lua b/lua/lazyvim/plugins/extras/coding/tabnine.lua index aac8519e..a255120e 100644 --- a/lua/lazyvim/plugins/extras/coding/tabnine.lua +++ b/lua/lazyvim/plugins/extras/coding/tabnine.lua @@ -1,5 +1,3 @@ -local Util = require("lazyvim.util") - return { -- Tabnine cmp source { @@ -8,7 +6,7 @@ return { { "tzachar/cmp-tabnine", build = { - Util.is_win() and "pwsh -noni .\\install.ps1" or "./install.sh", + LazyVim.is_win() and "pwsh -noni .\\install.ps1" or "./install.sh", ":CmpTabnineHub", }, dependencies = "hrsh7th/nvim-cmp", @@ -30,7 +28,7 @@ return { priority = 100, }) - opts.formatting.format = Util.inject.args(opts.formatting.format, function(entry, item) + opts.formatting.format = LazyVim.inject.args(opts.formatting.format, function(entry, item) -- Hide percentage in the menu if entry.source.name == "cmp_tabnine" then item.menu = "" @@ -45,7 +43,7 @@ return { event = "VeryLazy", opts = function(_, opts) local icon = require("lazyvim.config").icons.kinds.TabNine - table.insert(opts.sections.lualine_x, 2, require("lazyvim.util").lualine.cmp_source("cmp_tabnine", icon)) + table.insert(opts.sections.lualine_x, 2, LazyVim.lualine.cmp_source("cmp_tabnine", icon)) end, }, } diff --git a/lua/lazyvim/plugins/extras/editor/aerial.lua b/lua/lazyvim/plugins/extras/editor/aerial.lua index 440c9fda..15a209ba 100644 --- a/lua/lazyvim/plugins/extras/editor/aerial.lua +++ b/lua/lazyvim/plugins/extras/editor/aerial.lua @@ -1,5 +1,4 @@ local Config = require("lazyvim.config") -local Util = require("lazyvim.util") return { desc = "Aerial Symbol Browser", @@ -55,7 +54,7 @@ return { "nvim-telescope/telescope.nvim", optional = true, opts = function() - Util.on_load("telescope.nvim", function() + LazyVim.on_load("telescope.nvim", function() require("telescope").load_extension("aerial") end) end, @@ -73,11 +72,11 @@ return { "folke/edgy.nvim", optional = true, opts = function(_, opts) - local edgy_idx = Util.plugin.extra_idx("ui.edgy") - local aerial_idx = Util.plugin.extra_idx("editor.aerial") + local edgy_idx = LazyVim.plugin.extra_idx("ui.edgy") + local aerial_idx = LazyVim.plugin.extra_idx("editor.aerial") if edgy_idx and edgy_idx > aerial_idx then - Util.warn("The `edgy.nvim` extra must be **imported** before the `aerial.nvim` extra to work properly.", { + LazyVim.warn("The `edgy.nvim` extra must be **imported** before the `aerial.nvim` extra to work properly.", { title = "LazyVim", }) end diff --git a/lua/lazyvim/plugins/extras/editor/mini-files.lua b/lua/lazyvim/plugins/extras/editor/mini-files.lua index 1d6dd560..cc829bb5 100644 --- a/lua/lazyvim/plugins/extras/editor/mini-files.lua +++ b/lua/lazyvim/plugins/extras/editor/mini-files.lua @@ -57,7 +57,7 @@ return { vim.api.nvim_create_autocmd("User", { pattern = "MiniFilesActionRename", callback = function(event) - require("lazyvim.util").lsp.on_rename(event.data.from, event.data.to) + LazyVim.lsp.on_rename(event.data.from, event.data.to) end, }) end, diff --git a/lua/lazyvim/plugins/extras/editor/navic.lua b/lua/lazyvim/plugins/extras/editor/navic.lua index 359c42d4..ad31d575 100644 --- a/lua/lazyvim/plugins/extras/editor/navic.lua +++ b/lua/lazyvim/plugins/extras/editor/navic.lua @@ -7,7 +7,7 @@ return { lazy = true, init = function() vim.g.navic_silence = true - require("lazyvim.util").lsp.on_attach(function(client, buffer) + LazyVim.lsp.on_attach(function(client, buffer) if client.supports_method("textDocument/documentSymbol") then require("nvim-navic").attach(client, buffer) end diff --git a/lua/lazyvim/plugins/extras/editor/outline.lua b/lua/lazyvim/plugins/extras/editor/outline.lua index 841bf288..c571d789 100644 --- a/lua/lazyvim/plugins/extras/editor/outline.lua +++ b/lua/lazyvim/plugins/extras/editor/outline.lua @@ -1,5 +1,3 @@ -local Util = require("lazyvim.util") - return { { "hedyhli/outline.nvim", @@ -37,11 +35,11 @@ return { "folke/edgy.nvim", optional = true, opts = function(_, opts) - local edgy_idx = Util.plugin.extra_idx("ui.edgy") - local symbols_idx = Util.plugin.extra_idx("editor.outline") + local edgy_idx = LazyVim.plugin.extra_idx("ui.edgy") + local symbols_idx = LazyVim.plugin.extra_idx("editor.outline") if edgy_idx and edgy_idx > symbols_idx then - Util.warn( + LazyVim.warn( "The `edgy.nvim` extra must be **imported** before the `outline.nvim` extra to work properly.", { title = "LazyVim" } ) diff --git a/lua/lazyvim/plugins/extras/lang/clangd.lua b/lua/lazyvim/plugins/extras/lang/clangd.lua index 08017700..7705360d 100644 --- a/lua/lazyvim/plugins/extras/lang/clangd.lua +++ b/lua/lazyvim/plugins/extras/lang/clangd.lua @@ -85,7 +85,7 @@ return { }, setup = { clangd = function(_, opts) - local clangd_ext_opts = require("lazyvim.util").opts("clangd_extensions.nvim") + local clangd_ext_opts = LazyVim.opts("clangd_extensions.nvim") require("clangd_extensions").setup(vim.tbl_deep_extend("force", clangd_ext_opts or {}, { server = opts })) return false end, diff --git a/lua/lazyvim/plugins/extras/lang/go.lua b/lua/lazyvim/plugins/extras/lang/go.lua index c6b18093..036eab6f 100644 --- a/lua/lazyvim/plugins/extras/lang/go.lua +++ b/lua/lazyvim/plugins/extras/lang/go.lua @@ -61,7 +61,7 @@ return { gopls = function(_, opts) -- workaround for gopls not supporting semanticTokensProvider -- https://github.com/golang/go/issues/54531#issuecomment-1464982242 - require("lazyvim.util").lsp.on_attach(function(client, _) + LazyVim.lsp.on_attach(function(client, _) if client.name == "gopls" then if not client.server_capabilities.semanticTokensProvider then local semantic = client.config.capabilities.textDocument.semanticTokens diff --git a/lua/lazyvim/plugins/extras/lang/helm.lua b/lua/lazyvim/plugins/extras/lang/helm.lua index 8af1b512..3f1fe00d 100644 --- a/lua/lazyvim/plugins/extras/lang/helm.lua +++ b/lua/lazyvim/plugins/extras/lang/helm.lua @@ -1,4 +1,4 @@ -require("lazyvim.util").lsp.on_attach(function(client, buffer) +LazyVim.lsp.on_attach(function(client, buffer) if client.name == "yamlls" then if vim.api.nvim_get_option_value("filetype", { buf = buffer }) == "helm" then vim.schedule(function() diff --git a/lua/lazyvim/plugins/extras/lang/java.lua b/lua/lazyvim/plugins/extras/lang/java.lua index fcc35b07..a3b529b5 100644 --- a/lua/lazyvim/plugins/extras/lang/java.lua +++ b/lua/lazyvim/plugins/extras/lang/java.lua @@ -1,5 +1,3 @@ -local Util = require("lazyvim.util") - -- This is the same as in lspconfig.server_configurations.jdtls, but avoids -- needing to require that when this module loads. local java_filetypes = { "java" } @@ -109,13 +107,13 @@ return { } end, config = function() - local opts = Util.opts("nvim-jdtls") or {} + local opts = LazyVim.opts("nvim-jdtls") or {} -- Find the extra bundles that should be passed on the jdtls command-line -- if nvim-dap is enabled with java debug/test. local mason_registry = require("mason-registry") local bundles = {} ---@type string[] - if opts.dap and Util.has("nvim-dap") and mason_registry.is_installed("java-debug-adapter") then + if opts.dap and LazyVim.has("nvim-dap") and mason_registry.is_installed("java-debug-adapter") then local java_dbg_pkg = mason_registry.get_package("java-debug-adapter") local java_dbg_path = java_dbg_pkg:get_install_path() local jar_patterns = { @@ -196,7 +194,7 @@ return { }, }, { mode = "v", buffer = args.buf }) - if opts.dap and Util.has("nvim-dap") and mason_registry.is_installed("java-debug-adapter") then + if opts.dap and LazyVim.has("nvim-dap") and mason_registry.is_installed("java-debug-adapter") then -- custom init for Java debugger require("jdtls").setup_dap(opts.dap) require("jdtls.dap").setup_dap_main_class_configs(opts.dap_main) diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index f5948903..104b664b 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -43,7 +43,7 @@ return { }, setup = { ruff_lsp = function() - require("lazyvim.util").lsp.on_attach(function(client, _) + LazyVim.lsp.on_attach(function(client, _) if client.name == "ruff_lsp" then -- Disable hover in favor of Pyright client.server_capabilities.hoverProvider = false @@ -89,7 +89,7 @@ return { "linux-cultist/venv-selector.nvim", cmd = "VenvSelect", opts = function(_, opts) - if require("lazyvim.util").has("nvim-dap-python") then + if LazyVim.has("nvim-dap-python") then opts.dap_enabled = true end return vim.tbl_deep_extend("force", opts, { diff --git a/lua/lazyvim/plugins/extras/lang/terraform.lua b/lua/lazyvim/plugins/extras/lang/terraform.lua index faa3c1e1..b199b4f1 100644 --- a/lua/lazyvim/plugins/extras/lang/terraform.lua +++ b/lua/lazyvim/plugins/extras/lang/terraform.lua @@ -1,5 +1,3 @@ -local Util = require("lazyvim.util") - return { { "nvim-treesitter/nvim-treesitter", @@ -58,7 +56,7 @@ return { { "ANGkeith/telescope-terraform-doc.nvim", config = function() - Util.on_load("telescope.nvim", function() + LazyVim.on_load("telescope.nvim", function() require("telescope").load_extension("terraform_doc") end) end, @@ -66,7 +64,7 @@ return { { "cappyzawa/telescope-terraform.nvim", config = function() - Util.on_load("telescope.nvim", function() + LazyVim.on_load("telescope.nvim", function() require("telescope").load_extension("terraform") end) end, diff --git a/lua/lazyvim/plugins/extras/lang/yaml.lua b/lua/lazyvim/plugins/extras/lang/yaml.lua index 5afe1b83..9fd88a3b 100644 --- a/lua/lazyvim/plugins/extras/lang/yaml.lua +++ b/lua/lazyvim/plugins/extras/lang/yaml.lua @@ -64,7 +64,7 @@ return { yamlls = function() -- Neovim < 0.10 does not have dynamic registration for formatting if vim.fn.has("nvim-0.10") == 0 then - require("lazyvim.util").lsp.on_attach(function(client, _) + LazyVim.lsp.on_attach(function(client, _) if client.name == "yamlls" then client.server_capabilities.documentFormattingProvider = true end diff --git a/lua/lazyvim/plugins/extras/lazyrc.lua b/lua/lazyvim/plugins/extras/lazyrc.lua index 4ae88441..24d06b51 100644 --- a/lua/lazyvim/plugins/extras/lazyrc.lua +++ b/lua/lazyvim/plugins/extras/lazyrc.lua @@ -23,11 +23,10 @@ vim.api.nvim_create_autocmd("User", { once = true, callback = function() local Config = require("lazy.core.config") - local Util = require("lazyvim.util") - local lazyrc_idx = Util.plugin.extra_idx("lazyrc") + local lazyrc_idx = LazyVim.plugin.extra_idx("lazyrc") if lazyrc_idx and lazyrc_idx ~= #Config.spec.modules then - Util.warn({ + LazyVim.warn({ "The `lazyrc` extra must be the last plugin spec added to **lazy.nvim**. ", "", "Add `{ import = 'lazyvim.plugins.extras.lazyrc' }` to file `config.lazy`. ", diff --git a/lua/lazyvim/plugins/extras/linting/eslint.lua b/lua/lazyvim/plugins/extras/linting/eslint.lua index a92a2191..df6e79dd 100644 --- a/lua/lazyvim/plugins/extras/linting/eslint.lua +++ b/lua/lazyvim/plugins/extras/linting/eslint.lua @@ -15,10 +15,10 @@ return { setup = { eslint = function() local function get_client(buf) - return require("lazyvim.util").lsp.get_clients({ name = "eslint", bufnr = buf })[1] + return LazyVim.lsp.get_clients({ name = "eslint", bufnr = buf })[1] end - local formatter = require("lazyvim.util").lsp.formatter({ + local formatter = LazyVim.lsp.formatter({ name = "eslint: lsp", primary = false, priority = 200, @@ -44,7 +44,7 @@ return { end -- register the formatter with LazyVim - require("lazyvim.util").format.register(formatter) + LazyVim.format.register(formatter) end, }, }, diff --git a/lua/lazyvim/plugins/extras/lsp/none-ls.lua b/lua/lazyvim/plugins/extras/lsp/none-ls.lua index aa907b8e..40651e2d 100644 --- a/lua/lazyvim/plugins/extras/lsp/none-ls.lua +++ b/lua/lazyvim/plugins/extras/lsp/none-ls.lua @@ -1,5 +1,3 @@ -local Util = require("lazyvim.util") - return { -- none-ls { @@ -7,14 +5,14 @@ return { event = "LazyFile", dependencies = { "mason.nvim" }, init = function() - Util.on_very_lazy(function() + LazyVim.on_very_lazy(function() -- register the formatter with LazyVim - require("lazyvim.util").format.register({ + LazyVim.format.register({ name = "none-ls.nvim", priority = 200, -- set higher than conform, the builtin formatter primary = true, format = function(buf) - return Util.lsp.format({ + return LazyVim.lsp.format({ bufnr = buf, filter = function(client) return client.name == "null-ls" diff --git a/lua/lazyvim/plugins/extras/test/core.lua b/lua/lazyvim/plugins/extras/test/core.lua index 5554b6af..e7dbd792 100644 --- a/lua/lazyvim/plugins/extras/test/core.lua +++ b/lua/lazyvim/plugins/extras/test/core.lua @@ -27,7 +27,7 @@ return { output = { open_on_run = true }, quickfix = { open = function() - if require("lazyvim.util").has("trouble.nvim") then + if LazyVim.has("trouble.nvim") then require("trouble").open({ mode = "quickfix", focus = false }) else vim.cmd("copen") @@ -47,7 +47,7 @@ return { }, }, neotest_ns) - if require("lazyvim.util").has("trouble.nvim") then + if LazyVim.has("trouble.nvim") then opts.consumers = opts.consumers or {} -- Refresh and auto close trouble after running tests ---@type neotest.Consumer diff --git a/lua/lazyvim/plugins/extras/util/gitui.lua b/lua/lazyvim/plugins/extras/util/gitui.lua index 5c519ba4..53869c33 100644 --- a/lua/lazyvim/plugins/extras/util/gitui.lua +++ b/lua/lazyvim/plugins/extras/util/gitui.lua @@ -6,12 +6,12 @@ return { keys = { { "gG", function() - require("lazyvim.util").terminal.open({ "gitui" }, { esc_esc = false, ctrl_hjkl = false }) + LazyVim.terminal.open({ "gitui" }, { esc_esc = false, ctrl_hjkl = false }) end, desc = "gitui (cwd)" }, { "gg", function() - require("lazyvim.util").terminal.open({ "gitui" }, { cwd = require("lazyvim.util").root.get(), esc_esc = false, ctrl_hjkl = false }) + LazyVim.terminal.open({ "gitui" }, { cwd = LazyVim.root.get(), esc_esc = false, ctrl_hjkl = false }) end, desc = "gitui (root dir)" } }, diff --git a/lua/lazyvim/plugins/extras/util/project.lua b/lua/lazyvim/plugins/extras/util/project.lua index 3936c96a..16e72077 100644 --- a/lua/lazyvim/plugins/extras/util/project.lua +++ b/lua/lazyvim/plugins/extras/util/project.lua @@ -11,7 +11,7 @@ return { event = "VeryLazy", config = function(_, opts) require("project_nvim").setup(opts) - require("lazyvim.util").on_load("telescope.nvim", function() + LazyVim.on_load("telescope.nvim", function() require("telescope").load_extension("projects") end) end, diff --git a/lua/lazyvim/plugins/formatting.lua b/lua/lazyvim/plugins/formatting.lua index d1c9a34c..718cb0f9 100644 --- a/lua/lazyvim/plugins/formatting.lua +++ b/lua/lazyvim/plugins/formatting.lua @@ -1,5 +1,3 @@ -local Util = require("lazyvim.util") - local M = {} ---@param opts ConformOpts @@ -10,14 +8,17 @@ function M.setup(_, opts) if formatter.extra_args then ---@diagnostic disable-next-line: undefined-field formatter.prepend_args = formatter.extra_args - Util.deprecate(("opts.formatters.%s.extra_args"):format(name), ("opts.formatters.%s.prepend_args"):format(name)) + LazyVim.deprecate( + ("opts.formatters.%s.extra_args"):format(name), + ("opts.formatters.%s.prepend_args"):format(name) + ) end end end for _, key in ipairs({ "format_on_save", "format_after_save" }) do if opts[key] then - Util.warn( + LazyVim.warn( ("Don't set `opts.%s` for `conform.nvim`.\n**LazyVim** will use the conform formatter automatically"):format( key ) @@ -47,8 +48,8 @@ return { }, init = function() -- Install the conform formatter on VeryLazy - require("lazyvim.util").on_very_lazy(function() - require("lazyvim.util").format.register({ + LazyVim.on_very_lazy(function() + LazyVim.format.register({ name = "conform.nvim", priority = 100, primary = true, @@ -56,7 +57,7 @@ return { local plugin = require("lazy.core.config").plugins["conform.nvim"] local Plugin = require("lazy.core.plugin") local opts = Plugin.values(plugin, "opts", false) - require("conform").format(Util.merge({}, opts.format, { bufnr = buf })) + require("conform").format(LazyVim.merge({}, opts.format, { bufnr = buf })) end, sources = function(buf) local ret = require("conform").list_formatters(buf) @@ -71,7 +72,7 @@ return { opts = function() local plugin = require("lazy.core.config").plugins["conform.nvim"] if plugin.config ~= M.setup then - Util.error({ + LazyVim.error({ "Don't set `plugin.config` for `conform.nvim`.\n", "This will break **LazyVim** formatting.\n", "Please refer to the docs at https://www.lazyvim.org/plugins/formatting", diff --git a/lua/lazyvim/plugins/linting.lua b/lua/lazyvim/plugins/linting.lua index b9b83165..caeaf6ec 100644 --- a/lua/lazyvim/plugins/linting.lua +++ b/lua/lazyvim/plugins/linting.lua @@ -27,8 +27,6 @@ return { }, }, config = function(_, opts) - local Util = require("lazyvim.util") - local M = {} local lint = require("lint") @@ -73,7 +71,7 @@ return { names = vim.tbl_filter(function(name) local linter = lint.linters[name] if not linter then - Util.warn("Linter not found: " .. name, { title = "nvim-lint" }) + LazyVim.warn("Linter not found: " .. name, { title = "nvim-lint" }) end return linter and not (type(linter) == "table" and linter.condition and not linter.condition(ctx)) end, names) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 86f9d7e4..f353e28b 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -1,5 +1,3 @@ -local Util = require("lazyvim.util") - return { -- lspconfig { @@ -95,22 +93,22 @@ return { }, ---@param opts PluginLspOpts config = function(_, opts) - if Util.has("neoconf.nvim") then + if LazyVim.has("neoconf.nvim") then local plugin = require("lazy.core.config").spec.plugins["neoconf.nvim"] require("neoconf").setup(require("lazy.core.plugin").values(plugin, "opts", false)) end -- setup autoformat - Util.format.register(Util.lsp.formatter()) + LazyVim.format.register(LazyVim.lsp.formatter()) -- deprecated options if opts.autoformat ~= nil then vim.g.autoformat = opts.autoformat - Util.deprecate("nvim-lspconfig.opts.autoformat", "vim.g.autoformat") + LazyVim.deprecate("nvim-lspconfig.opts.autoformat", "vim.g.autoformat") end -- setup keymaps - Util.lsp.on_attach(function(client, buffer) + LazyVim.lsp.on_attach(function(client, buffer) require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer) end) @@ -134,16 +132,16 @@ return { -- inlay hints if opts.inlay_hints.enabled then - Util.lsp.on_attach(function(client, buffer) + LazyVim.lsp.on_attach(function(client, buffer) if client.supports_method("textDocument/inlayHint") then - Util.toggle.inlay_hints(buffer, true) + LazyVim.toggle.inlay_hints(buffer, true) end end) end -- code lens if opts.codelens.enabled and vim.lsp.codelens then - Util.lsp.on_attach(function(client, buffer) + LazyVim.lsp.on_attach(function(client, buffer) if client.supports_method("textDocument/codeLens") then vim.lsp.codelens.refresh() --- autocmd BufEnter,CursorHold,InsertLeave lua vim.lsp.codelens.refresh() @@ -220,10 +218,10 @@ return { mlsp.setup({ ensure_installed = ensure_installed, handlers = { setup } }) end - if Util.lsp.get_config("denols") and Util.lsp.get_config("tsserver") then + if LazyVim.lsp.get_config("denols") and LazyVim.lsp.get_config("tsserver") then local is_deno = require("lspconfig.util").root_pattern("deno.json", "deno.jsonc") - Util.lsp.disable("tsserver", is_deno) - Util.lsp.disable("denols", function(root_dir) + LazyVim.lsp.disable("tsserver", is_deno) + LazyVim.lsp.disable("denols", function(root_dir) return not is_deno(root_dir) end) end diff --git a/lua/lazyvim/plugins/lsp/keymaps.lua b/lua/lazyvim/plugins/lsp/keymaps.lua index 3e8976bb..0f5aecb7 100644 --- a/lua/lazyvim/plugins/lsp/keymaps.lua +++ b/lua/lazyvim/plugins/lsp/keymaps.lua @@ -41,7 +41,7 @@ function M.get() has = "codeAction", } } - if require("lazyvim.util").has("inc-rename.nvim") then + if LazyVim.has("inc-rename.nvim") then M._keys[#M._keys + 1] = { "cr", function() @@ -61,7 +61,7 @@ end ---@param method string function M.has(buffer, method) method = method:find("/") and method or "textDocument/" .. method - local clients = require("lazyvim.util").lsp.get_clients({ bufnr = buffer }) + local clients = LazyVim.lsp.get_clients({ bufnr = buffer }) for _, client in ipairs(clients) do if client.supports_method(method) then return true @@ -77,8 +77,8 @@ function M.resolve(buffer) return {} end local spec = M.get() - local opts = require("lazyvim.util").opts("nvim-lspconfig") - local clients = require("lazyvim.util").lsp.get_clients({ bufnr = buffer }) + local opts = LazyVim.opts("nvim-lspconfig") + local clients = LazyVim.lsp.get_clients({ bufnr = buffer }) for _, client in ipairs(clients) do local maps = opts.servers[client.name] and opts.servers[client.name].keys or {} vim.list_extend(spec, maps) diff --git a/lua/lazyvim/plugins/treesitter.lua b/lua/lazyvim/plugins/treesitter.lua index 7e4dd40a..30130dc6 100644 --- a/lua/lazyvim/plugins/treesitter.lua +++ b/lua/lazyvim/plugins/treesitter.lua @@ -124,13 +124,12 @@ return { { "ut", function() - local Util = require("lazyvim.util") local tsc = require("treesitter-context") tsc.toggle() - if Util.inject.get_upvalue(tsc.toggle, "enabled") then - Util.info("Enabled Treesitter Context", { title = "Option" }) + if LazyVim.inject.get_upvalue(tsc.toggle, "enabled") then + LazyVim.info("Enabled Treesitter Context", { title = "Option" }) else - Util.warn("Disabled Treesitter Context", { title = "Option" }) + LazyVim.warn("Disabled Treesitter Context", { title = "Option" }) end end, desc = "Toggle Treesitter Context", diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 2a5e5e3e..d77b3293 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -1,5 +1,3 @@ -local Util = require("lazyvim.util") - return { -- Better `vim.notify()` { @@ -27,8 +25,8 @@ return { }, init = function() -- when noice is not enabled, install notify on VeryLazy - if not Util.has("noice.nvim") then - Util.on_very_lazy(function() + if not LazyVim.has("noice.nvim") then + LazyVim.on_very_lazy(function() vim.notify = require("notify") end) end @@ -140,7 +138,7 @@ return { lualine_b = { "branch" }, lualine_c = { - Util.lualine.root_dir(), + LazyVim.lualine.root_dir(), { "diagnostics", symbols = { @@ -151,31 +149,31 @@ return { }, }, { "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } }, - { Util.lualine.pretty_path() }, + { LazyVim.lualine.pretty_path() }, }, lualine_x = { -- stylua: ignore { function() return require("noice").api.status.command.get() end, cond = function() return package.loaded["noice"] and require("noice").api.status.command.has() end, - color = Util.ui.fg("Statement"), + color = LazyVim.ui.fg("Statement"), }, -- stylua: ignore { function() return require("noice").api.status.mode.get() end, cond = function() return package.loaded["noice"] and require("noice").api.status.mode.has() end, - color = Util.ui.fg("Constant"), + color = LazyVim.ui.fg("Constant"), }, -- stylua: ignore { function() return " " .. require("dap").status() end, cond = function () return package.loaded["dap"] and require("dap").status() ~= "" end, - color = Util.ui.fg("Debug"), + color = LazyVim.ui.fg("Debug"), }, { require("lazy.status").updates, cond = require("lazy.status").has_updates, - color = Util.ui.fg("Special"), + color = LazyVim.ui.fg("Special"), }, { "diff", @@ -278,7 +276,7 @@ return { { "folke/which-key.nvim", opts = function(_, opts) - if require("lazyvim.util").has("noice.nvim") then + if LazyVim.has("noice.nvim") then opts.defaults["sn"] = { name = "+noice" } end end, @@ -338,7 +336,7 @@ return { "goolord/alpha-nvim", optional = true, enabled = function() - require("lazyvim.util").warn({ + LazyVim.warn({ "`dashboard.nvim` is now the default LazyVim starter plugin.", "", "To keep using `alpha.nvim`, please enable the `lazyvim.plugins.extras.ui.alpha` extra.", @@ -373,11 +371,11 @@ return { header = vim.split(logo, "\n"), -- stylua: ignore center = { - { action = Util.telescope("files"), desc = " Find file", icon = " ", key = "f" }, + { action = LazyVim.telescope("files"), desc = " Find file", icon = " ", key = "f" }, { action = "ene | startinsert", desc = " New file", icon = " ", key = "n" }, { action = "Telescope oldfiles", desc = " Recent files", icon = " ", key = "r" }, { action = "Telescope live_grep", desc = " Find text", icon = " ", key = "g" }, - { action = [[lua require("lazyvim.util").telescope.config_files()()]], desc = " Config", icon = " ", key = "c" }, + { action = [[lua LazyVim.telescope.config_files()()]], desc = " Config", icon = " ", key = "c" }, { action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" }, { action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" }, { action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" }, diff --git a/lua/lazyvim/util/extras.lua b/lua/lazyvim/util/extras.lua index a75c8413..74ab4b4c 100644 --- a/lua/lazyvim/util/extras.lua +++ b/lua/lazyvim/util/extras.lua @@ -3,7 +3,6 @@ local Float = require("lazy.view.float") local LazyConfig = require("lazy.core.config") local Plugin = require("lazy.core.plugin") local Text = require("lazy.view.text") -local Util = require("lazyvim.util") ---@class LazyExtraSource ---@field name string @@ -39,9 +38,9 @@ function M.get() M.state = M.state or LazyConfig.spec.modules local extras = {} ---@type LazyExtra[] for _, source in ipairs(M.sources) do - local root = Util.find_root(source.module) + local root = LazyVim.find_root(source.module) if root then - Util.walk(root, function(path, name, type) + LazyVim.walk(root, function(path, name, type) if (type == "file" or type == "link") and name:match("%.lua$") then name = path:sub(#root + 2, -5):gsub("/", ".") local ok, extra = pcall(M.get_extra, source, source.module .. "." .. name) @@ -119,7 +118,7 @@ function X:toggle() for _, extra in ipairs(self.extras) do if extra.row == pos[1] then if not extra.managed then - Util.error( + LazyVim.error( "Not managed by LazyExtras. Remove from your config to enable/disable here.", { title = "LazyExtras" } ) @@ -137,8 +136,8 @@ function X:toggle() M.state[#M.state + 1] = extra.module end table.sort(Config.json.data.extras) - Util.json.save() - Util.info( + LazyVim.json.save() + LazyVim.info( "`" .. extra.name .. "`" diff --git a/lua/lazyvim/util/format.lua b/lua/lazyvim/util/format.lua index fa972296..e6325538 100644 --- a/lua/lazyvim/util/format.lua +++ b/lua/lazyvim/util/format.lua @@ -1,5 +1,3 @@ -local Util = require("lazyvim.util") - ---@class lazyvim.util.format ---@overload fun(opts?: {force?:boolean}) local M = setmetatable({}, { @@ -26,7 +24,7 @@ function M.register(formatter) end function M.formatexpr() - if Util.has("conform.nvim") then + if LazyVim.has("conform.nvim") then return require("conform").formatexpr() end return vim.lsp.formatexpr({ timeout_ms = 3000 }) @@ -76,7 +74,7 @@ function M.info(buf) if not have then lines[#lines + 1] = "\n***No formatters available for this buffer.***" end - Util[enabled and "info" or "warn"]( + LazyVim[enabled and "info" or "warn"]( table.concat(lines, "\n"), { title = "LazyFormat (" .. (enabled and "enabled" or "disabled") .. ")" } ) @@ -120,14 +118,14 @@ function M.format(opts) for _, formatter in ipairs(M.resolve(buf)) do if formatter.active then done = true - Util.try(function() + LazyVim.try(function() return formatter.format(buf) end, { msg = "Formatter `" .. formatter.name .. "` failed" }) end end if not done and opts and opts.force then - Util.warn("No formatter available", { title = "LazyVim" }) + LazyVim.warn("No formatter available", { title = "LazyVim" }) end end @@ -136,7 +134,7 @@ function M.health() local has_plugin = Config.spec.plugins["none-ls.nvim"] local has_extra = vim.tbl_contains(Config.spec.modules, "lazyvim.plugins.extras.lsp.none-ls") if has_plugin and not has_extra then - Util.warn({ + LazyVim.warn({ "`conform.nvim` and `nvim-lint` are now the default formatters and linters in LazyVim.", "", "You can use those plugins together with `none-ls.nvim`,", diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index 54c8706c..4de0d3e7 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -38,7 +38,7 @@ setmetatable(M, { if dep then local mod = type(dep) == "table" and dep[1] or dep local key = type(dep) == "table" and dep[2] or k - M.deprecate([[require("lazyvim.util").]] .. k, [[require("lazyvim.util").]] .. mod .. "." .. key) + M.deprecate([[LazyVim.]] .. k, [[LazyVim.]] .. mod .. "." .. key) ---@diagnostic disable-next-line: no-unknown t[mod] = require("lazyvim.util." .. mod) -- load here to prevent loops return t[mod][key] diff --git a/lua/lazyvim/util/json.lua b/lua/lazyvim/util/json.lua index 83aee5a3..3df7aecd 100644 --- a/lua/lazyvim/util/json.lua +++ b/lua/lazyvim/util/json.lua @@ -1,5 +1,4 @@ local Config = require("lazyvim.config") -local Util = require("lazyvim.util") ---@class lazyvim.util.json local M = {} @@ -14,7 +13,7 @@ local function encode(value, indent) elseif t == "number" or t == "boolean" then return tostring(value) elseif t == "table" then - local is_list = Util.is_list(value) + local is_list = LazyVim.is_list(value) local parts = {} local next_indent = indent .. " " @@ -51,13 +50,13 @@ function M.save() local path = vim.fn.stdpath("config") .. "/lazyvim.json" local f = io.open(path, "w") if f then - f:write(Util.json.encode(Config.json.data)) + f:write(LazyVim.json.encode(Config.json.data)) f:close() end end function M.migrate() - Util.info("Migrating `lazyvim.json` to version `" .. Config.json.version .. "`") + LazyVim.info("Migrating `lazyvim.json` to version `" .. Config.json.version .. "`") local json = Config.json -- v0 diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index d9ef04e6..e712120a 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -1,5 +1,3 @@ -local Util = require("lazyvim.util") - ---@class lazyvim.util.lsp local M = {} @@ -87,10 +85,10 @@ function M.formatter(opts) primary = true, priority = 1, format = function(buf) - M.format(Util.merge({}, filter, { bufnr = buf })) + M.format(LazyVim.merge({}, filter, { bufnr = buf })) end, sources = function(buf) - local clients = M.get_clients(Util.merge({}, filter, { bufnr = buf })) + local clients = M.get_clients(LazyVim.merge({}, filter, { bufnr = buf })) ---@param client lsp.Client local ret = vim.tbl_filter(function(client) return client.supports_method("textDocument/formatting") @@ -102,7 +100,7 @@ function M.formatter(opts) end, ret) end, } - return Util.merge(ret, opts) --[[@as LazyFormatter]] + return LazyVim.merge(ret, opts) --[[@as LazyFormatter]] end ---@alias lsp.Client.format {timeout_ms?: number, format_options?: table} | lsp.Client.filter @@ -113,8 +111,8 @@ function M.format(opts) "force", {}, opts or {}, - require("lazyvim.util").opts("nvim-lspconfig").format or {}, - require("lazyvim.util").opts("conform.nvim").format or {} + LazyVim.opts("nvim-lspconfig").format or {}, + LazyVim.opts("conform.nvim").format or {} ) local ok, conform = pcall(require, "conform") -- use conform for formatting with LSP when available, diff --git a/lua/lazyvim/util/lualine.lua b/lua/lazyvim/util/lualine.lua index b4ffd633..db4600f4 100644 --- a/lua/lazyvim/util/lualine.lua +++ b/lua/lazyvim/util/lualine.lua @@ -1,5 +1,3 @@ -local Util = require("lazyvim.util") - ---@class lazyvim.util.lualine local M = {} @@ -25,9 +23,9 @@ function M.cmp_source(name, icon) end local colors = { - ok = Util.ui.fg("Special"), - error = Util.ui.fg("DiagnosticError"), - pending = Util.ui.fg("DiagnosticWarn"), + ok = LazyVim.ui.fg("Special"), + error = LazyVim.ui.fg("DiagnosticError"), + pending = LazyVim.ui.fg("DiagnosticWarn"), } return { @@ -90,8 +88,8 @@ function M.pretty_path(opts) return "" end - local root = Util.root.get({ normalize = true }) - local cwd = Util.root.cwd() + local root = LazyVim.root.get({ normalize = true }) + local cwd = LazyVim.root.cwd() if opts.relative == "cwd" and path:find(cwd, 1, true) == 1 then path = path:sub(#cwd + 2) @@ -130,12 +128,12 @@ function M.root_dir(opts) parent = true, other = true, icon = "󱉭 ", - color = Util.ui.fg("Special"), + color = LazyVim.ui.fg("Special"), }, opts or {}) local function get() - local cwd = Util.root.cwd() - local root = Util.root.get({ normalize = true }) + local cwd = LazyVim.root.cwd() + local root = LazyVim.root.get({ normalize = true }) local name = vim.fs.basename(root) if root == cwd then diff --git a/lua/lazyvim/util/news.lua b/lua/lazyvim/util/news.lua index ae71e67c..5434649a 100644 --- a/lua/lazyvim/util/news.lua +++ b/lua/lazyvim/util/news.lua @@ -1,5 +1,4 @@ local Config = require("lazyvim.config") -local Util = require("lazyvim.util") ---@class lazyvim.util.news local M = {} @@ -27,7 +26,7 @@ function M.setup() end function M.welcome() - Util.info("Welcome to LazyVim!") + LazyVim.info("Welcome to LazyVim!") end function M.changelog() @@ -50,7 +49,7 @@ function M.open(file, opts) if opts.plugin then local plugin = require("lazy.core.config").plugins[opts.plugin] --[[@as LazyPlugin?]] if not plugin then - return Util.error("plugin not found: " .. opts.plugin) + return LazyVim.error("plugin not found: " .. opts.plugin) end file = plugin.dir .. "/" .. file elseif opts.rtp then @@ -58,7 +57,7 @@ function M.open(file, opts) end if not file then - return Util.error("File not found") + return LazyVim.error("File not found") end if opts.when_changed then @@ -68,7 +67,7 @@ function M.open(file, opts) return end Config.json.data.news[ref] = hash - Util.json.save() + LazyVim.json.save() -- don't open if file has never been opened if is_new then return diff --git a/lua/lazyvim/util/plugin.lua b/lua/lazyvim/util/plugin.lua index 7ab69134..a8e784b6 100644 --- a/lua/lazyvim/util/plugin.lua +++ b/lua/lazyvim/util/plugin.lua @@ -1,5 +1,4 @@ local Plugin = require("lazy.core.plugin") -local Util = require("lazyvim.util") ---@class lazyvim.util.plugin local M = {} @@ -35,7 +34,7 @@ function M.setup() M.lazy_file() table.insert(package.loaders, function(module) if M.deprecated_modules[module] then - Util.warn( + LazyVim.warn( ("`%s` is no longer included by default in **LazyVim**.\nPlease install the `%s` extra if you still want to use it."):format( module, M.deprecated_modules[module] @@ -125,21 +124,21 @@ function M.lazy_file() end function M.fix_imports() - Plugin.Spec.import = Util.inject.args(Plugin.Spec.import, function(_, spec) + Plugin.Spec.import = LazyVim.inject.args(Plugin.Spec.import, function(_, spec) local dep = M.deprecated_extras[spec and spec.import] if dep then dep = dep .. "\n" .. "Please remove the extra to hide this warning." - Util.warn(dep, { title = "LazyVim", once = true, stacktrace = true, stacklevel = 6 }) + LazyVim.warn(dep, { title = "LazyVim", once = true, stacktrace = true, stacklevel = 6 }) return false end end) end function M.fix_renames() - Plugin.Spec.add = Util.inject.args(Plugin.Spec.add, function(self, plugin) + Plugin.Spec.add = LazyVim.inject.args(Plugin.Spec.add, function(self, plugin) if type(plugin) == "table" then if M.renames[plugin[1]] then - Util.warn( + LazyVim.warn( ("Plugin `%s` was renamed to `%s`.\nPlease update your config for `%s`"):format( plugin[1], M.renames[plugin[1]], diff --git a/lua/lazyvim/util/root.lua b/lua/lazyvim/util/root.lua index e4bdeab1..4143206c 100644 --- a/lua/lazyvim/util/root.lua +++ b/lua/lazyvim/util/root.lua @@ -1,5 +1,3 @@ -local Util = require("lazyvim.util") - ---@class lazyvim.util.root ---@overload fun(): string local M = setmetatable({}, { @@ -31,7 +29,7 @@ function M.detectors.lsp(buf) return {} end local roots = {} ---@type string[] - for _, client in pairs(Util.lsp.get_clients({ bufnr = buf })) do + for _, client in pairs(LazyVim.lsp.get_clients({ bufnr = buf })) do -- only check workspace folders, since we're not interested in clients -- running in single file mode local workspace = client.config.workspace_folders @@ -40,7 +38,7 @@ function M.detectors.lsp(buf) end end return vim.tbl_filter(function(path) - path = Util.norm(path) + path = LazyVim.norm(path) return path and bufpath:find(path, 1, true) == 1 end, roots) end @@ -66,7 +64,7 @@ function M.realpath(path) return nil end path = vim.uv.fs_realpath(path) or path - return Util.norm(path) + return LazyVim.norm(path) end ---@param spec LazyRootSpec @@ -132,7 +130,7 @@ function M.info() lines[#lines + 1] = "```lua" lines[#lines + 1] = "vim.g.root_spec = " .. vim.inspect(spec) lines[#lines + 1] = "```" - require("lazyvim.util").info(lines, { title = "LazyVim Roots" }) + LazyVim.info(lines, { title = "LazyVim Roots" }) return roots[1] and roots[1].paths[1] or vim.uv.cwd() end @@ -141,7 +139,7 @@ M.cache = {} function M.setup() vim.api.nvim_create_user_command("LazyRoot", function() - Util.root.info() + LazyVim.root.info() end, { desc = "LazyVim roots for the current buffer" }) vim.api.nvim_create_autocmd({ "LspAttach", "BufWritePost", "DirChanged" }, { @@ -170,7 +168,7 @@ function M.get(opts) if opts and opts.normalize then return ret end - return Util.is_win() and ret:gsub("/", "\\") or ret + return LazyVim.is_win() and ret:gsub("/", "\\") or ret end function M.git() diff --git a/lua/lazyvim/util/telescope.lua b/lua/lazyvim/util/telescope.lua index 86dc02f0..641c751a 100644 --- a/lua/lazyvim/util/telescope.lua +++ b/lua/lazyvim/util/telescope.lua @@ -1,5 +1,3 @@ -local Util = require("lazyvim.util") - ---@class lazyvim.util.telescope.opts ---@field cwd? string|boolean ---@field show_untracked? boolean @@ -22,7 +20,7 @@ function M.telescope(builtin, opts) return function() builtin = params.builtin opts = params.opts - opts = vim.tbl_deep_extend("force", { cwd = Util.root() }, opts or {}) --[[@as lazyvim.util.telescope.opts]] + opts = vim.tbl_deep_extend("force", { cwd = LazyVim.root() }, opts or {}) --[[@as lazyvim.util.telescope.opts]] if builtin == "files" then if vim.uv.fs_stat((opts.cwd or vim.uv.cwd()) .. "/.git") @@ -59,7 +57,7 @@ function M.telescope(builtin, opts) end function M.config_files() - return Util.telescope("find_files", { cwd = vim.fn.stdpath("config") }) + return LazyVim.telescope("find_files", { cwd = vim.fn.stdpath("config") }) end return M diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index 409556d1..cb380d0d 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -1,5 +1,3 @@ -local Util = require("lazyvim.util") - ---@class lazyvim.util.toggle local M = {} @@ -14,15 +12,15 @@ function M.option(option, silent, values) ---@diagnostic disable-next-line: no-unknown vim.opt_local[option] = values[1] end - return Util.info("Set " .. option .. " to " .. vim.opt_local[option]:get(), { title = "Option" }) + return LazyVim.info("Set " .. option .. " to " .. vim.opt_local[option]:get(), { title = "Option" }) end ---@diagnostic disable-next-line: no-unknown vim.opt_local[option] = not vim.opt_local[option]:get() if not silent then if vim.opt_local[option]:get() then - Util.info("Enabled " .. option, { title = "Option" }) + LazyVim.info("Enabled " .. option, { title = "Option" }) else - Util.warn("Disabled " .. option, { title = "Option" }) + LazyVim.warn("Disabled " .. option, { title = "Option" }) end end end @@ -33,11 +31,11 @@ function M.number() nu = { number = vim.opt_local.number:get(), relativenumber = vim.opt_local.relativenumber:get() } vim.opt_local.number = false vim.opt_local.relativenumber = false - Util.warn("Disabled line numbers", { title = "Option" }) + LazyVim.warn("Disabled line numbers", { title = "Option" }) else vim.opt_local.number = nu.number vim.opt_local.relativenumber = nu.relativenumber - Util.info("Enabled line numbers", { title = "Option" }) + LazyVim.info("Enabled line numbers", { title = "Option" }) end end @@ -52,10 +50,10 @@ function M.diagnostics() if enabled then vim.diagnostic.enable() - Util.info("Enabled diagnostics", { title = "Diagnostics" }) + LazyVim.info("Enabled diagnostics", { title = "Diagnostics" }) else vim.diagnostic.disable() - Util.warn("Disabled diagnostics", { title = "Diagnostics" }) + LazyVim.warn("Disabled diagnostics", { title = "Diagnostics" }) end end From 3d4ab4eb2634c9280676a7efdfb2753e5b2f8536 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 22 Mar 2024 09:49:07 +0100 Subject: [PATCH 124/526] feat(lazyterm): optional shell setup, mainly for pwsh. Fixes #2151 --- lua/lazyvim/config/options.lua | 6 ++++++ lua/lazyvim/util/terminal.lua | 31 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/lua/lazyvim/config/options.lua b/lua/lazyvim/config/options.lua index a9b3bec8..bd43e123 100644 --- a/lua/lazyvim/config/options.lua +++ b/lua/lazyvim/config/options.lua @@ -12,6 +12,12 @@ vim.g.autoformat = true -- * a function with signature `function(buf) -> string|string[]` vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" } +-- Optionally setup the terminal to use +-- This sets `vim.o.shell` and does some additional configuration for: +-- * pwsh +-- * powershell +-- LazyVim.terminal.setup("pwsh") + local opt = vim.opt opt.autowrite = true -- Enable auto write diff --git a/lua/lazyvim/util/terminal.lua b/lua/lazyvim/util/terminal.lua index 7787615b..c61c3664 100644 --- a/lua/lazyvim/util/terminal.lua +++ b/lua/lazyvim/util/terminal.lua @@ -9,6 +9,37 @@ local M = setmetatable({}, { ---@type table local terminals = {} +---@param shell? string +function M.setup(shell) + vim.o.shell = shell or vim.o.shell + + -- Special handling for pwsh + if shell == "pwsh" or shell == "powershell" then + -- Check if 'pwsh' is executable and set the shell accordingly + if vim.fn.executable("pwsh") == 1 then + vim.o.shell = "pwsh" + elseif vim.fn.executable("powershell") == 1 then + vim.o.shell = "powershell" + else + return LazyVim.error("No powershell executable found") + end + + -- Setting shell command flags + vim.o.shellcmdflag = + "-NoLogo -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.UTF8Encoding]::new();$PSDefaultParameterValues['Out-File:Encoding']='utf8';" + + -- Setting shell redirection + vim.o.shellredir = '2>&1 | %{ "$_" } | Out-File %s; exit $LastExitCode' + + -- Setting shell pipe + vim.o.shellpipe = '2>&1 | %{ "$_" } | Tee-Object %s; exit $LastExitCode' + + -- Setting shell quote options + vim.o.shellquote = "" + vim.o.shellxquote = "" + end +end + ---@class LazyTermOpts: LazyCmdOptions ---@field interactive? boolean ---@field esc_esc? boolean From 8d31bf230cf9ad872ad50251d405ed628c9e69ae Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 22 Mar 2024 09:54:24 +0100 Subject: [PATCH 125/526] fix(java): dont error when not using cmp. Fixes #2038 --- lua/lazyvim/plugins/extras/lang/java.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/java.lua b/lua/lazyvim/plugins/extras/lang/java.lua index a3b529b5..75b0805b 100644 --- a/lua/lazyvim/plugins/extras/lang/java.lua +++ b/lua/lazyvim/plugins/extras/lang/java.lua @@ -145,7 +145,7 @@ return { bundles = bundles, }, -- enable CMP capabilities - capabilities = require("cmp_nvim_lsp").default_capabilities(), + capabilities = LazyVim.has("cmp-nvim-lsp") and require("cmp_nvim_lsp").default_capabilities() or nil, }, opts.jdtls) -- Existing server will be reused if the root_dir matches. From 1c13a5c10b745f741ebbb08d3963862e9d4e307e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 22 Mar 2024 10:00:22 +0100 Subject: [PATCH 126/526] feat(telescope-fzf-native): added support for building with cmake. Fixes #2132 --- lua/lazyvim/plugins/editor.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 73063a57..6a934d9f 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -124,8 +124,9 @@ return { dependencies = { { "nvim-telescope/telescope-fzf-native.nvim", - build = "make", - enabled = vim.fn.executable("make") == 1, + build = vim.fn.executable("make") == 1 and "make" + or "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build", + enabled = vim.fn.executable("make") == 1 or vim.fn.executable("cmake") == 1, config = function() LazyVim.on_load("telescope.nvim", function() require("telescope").load_extension("fzf") From 69aedc265724c71711753333e3b7506fbeab78ef Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 22 Mar 2024 10:23:09 +0100 Subject: [PATCH 127/526] fix(cmake): lazy load cmake-tools. Fixes #2767 --- lua/lazyvim/plugins/extras/lang/cmake.lua | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/cmake.lua b/lua/lazyvim/plugins/extras/lang/cmake.lua index e95dbfdd..401669a3 100644 --- a/lua/lazyvim/plugins/extras/lang/cmake.lua +++ b/lua/lazyvim/plugins/extras/lang/cmake.lua @@ -43,7 +43,25 @@ return { }, { "Civitasv/cmake-tools.nvim", + lazy = true, + init = function() + local loaded = false + local function check() + local cwd = vim.uv.cwd() + if vim.fn.filereadable(cwd .. "/CMakeLists.txt") == 1 then + require("lazy").load({ plugins = { "cmake-tools.nvim" } }) + loaded = true + end + end + check() + vim.api.nvim_create_autocmd("DirChanged", { + callback = function() + if not loaded then + check() + end + end, + }) + end, opts = {}, - event = "LazyFile", }, } From 4b8fe44c08610be7a0603d84ae03ca81a98cbeee Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 22 Mar 2024 10:30:35 +0100 Subject: [PATCH 128/526] fix: add shim for vim.uv just in case someone upgrades lazyvim before lazy --- lua/lazyvim/init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/lazyvim/init.lua b/lua/lazyvim/init.lua index dceae58d..a7287aa2 100644 --- a/lua/lazyvim/init.lua +++ b/lua/lazyvim/init.lua @@ -1,3 +1,5 @@ +vim.uv = vim.uv or vim.loop + local M = {} ---@param opts? LazyVimConfig From c91982a8bca120857f24f0eb0dd9bdcc7d574f50 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 22 Mar 2024 10:33:16 +0100 Subject: [PATCH 129/526] chore(main): release 10.16.0 (#2791) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 21 +++++++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c5ad27d..e7b3e1ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Changelog +## [10.16.0](https://github.com/LazyVim/LazyVim/compare/v10.15.0...v10.16.0) (2024-03-22) + + +### Features + +* added LazyVim global. Will refactor specs later to use that ([6e57e86](https://github.com/LazyVim/LazyVim/commit/6e57e86c9952986a0e90055e13aa86dcde5e478e)) +* **lazyterm:** optional shell setup, mainly for pwsh. Fixes [#2151](https://github.com/LazyVim/LazyVim/issues/2151) ([3d4ab4e](https://github.com/LazyVim/LazyVim/commit/3d4ab4eb2634c9280676a7efdfb2753e5b2f8536)) +* **telescope-fzf-native:** added support for building with cmake. Fixes [#2132](https://github.com/LazyVim/LazyVim/issues/2132) ([1c13a5c](https://github.com/LazyVim/LazyVim/commit/1c13a5c10b745f741ebbb08d3963862e9d4e307e)) +* use `vim.uv` everywhere instead of `vim.loop` ([3a87c08](https://github.com/LazyVim/LazyVim/commit/3a87c08cdadb23ae88bd6eb193e8392e986df6bb)) +* use LazyVim everywhere instead of `require("lazyvim.util")` ([7a5dbea](https://github.com/LazyVim/LazyVim/commit/7a5dbeae75b553b489af8074e9a87207edf1395c)) + + +### Bug Fixes + +* add shim for vim.uv just in case someone upgrades lazyvim before lazy ([4b8fe44](https://github.com/LazyVim/LazyVim/commit/4b8fe44c08610be7a0603d84ae03ca81a98cbeee)) +* **cmake:** lazy load cmake-tools. Fixes [#2767](https://github.com/LazyVim/LazyVim/issues/2767) ([69aedc2](https://github.com/LazyVim/LazyVim/commit/69aedc265724c71711753333e3b7506fbeab78ef)) +* **format:** Don't leak bufnr into opts tables ([#2794](https://github.com/LazyVim/LazyVim/issues/2794)) ([213493e](https://github.com/LazyVim/LazyVim/commit/213493e766df7a5405050205f6050ff24e5a2d6d)) +* **java:** dont error when not using cmp. Fixes [#2038](https://github.com/LazyVim/LazyVim/issues/2038) ([8d31bf2](https://github.com/LazyVim/LazyVim/commit/8d31bf230cf9ad872ad50251d405ed628c9e69ae)) +* **python:** basedpyright is now supported by mason-lspconfig ([4187417](https://github.com/LazyVim/LazyVim/commit/4187417158a22ff80a059a73f2eddb113f59c113)) +* **util.telescope:** make `show_untracked` configurable ([#2789](https://github.com/LazyVim/LazyVim/issues/2789)) ([1661759](https://github.com/LazyVim/LazyVim/commit/1661759d3358dbaa4be834f0022d53071b6fb21c)) + ## [10.15.0](https://github.com/LazyVim/LazyVim/compare/v10.14.0...v10.15.0) (2024-03-20) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 5b087513..dd23d581 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "10.15.0" -- x-release-please-version +M.version = "10.16.0" -- x-release-please-version ---@class LazyVimOptions local defaults = { From 7ab628501150b6dbaa6daae4a8ac7b864318677f Mon Sep 17 00:00:00 2001 From: Sergey Kochetkov Date: Fri, 22 Mar 2024 10:38:10 +0100 Subject: [PATCH 130/526] feat(options): Disable foldtext for nightly (#2447) * chores(format.lua): Fix typo * Change gitsigns.nvim hunk preview shortcut Change `preview_hunk` to recently added `preview_hunk_inline` command * feat(options): remove redundant commented line * feat(options): use native folding see https://github.com/neovim/neovim/pull/20750 --- lua/lazyvim/config/options.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/config/options.lua b/lua/lazyvim/config/options.lua index bd43e123..26e9fe75 100644 --- a/lua/lazyvim/config/options.lua +++ b/lua/lazyvim/config/options.lua @@ -74,7 +74,6 @@ opt.wrap = false -- Disable line wrap opt.fillchars = { foldopen = "", foldclose = "", - -- fold = "⸱", fold = " ", foldsep = " ", diff = "╱", @@ -87,16 +86,18 @@ end -- Folding vim.opt.foldlevel = 99 -vim.opt.foldtext = "v:lua.require'lazyvim.util'.ui.foldtext()" if vim.fn.has("nvim-0.9.0") == 1 then vim.opt.statuscolumn = [[%!v:lua.require'lazyvim.util'.ui.statuscolumn()]] + vim.opt.foldtext = "v:lua.require'lazyvim.util'.ui.foldtext()" end -- HACK: causes freezes on <= 0.9, so only enable on >= 0.10 for now if vim.fn.has("nvim-0.10") == 1 then vim.opt.foldmethod = "expr" vim.opt.foldexpr = "v:lua.require'lazyvim.util'.ui.foldexpr()" + vim.opt.foldtext = "" + vim.opt.fillchars = "fold: " else vim.opt.foldmethod = "indent" end From b74ef23a27dc4efc1cf76f14eb5ecced963d694d Mon Sep 17 00:00:00 2001 From: Uthman Mohamed <83053931+uthmanmoh@users.noreply.github.com> Date: Sat, 23 Mar 2024 03:15:04 -0400 Subject: [PATCH 131/526] feat(neo-tree): add mapping "O" to open with system default (#2758) * feat(neo-tree): add mapping "O" to open with system default * feat(neo-tree): add OS checks for system default open commands * Use `vim.ui.open` if exists * update OS checks * Just use vim.ui.open or throw error if doesn't exist * Make "O" undefined mapping if vim.ui.open isn't available * fix: use lazy's util.open instead --------- Co-authored-by: Uthman Mohamed <83053931+1239uth@users.noreply.github.com> Co-authored-by: saeedahsan Co-authored-by: Folke Lemaitre --- lua/lazyvim/plugins/editor.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 6a934d9f..622d7b3f 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -67,6 +67,12 @@ return { end, desc = "copy path to clipboard", }, + ["O"] = { + function(state) + require("lazy.util").open(state.tree:get_node().path, { system = true }) + end, + desc = "open with system application", + }, }, }, default_component_configs = { From 9e07a6615a16fafca37a6def86aa8344c09d289a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 23 Mar 2024 07:15:37 +0000 Subject: [PATCH 132/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 3df0cbf4..d122e042 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 22 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 23 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 3e5a5dd621438cff4dbe29df227585b46ede7e44 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 26 Mar 2024 09:28:04 +0100 Subject: [PATCH 133/526] feat(python): allow configuring other python lsp servers than pyright, basedpyright --- lua/lazyvim/plugins/extras/lang/python.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index 104b664b..c2843503 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -4,6 +4,8 @@ if lazyvim_docs then vim.g.lazyvim_python_lsp = "pyright" end +local lsp = vim.g.lazyvim_python_lsp or "pyright" + return { { "nvim-treesitter/nvim-treesitter", @@ -18,10 +20,13 @@ return { opts = { servers = { pyright = { - enabled = vim.g.lazyvim_python_lsp ~= "basedpyright", + enabled = lsp == "pyright", }, basedpyright = { - enabled = vim.g.lazyvim_python_lsp == "basedpyright", + enabled = lsp == "basedpyright", + }, + [lsp] = { + enabled = true, }, ruff_lsp = { keys = { From 1d2cb7d8d1e06c3d0b68c6aa731026d6af6defaa Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 26 Mar 2024 08:28:44 +0000 Subject: [PATCH 134/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index d122e042..d0bfca70 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 23 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 26 ============================================================================== Table of Contents *LazyVim-table-of-contents* From c00e3aa6b1d053e5bea7bfdfbfd3b5aedb6cb5be Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 26 Mar 2024 12:41:57 +0100 Subject: [PATCH 135/526] feat(util): added util function to get a fg/bg color from the active colorscheme --- lua/lazyvim/util/ui.lua | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/util/ui.lua b/lua/lazyvim/util/ui.lua index 1de0730b..a65eabbb 100644 --- a/lua/lazyvim/util/ui.lua +++ b/lua/lazyvim/util/ui.lua @@ -139,14 +139,31 @@ function M.statuscolumn() return table.concat(components, "") end +---@return {fg?:string}? function M.fg(name) + local color = M.color(name) + return color and { fg = color } or nil +end + +---@param name string +---@param bg? boolean +---@return string? +function M.color(name, bg) ---@type {foreground?:number}? ---@diagnostic disable-next-line: deprecated local hl = vim.api.nvim_get_hl and vim.api.nvim_get_hl(0, { name = name, link = false }) or vim.api.nvim_get_hl_by_name(name, true) ---@diagnostic disable-next-line: undefined-field - local fg = hl and (hl.fg or hl.foreground) - return fg and { fg = string.format("#%06x", fg) } or nil + ---@type string? + local color = nil + if hl then + if bg then + color = hl.bg or hl.background + else + color = hl.fg or hl.foreground + end + end + return color and string.format("#%06x", color) or nil end M.skip_foldexpr = {} ---@type table From 7d0dbc6dedc2d6cb4c3bc77fa296dc07ce5927c9 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 26 Mar 2024 12:43:03 +0100 Subject: [PATCH 136/526] feat(lazygit): lazygit now automatically uses colors from your Neovim colorscheme Disable by setting `vim.g.lazygit_theme = false` in your `options.lua` --- NEWS.md | 17 ++++++++ lua/lazyvim/config/keymaps.lua | 6 +-- lua/lazyvim/config/options.lua | 5 +++ lua/lazyvim/util/init.lua | 1 + lua/lazyvim/util/lazygit.lua | 75 ++++++++++++++++++++++++++++++++++ 5 files changed, 101 insertions(+), 3 deletions(-) create mode 100644 lua/lazyvim/util/lazygit.lua diff --git a/NEWS.md b/NEWS.md index 50b72da3..90937459 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,23 @@ ## 10.x +- **lazygit** now automatically uses the colors of your current colorscheme. + This is enabled by default. To disable, add the below to your `options.lua`: + + ```lua + vim.g.lazygit_theme = false + ``` + +- Added support for `basedpyright` to the **python** extra. + Enable in your `options.lua` with: + + ```lua + vim.g.lazyvim_python_lsp = "basedpyright" + ``` + + Be aware that `basedpyright` is still in development and + may not work exactly the same as `pyright`. + - User extras under `lua/plugins/extras` can now also be managed with **LazyExtras** diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index e5790d8f..339bf82a 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -125,12 +125,12 @@ map("n", "uT", function() if vim.b.ts_highlight then vim.treesitter.stop map("n", "ub", function() LazyVim.toggle("background", false, {"light", "dark"}) end, { desc = "Toggle Background" }) -- lazygit -map("n", "gg", function() LazyVim.terminal({ "lazygit" }, { cwd = LazyVim.root.git(), esc_esc = false, ctrl_hjkl = false }) end, { desc = "Lazygit (root dir)" }) -map("n", "gG", function() LazyVim.terminal({ "lazygit" }, {esc_esc = false, ctrl_hjkl = false}) end, { desc = "Lazygit (cwd)" }) +map("n", "gg", function() LazyVim.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (root dir)" }) +map("n", "gG", function() LazyVim.lazygit() end, { desc = "Lazygit (cwd)" }) map("n", "gf", function() local git_path = vim.api.nvim_buf_get_name(0) - LazyVim.terminal({ "lazygit", "-f", vim.trim(git_path) }, { esc_esc = false, ctrl_hjkl = false }) + LazyVim.lazygit({args = { "-f", vim.trim(git_path) }}) end, { desc = "Lazygit current file history" }) -- quit diff --git a/lua/lazyvim/config/options.lua b/lua/lazyvim/config/options.lua index 26e9fe75..af73e61e 100644 --- a/lua/lazyvim/config/options.lua +++ b/lua/lazyvim/config/options.lua @@ -12,6 +12,11 @@ vim.g.autoformat = true -- * a function with signature `function(buf) -> string|string[]` vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" } +-- LazyVim automatically configures the lazygit theme, +-- based on the active colorscheme. +-- Set to false to disable. +vim.g.lazygit_theme = true + -- Optionally setup the terminal to use -- This sets `vim.o.shell` and does some additional configuration for: -- * pwsh diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index 4de0d3e7..93abe101 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -6,6 +6,7 @@ local LazyUtil = require("lazy.core.util") ---@field root lazyvim.util.root ---@field telescope lazyvim.util.telescope ---@field terminal lazyvim.util.terminal +---@field lazygit lazyvim.util.lazygit ---@field toggle lazyvim.util.toggle ---@field format lazyvim.util.format ---@field plugin lazyvim.util.plugin diff --git a/lua/lazyvim/util/lazygit.lua b/lua/lazyvim/util/lazygit.lua new file mode 100644 index 00000000..031c6124 --- /dev/null +++ b/lua/lazyvim/util/lazygit.lua @@ -0,0 +1,75 @@ +---@class lazyvim.util.lazygit +---@field config_dir? string +---@overload fun(cmd: string|string[], opts: LazyTermOpts): LazyFloat +local M = setmetatable({}, { + __call = function(m, ...) + return m.open(...) + end, +}) + +M.theme_path = vim.fn.stdpath("cache") .. "/lazygit-theme.yml" + +-- re-create theme file on startup +M.dirty = true + +-- re-create theme file on ColorScheme change +vim.api.nvim_create_autocmd("ColorScheme", { + callback = function() + M.dirty = true + end, +}) + +-- Opens lazygit +---@param opts? LazyTermOpts | {args?: string[]} +function M.open(opts) + opts = vim.tbl_deep_extend("force", {}, opts or {}, { + esc_esc = false, + ctrl_hjkl = false, + }) + local cmd = { "lazygit" } + if vim.g.lazygit_theme then + if M.dirty then + M.update_theme() + end + M.config_dir = M.config_dir or vim.trim(vim.fn.system("lazygit -cd")) + vim.env.LG_CONFIG_FILE = M.config_dir .. "/config.yml" .. "," .. M.theme_path + end + vim.list_extend(cmd, opts.args or {}) + return LazyVim.terminal(cmd, opts) +end + +function M.set_ansi_color(idx, color) + io.write(("\27]4;%d;%s\7"):format(idx, color)) +end + +function M.update_theme() + -- LazyGit uses color 241 a lot, so also set it to a nice color + M.set_ansi_color(241, LazyVim.ui.color("Special") or "blue") + + local theme = { + activeBorderColor = { LazyVim.ui.color("MatchParen") or "orange", "bold" }, + cherryPickedCommitBgColor = { "cyan" }, + cherryPickedCommitFgColor = { "blue" }, + defaultFgColor = { "default" }, + inactiveBorderColor = { LazyVim.ui.color("FloatBorder") or "blue" }, + optionsTextColor = { "blue" }, + searchingActiveBorderColor = { LazyVim.ui.color("MatchParen") or "orange", "bold" }, + selectedLineBgColor = { LazyVim.ui.color("CursorLine", true) }, -- set to `default` to have no background colour + unstagedChangesColor = { "red" }, + } + ---@type string[] + local lines = {} + lines[#lines + 1] = "gui:" + lines[#lines + 1] = " theme:" + for k, v in pairs(theme) do + lines[#lines + 1] = (" %s:"):format(k) + for _, c in ipairs(v) do + lines[#lines + 1] = (" - %q"):format(c) + end + end + local config = table.concat(lines, "\n") + require("lazy.util").write_file(M.theme_path, config) + M.dirty = false +end + +return M From 4796dba8f7f6b39932d03049a4d30e18b3829aaf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 26 Mar 2024 12:47:36 +0100 Subject: [PATCH 137/526] chore(main): release 10.17.0 (#2805) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 11 +++++++++++ lua/lazyvim/config/init.lua | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7b3e1ff..8cd8225c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [10.17.0](https://github.com/LazyVim/LazyVim/compare/v10.16.0...v10.17.0) (2024-03-26) + + +### Features + +* **lazygit:** lazygit now automatically uses colors from your Neovim colorscheme ([7d0dbc6](https://github.com/LazyVim/LazyVim/commit/7d0dbc6dedc2d6cb4c3bc77fa296dc07ce5927c9)) +* **neo-tree:** add mapping "O" to open with system default ([#2758](https://github.com/LazyVim/LazyVim/issues/2758)) ([b74ef23](https://github.com/LazyVim/LazyVim/commit/b74ef23a27dc4efc1cf76f14eb5ecced963d694d)) +* **options:** Disable foldtext for nightly ([#2447](https://github.com/LazyVim/LazyVim/issues/2447)) ([7ab6285](https://github.com/LazyVim/LazyVim/commit/7ab628501150b6dbaa6daae4a8ac7b864318677f)) +* **python:** allow configuring other python lsp servers than pyright, basedpyright ([3e5a5dd](https://github.com/LazyVim/LazyVim/commit/3e5a5dd621438cff4dbe29df227585b46ede7e44)) +* **util:** added util function to get a fg/bg color from the active colorscheme ([c00e3aa](https://github.com/LazyVim/LazyVim/commit/c00e3aa6b1d053e5bea7bfdfbfd3b5aedb6cb5be)) + ## [10.16.0](https://github.com/LazyVim/LazyVim/compare/v10.15.0...v10.16.0) (2024-03-22) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index dd23d581..b2b30396 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "10.16.0" -- x-release-please-version +M.version = "10.17.0" -- x-release-please-version ---@class LazyVimOptions local defaults = { From bfe8c608a33255511fa3e79bf77fd7257022a525 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 26 Mar 2024 13:42:53 +0100 Subject: [PATCH 138/526] fix(lazygit): allow overriding default terminal options --- lua/lazyvim/util/lazygit.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/util/lazygit.lua b/lua/lazyvim/util/lazygit.lua index 031c6124..9da4d674 100644 --- a/lua/lazyvim/util/lazygit.lua +++ b/lua/lazyvim/util/lazygit.lua @@ -22,10 +22,10 @@ vim.api.nvim_create_autocmd("ColorScheme", { -- Opens lazygit ---@param opts? LazyTermOpts | {args?: string[]} function M.open(opts) - opts = vim.tbl_deep_extend("force", {}, opts or {}, { + opts = vim.tbl_deep_extend("force", {}, { esc_esc = false, ctrl_hjkl = false, - }) + }, opts or {}) local cmd = { "lazygit" } if vim.g.lazygit_theme then if M.dirty then From 20efdd44da9473b23aba503de2865fb0b1868fd4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 26 Mar 2024 13:46:01 +0100 Subject: [PATCH 139/526] chore(main): release 10.17.1 (#2827) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ lua/lazyvim/config/init.lua | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cd8225c..0f120737 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [10.17.1](https://github.com/LazyVim/LazyVim/compare/v10.17.0...v10.17.1) (2024-03-26) + + +### Bug Fixes + +* **lazygit:** allow overriding default terminal options ([bfe8c60](https://github.com/LazyVim/LazyVim/commit/bfe8c608a33255511fa3e79bf77fd7257022a525)) + ## [10.17.0](https://github.com/LazyVim/LazyVim/compare/v10.16.0...v10.17.0) (2024-03-26) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index b2b30396..92122edc 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "10.17.0" -- x-release-please-version +M.version = "10.17.1" -- x-release-please-version ---@class LazyVimOptions local defaults = { From a26ca7bf56790f6bc35134a5037df0405437a1be Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 26 Mar 2024 15:24:12 +0100 Subject: [PATCH 140/526] fix(lazygit): dont error when setting ansi color fails. Fixes #2829 --- lua/lazyvim/util/lazygit.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/util/lazygit.lua b/lua/lazyvim/util/lazygit.lua index 9da4d674..6f4bf3c5 100644 --- a/lua/lazyvim/util/lazygit.lua +++ b/lua/lazyvim/util/lazygit.lua @@ -44,7 +44,8 @@ end function M.update_theme() -- LazyGit uses color 241 a lot, so also set it to a nice color - M.set_ansi_color(241, LazyVim.ui.color("Special") or "blue") + -- pcall, since some terminals don't like this + pcall(M.set_ansi_color, 241, LazyVim.ui.color("Special") or "blue") local theme = { activeBorderColor = { LazyVim.ui.color("MatchParen") or "orange", "bold" }, From 49a1afab538ffc936214ba5ed3878ed399dff285 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 26 Mar 2024 15:30:56 +0100 Subject: [PATCH 141/526] chore(main): release 10.17.2 (#2831) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ lua/lazyvim/config/init.lua | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f120737..ae92d253 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [10.17.2](https://github.com/LazyVim/LazyVim/compare/v10.17.1...v10.17.2) (2024-03-26) + + +### Bug Fixes + +* **lazygit:** dont error when setting ansi color fails. Fixes [#2829](https://github.com/LazyVim/LazyVim/issues/2829) ([a26ca7b](https://github.com/LazyVim/LazyVim/commit/a26ca7bf56790f6bc35134a5037df0405437a1be)) + ## [10.17.1](https://github.com/LazyVim/LazyVim/compare/v10.17.0...v10.17.1) (2024-03-26) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 92122edc..07935619 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "10.17.1" -- x-release-please-version +M.version = "10.17.2" -- x-release-please-version ---@class LazyVimOptions local defaults = { From f3655c33a3239b67ce9c5e5a8cc384691fd8126c Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 26 Mar 2024 17:33:53 +0100 Subject: [PATCH 142/526] perf(notify): disable animation notifications. too big impact on performance for too little benefit To keep using animations, you can set stages = fade_in_slide_out for the nvim-notify plugin --- lua/lazyvim/plugins/ui.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index d77b3293..f71a43a6 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -12,6 +12,7 @@ return { }, }, opts = { + stages = "static", timeout = 3000, max_height = function() return math.floor(vim.o.lines * 0.75) From 55c2527dfe53088e64a9fb63e37c64ef590914cf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 26 Mar 2024 17:41:37 +0100 Subject: [PATCH 143/526] chore(main): release 10.17.3 (#2833) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ lua/lazyvim/config/init.lua | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae92d253..fd5da3d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [10.17.3](https://github.com/LazyVim/LazyVim/compare/v10.17.2...v10.17.3) (2024-03-26) + + +### Performance Improvements + +* **notify:** disable animation notifications. too big impact on performance for too little benefit ([f3655c3](https://github.com/LazyVim/LazyVim/commit/f3655c33a3239b67ce9c5e5a8cc384691fd8126c)) + ## [10.17.2](https://github.com/LazyVim/LazyVim/compare/v10.17.1...v10.17.2) (2024-03-26) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 07935619..a0aceb59 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "10.17.2" -- x-release-please-version +M.version = "10.17.3" -- x-release-please-version ---@class LazyVimOptions local defaults = { From 426cd3ed91b90e5304802904d14dc3826da317c9 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 26 Mar 2024 19:53:38 +0100 Subject: [PATCH 144/526] feat(lazygit): configure lazygit nvim-remote as editor and enable nerdfont icons can be disabled with `vim.g.lazygit_config = false` --- NEWS.md | 10 +++++++++- lua/lazyvim/config/options.lua | 8 +++++--- lua/lazyvim/util/lazygit.lua | 29 +++++++++++++++++++++-------- 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/NEWS.md b/NEWS.md index 90937459..d301ca14 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,11 +2,19 @@ ## 10.x +- The **lazygit** integration now configures: + + - the theme based on the colorscheme + - nerd font icons (v3) + - editor preset is set to `nvim-remote` for better interop with Neovim + +- The option `vim.g.lazygit_theme` was renamed to `vim.g.lazygit_config` + - **lazygit** now automatically uses the colors of your current colorscheme. This is enabled by default. To disable, add the below to your `options.lua`: ```lua - vim.g.lazygit_theme = false + vim.g.lazygit_config = false ``` - Added support for `basedpyright` to the **python** extra. diff --git a/lua/lazyvim/config/options.lua b/lua/lazyvim/config/options.lua index af73e61e..c20adcec 100644 --- a/lua/lazyvim/config/options.lua +++ b/lua/lazyvim/config/options.lua @@ -12,10 +12,12 @@ vim.g.autoformat = true -- * a function with signature `function(buf) -> string|string[]` vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" } --- LazyVim automatically configures the lazygit theme, --- based on the active colorscheme. +-- LazyVim automatically configures lazygit: +-- * theme, based on the active colorscheme. +-- * editorPreset to nvim-remote +-- * enables nerd font icons -- Set to false to disable. -vim.g.lazygit_theme = true +vim.g.lazygit_config = true -- Optionally setup the terminal to use -- This sets `vim.o.shell` and does some additional configuration for: diff --git a/lua/lazyvim/util/lazygit.lua b/lua/lazyvim/util/lazygit.lua index 6f4bf3c5..c51af485 100644 --- a/lua/lazyvim/util/lazygit.lua +++ b/lua/lazyvim/util/lazygit.lua @@ -9,7 +9,7 @@ local M = setmetatable({}, { M.theme_path = vim.fn.stdpath("cache") .. "/lazygit-theme.yml" --- re-create theme file on startup +-- re-create config file on startup M.dirty = true -- re-create theme file on ColorScheme change @@ -22,19 +22,26 @@ vim.api.nvim_create_autocmd("ColorScheme", { -- Opens lazygit ---@param opts? LazyTermOpts | {args?: string[]} function M.open(opts) + if vim.g.lazygit_theme ~= nil then + LazyVim.deprecate("vim.g.lazygit_theme", "vim.g.lazygit_config") + end + opts = vim.tbl_deep_extend("force", {}, { esc_esc = false, ctrl_hjkl = false, }, opts or {}) + local cmd = { "lazygit" } - if vim.g.lazygit_theme then + vim.list_extend(cmd, opts.args or {}) + + if vim.g.lazygit_config then if M.dirty then - M.update_theme() + M.update_config() end M.config_dir = M.config_dir or vim.trim(vim.fn.system("lazygit -cd")) vim.env.LG_CONFIG_FILE = M.config_dir .. "/config.yml" .. "," .. M.theme_path end - vim.list_extend(cmd, opts.args or {}) + return LazyVim.terminal(cmd, opts) end @@ -42,7 +49,7 @@ function M.set_ansi_color(idx, color) io.write(("\27]4;%d;%s\7"):format(idx, color)) end -function M.update_theme() +function M.update_config() -- LazyGit uses color 241 a lot, so also set it to a nice color -- pcall, since some terminals don't like this pcall(M.set_ansi_color, 241, LazyVim.ui.color("Special") or "blue") @@ -58,17 +65,23 @@ function M.update_theme() selectedLineBgColor = { LazyVim.ui.color("CursorLine", true) }, -- set to `default` to have no background colour unstagedChangesColor = { "red" }, } + local config = [[ +os: + editPreset: "nvim-remote" +gui: + nerdFontsVersion: 3 + theme: +]] + ---@type string[] local lines = {} - lines[#lines + 1] = "gui:" - lines[#lines + 1] = " theme:" for k, v in pairs(theme) do lines[#lines + 1] = (" %s:"):format(k) for _, c in ipairs(v) do lines[#lines + 1] = (" - %q"):format(c) end end - local config = table.concat(lines, "\n") + config = config .. table.concat(lines, "\n") require("lazy.util").write_file(M.theme_path, config) M.dirty = false end From fd0677fb9a512c4a4a6bae534a018f361a9bfe30 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 26 Mar 2024 19:55:12 +0100 Subject: [PATCH 145/526] fix(terminal): dont use backdrop for edgy terminal windows --- lua/lazyvim/util/terminal.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/util/terminal.lua b/lua/lazyvim/util/terminal.lua index c61c3664..1a85d4f0 100644 --- a/lua/lazyvim/util/terminal.lua +++ b/lua/lazyvim/util/terminal.lua @@ -52,6 +52,7 @@ function M.open(cmd, opts) opts = vim.tbl_deep_extend("force", { ft = "lazyterm", size = { width = 0.9, height = 0.9 }, + backdrop = LazyVim.has("edgy.nvim") and not cmd and 100 or nil, }, opts or {}, { persistent = true }) --[[@as LazyTermOpts]] local termkey = vim.inspect({ cmd = cmd or "shell", cwd = opts.cwd, env = opts.env, count = vim.v.count1 }) From 76b037dcc1105f23b92fe6211d747f97705413fa Mon Sep 17 00:00:00 2001 From: Feliche-Demian Netliukh <51330172+Demianeen@users.noreply.github.com> Date: Tue, 26 Mar 2024 19:26:08 +0000 Subject: [PATCH 146/526] feat(extras): add dial extra (#2798) * feat: add dial extra * refactor: removed print statements * fix(extras): early return for dial extra * refactor: dials_by_ft like conform, nvim-lint. Simplified buffer specific groups --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/plugins/extras/editor/dial.lua | 171 +++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/editor/dial.lua diff --git a/lua/lazyvim/plugins/extras/editor/dial.lua b/lua/lazyvim/plugins/extras/editor/dial.lua new file mode 100644 index 00000000..20ebd7ff --- /dev/null +++ b/lua/lazyvim/plugins/extras/editor/dial.lua @@ -0,0 +1,171 @@ +local M = {} +---@type table> +M.dials_by_ft = {} + +---@param increment boolean +---@param g? boolean +function M.dial(increment, g) + local is_visual = vim.fn.mode(true):sub(1, 1) == "v" + local func = (increment and "inc" or "dec") .. (g and "_g" or "_") .. (is_visual and "visual" or "normal") + local group = M.dials_by_ft[vim.bo.filetype] or "default" + return require("dial.map")[func](group) +end + +return { + "monaqa/dial.nvim", + -- stylua: ignore + keys = { + { "", function() return M.dial(true) end, expr = true, desc = "Increment", mode = {"n", "v"} }, + { "", function() return M.dial(false) end, expr = true, desc = "Decrement", mode = {"n", "v"} }, + { "g", function() return M.dial(true, true) end, expr = true, desc = "Increment", mode = {"n", "v"} }, + { "g", function() return M.dial(false, true) end, expr = true, desc = "Decrement", mode = {"n", "v"} }, + }, + opts = function() + local augend = require("dial.augend") + + local logical_alias = augend.constant.new({ + elements = { "&&", "||" }, + word = false, + cyclic = true, + }) + + local ordinal_numbers = augend.constant.new({ + -- elements through which we cycle. When we increment, we go down + -- On decrement we go up + elements = { + "first", + "second", + "third", + "fourth", + "fifth", + "sixth", + "seventh", + "eighth", + "ninth", + "tenth", + }, + -- if true, it only matches strings with word boundary. firstDate wouldn't work for example + word = false, + -- do we cycle back and forth (tenth to first on increment, first to tenth on decrement). + -- Otherwise nothing will happen when there are no further values + cyclic = true, + }) + + local weekdays = augend.constant.new({ + elements = { + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Sunday", + }, + word = true, + cyclic = true, + }) + + local months = augend.constant.new({ + elements = { + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December", + }, + word = true, + cyclic = true, + }) + + local capitalized_boolean = augend.constant.new({ + elements = { + "True", + "False", + }, + word = true, + cyclic = true, + }) + + return { + dials_by_ft = { + css = "css", + javascript = "typescript", + javascriptreact = "typescript", + json = "json", + lua = "lua", + markdown = "markdown", + python = "python", + sass = "css", + scss = "css", + typescript = "typescript", + typescriptreact = "typescript", + }, + groups = { + default = { + augend.integer.alias.decimal, -- nonnegative decimal number (0, 1, 2, 3, ...) + augend.integer.alias.hex, -- nonnegative hex number (0x01, 0x1a1f, etc.) + augend.date.alias["%Y/%m/%d"], -- date (2022/02/19, etc.) + }, + typescript = { + augend.integer.alias.decimal, -- nonnegative and negative decimal number + augend.constant.alias.bool, -- boolean value (true <-> false) + logical_alias, + augend.constant.new({ elements = { "let", "const" } }), + ordinal_numbers, + weekdays, + months, + }, + css = { + augend.integer.alias.decimal, -- nonnegative and negative decimal number + augend.hexcolor.new({ + case = "lower", + }), + augend.hexcolor.new({ + case = "upper", + }), + }, + markdown = { + augend.misc.alias.markdown_header, + ordinal_numbers, + weekdays, + months, + }, + json = { + augend.integer.alias.decimal, -- nonnegative and negative decimal number + augend.semver.alias.semver, -- versioning (v1.1.2) + }, + lua = { + augend.integer.alias.decimal, -- nonnegative and negative decimal number + augend.constant.alias.bool, -- boolean value (true <-> false) + augend.constant.new({ + elements = { "and", "or" }, + word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc. + cyclic = true, -- "or" is incremented into "and". + }), + ordinal_numbers, + weekdays, + months, + }, + python = { + augend.integer.alias.decimal, -- nonnegative and negative decimal number + capitalized_boolean, + logical_alias, + ordinal_numbers, + weekdays, + months, + }, + }, + } + end, + config = function(_, opts) + require("dial.config").augends:register_group(opts.groups) + M.dials_by_ft = opts.dials_by_ft + end, +} From 1de90e7e4c94f51b187c4cd4fcfb6480f4303c46 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 26 Mar 2024 20:33:06 +0100 Subject: [PATCH 147/526] chore(main): release 10.18.0 (#2834) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 13 +++++++++++++ lua/lazyvim/config/init.lua | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd5da3d1..516c1434 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [10.18.0](https://github.com/LazyVim/LazyVim/compare/v10.17.3...v10.18.0) (2024-03-26) + + +### Features + +* **extras:** add dial extra ([#2798](https://github.com/LazyVim/LazyVim/issues/2798)) ([76b037d](https://github.com/LazyVim/LazyVim/commit/76b037dcc1105f23b92fe6211d747f97705413fa)) +* **lazygit:** configure lazygit nvim-remote as editor and enable nerdfont icons ([426cd3e](https://github.com/LazyVim/LazyVim/commit/426cd3ed91b90e5304802904d14dc3826da317c9)) + + +### Bug Fixes + +* **terminal:** dont use backdrop for edgy terminal windows ([fd0677f](https://github.com/LazyVim/LazyVim/commit/fd0677fb9a512c4a4a6bae534a018f361a9bfe30)) + ## [10.17.3](https://github.com/LazyVim/LazyVim/compare/v10.17.2...v10.17.3) (2024-03-26) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index a0aceb59..c1b14714 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "10.17.3" -- x-release-please-version +M.version = "10.18.0" -- x-release-please-version ---@class LazyVimOptions local defaults = { From 1910cd5cb76229d565c3d291af2ae27a7d4574b1 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 26 Mar 2024 20:47:16 +0100 Subject: [PATCH 148/526] refactor: use `LazyVim.is_win()` --- lua/lazyvim/plugins/coding.lua | 2 +- lua/lazyvim/plugins/extras/coding/yanky.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 6aec8b85..6e8549a4 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -70,7 +70,7 @@ return { -- snippets { "L3MON4D3/LuaSnip", - build = (not jit.os:find("Windows")) + build = (not LazyVim.is_win()) and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp" or nil, dependencies = { diff --git a/lua/lazyvim/plugins/extras/coding/yanky.lua b/lua/lazyvim/plugins/extras/coding/yanky.lua index c48df709..9f7911cb 100644 --- a/lua/lazyvim/plugins/extras/coding/yanky.lua +++ b/lua/lazyvim/plugins/extras/coding/yanky.lua @@ -2,10 +2,10 @@ return { -- better yank/paste { "gbprod/yanky.nvim", - dependencies = not jit.os:find("Windows") and { "kkharji/sqlite.lua" } or {}, + dependencies = not LazyVim.is_win() and { "kkharji/sqlite.lua" } or {}, opts = { highlight = { timer = 250 }, - ring = { storage = jit.os:find("Windows") and "shada" or "sqlite" }, + ring = { storage = LazyVim.is_win() and "shada" or "sqlite" }, }, keys = { -- stylua: ignore From 7d570fad7949288711c6238468add594963cabaa Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 26 Mar 2024 20:48:50 +0100 Subject: [PATCH 149/526] fix(autocmds): auto create directory on windows for uris. Fixes #2442 --- lua/lazyvim/config/autocmds.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index dc89b750..48faab3d 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -106,7 +106,7 @@ vim.api.nvim_create_autocmd({ "FileType" }, { vim.api.nvim_create_autocmd({ "BufWritePre" }, { group = augroup("auto_create_dir"), callback = function(event) - if event.match:match("^%w%w+://") then + if event.match:match("^%w%w+:[\\/][\\/]") then return end local file = vim.uv.fs_realpath(event.match) or event.match From eb9f9a8862983abe1c7dd51f5f6bf2bd6978346f Mon Sep 17 00:00:00 2001 From: Kevin Traver Date: Wed, 27 Mar 2024 00:56:44 -0700 Subject: [PATCH 150/526] fix(keymaps): update all keymap descriptions to be Title Case (#2844) --- lua/lazyvim/config/keymaps.lua | 92 +++++++++---------- lua/lazyvim/plugins/coding.lua | 14 +-- lua/lazyvim/plugins/editor.lua | 44 ++++----- lua/lazyvim/plugins/extras/coding/yanky.lua | 34 +++---- lua/lazyvim/plugins/extras/dap/core.lua | 2 +- .../plugins/extras/editor/harpoon2.lua | 14 +-- lua/lazyvim/plugins/extras/editor/leap.lua | 6 +- .../plugins/extras/editor/mini-files.lua | 4 +- lua/lazyvim/plugins/extras/lang/rust.lua | 2 +- lua/lazyvim/plugins/extras/util/gitui.lua | 4 +- lua/lazyvim/plugins/treesitter.lua | 4 +- lua/lazyvim/plugins/ui.lua | 32 +++---- lua/lazyvim/util/telescope.lua | 2 +- 13 files changed, 127 insertions(+), 127 deletions(-) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 339bf82a..49f693c9 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -11,35 +11,35 @@ map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true map({ "n", "x" }, "", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) -- Move to window using the hjkl keys -map("n", "", "h", { desc = "Go to left window", remap = true }) -map("n", "", "j", { desc = "Go to lower window", remap = true }) -map("n", "", "k", { desc = "Go to upper window", remap = true }) -map("n", "", "l", { desc = "Go to right window", remap = true }) +map("n", "", "h", { desc = "Go to Left Window", remap = true }) +map("n", "", "j", { desc = "Go to Lower Window", remap = true }) +map("n", "", "k", { desc = "Go to Upper Window", remap = true }) +map("n", "", "l", { desc = "Go to Right Window", remap = true }) -- Resize window using arrow keys -map("n", "", "resize +2", { desc = "Increase window height" }) -map("n", "", "resize -2", { desc = "Decrease window height" }) -map("n", "", "vertical resize -2", { desc = "Decrease window width" }) -map("n", "", "vertical resize +2", { desc = "Increase window width" }) +map("n", "", "resize +2", { desc = "Increase Window Height" }) +map("n", "", "resize -2", { desc = "Decrease Window Height" }) +map("n", "", "vertical resize -2", { desc = "Decrease Window Width" }) +map("n", "", "vertical resize +2", { desc = "Increase Window Width" }) -- Move Lines -map("n", "", "m .+1==", { desc = "Move down" }) -map("n", "", "m .-2==", { desc = "Move up" }) -map("i", "", "m .+1==gi", { desc = "Move down" }) -map("i", "", "m .-2==gi", { desc = "Move up" }) -map("v", "", ":m '>+1gv=gv", { desc = "Move down" }) -map("v", "", ":m '<-2gv=gv", { desc = "Move up" }) +map("n", "", "m .+1==", { desc = "Move Down" }) +map("n", "", "m .-2==", { desc = "Move Up" }) +map("i", "", "m .+1==gi", { desc = "Move Down" }) +map("i", "", "m .-2==gi", { desc = "Move Up" }) +map("v", "", ":m '>+1gv=gv", { desc = "Move Down" }) +map("v", "", ":m '<-2gv=gv", { desc = "Move Up" }) -- buffers -map("n", "", "bprevious", { desc = "Prev buffer" }) -map("n", "", "bnext", { desc = "Next buffer" }) -map("n", "[b", "bprevious", { desc = "Prev buffer" }) -map("n", "]b", "bnext", { desc = "Next buffer" }) +map("n", "", "bprevious", { desc = "Prev Buffer" }) +map("n", "", "bnext", { desc = "Next Buffer" }) +map("n", "[b", "bprevious", { desc = "Prev Buffer" }) +map("n", "]b", "bnext", { desc = "Next Buffer" }) map("n", "bb", "e #", { desc = "Switch to Other Buffer" }) map("n", "`", "e #", { desc = "Switch to Other Buffer" }) -- Clear search with -map({ "i", "n" }, "", "noh", { desc = "Escape and clear hlsearch" }) +map({ "i", "n" }, "", "noh", { desc = "Escape and Clear hlsearch" }) -- Clear search, diff update and redraw -- taken from runtime/lua/_editor.lua @@ -47,16 +47,16 @@ map( "n", "ur", "nohlsearchdiffupdatenormal! ", - { desc = "Redraw / clear hlsearch / diff update" } + { desc = "Redraw / Clear hlsearch / Diff Update" } ) -- https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n -map("n", "n", "'Nn'[v:searchforward].'zv'", { expr = true, desc = "Next search result" }) -map("x", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" }) -map("o", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" }) -map("n", "N", "'nN'[v:searchforward].'zv'", { expr = true, desc = "Prev search result" }) -map("x", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" }) -map("o", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" }) +map("n", "n", "'Nn'[v:searchforward].'zv'", { expr = true, desc = "Next Search Result" }) +map("x", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next Search Result" }) +map("o", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next Search Result" }) +map("n", "N", "'nN'[v:searchforward].'zv'", { expr = true, desc = "Prev Search Result" }) +map("x", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev Search Result" }) +map("o", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev Search Result" }) -- Add undo break-points map("i", ",", ",u") @@ -64,7 +64,7 @@ map("i", ".", ".u") map("i", ";", ";u") -- save file -map({ "i", "x", "n", "s" }, "", "w", { desc = "Save file" }) +map({ "i", "x", "n", "s" }, "", "w", { desc = "Save File" }) --keywordprg map("n", "K", "norm! K", { desc = "Keywordprg" }) @@ -82,8 +82,8 @@ map("n", "fn", "enew", { desc = "New File" }) map("n", "xl", "lopen", { desc = "Location List" }) map("n", "xq", "copen", { desc = "Quickfix List" }) -map("n", "[q", vim.cmd.cprev, { desc = "Previous quickfix" }) -map("n", "]q", vim.cmd.cnext, { desc = "Next quickfix" }) +map("n", "[q", vim.cmd.cprev, { desc = "Previous Quickfix" }) +map("n", "]q", vim.cmd.cnext, { desc = "Next Quickfix" }) -- formatting map({ "n", "v" }, "cf", function() @@ -109,8 +109,8 @@ map("n", "[w", diagnostic_goto(false, "WARN"), { desc = "Prev Warning" }) -- stylua: ignore start -- toggle options -map("n", "uf", function() LazyVim.format.toggle() end, { desc = "Toggle auto format (global)" }) -map("n", "uF", function() LazyVim.format.toggle(true) end, { desc = "Toggle auto format (buffer)" }) +map("n", "uf", function() LazyVim.format.toggle() end, { desc = "Toggle Auto Format (Global)" }) +map("n", "uF", function() LazyVim.format.toggle(true) end, { desc = "Toggle Auto Format (Buffer)" }) map("n", "us", function() LazyVim.toggle("spell") end, { desc = "Toggle Spelling" }) map("n", "uw", function() LazyVim.toggle("wrap") end, { desc = "Toggle Word Wrap" }) map("n", "uL", function() LazyVim.toggle("relativenumber") end, { desc = "Toggle Relative Line Numbers" }) @@ -125,16 +125,16 @@ map("n", "uT", function() if vim.b.ts_highlight then vim.treesitter.stop map("n", "ub", function() LazyVim.toggle("background", false, {"light", "dark"}) end, { desc = "Toggle Background" }) -- lazygit -map("n", "gg", function() LazyVim.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (root dir)" }) +map("n", "gg", function() LazyVim.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" }) map("n", "gG", function() LazyVim.lazygit() end, { desc = "Lazygit (cwd)" }) map("n", "gf", function() local git_path = vim.api.nvim_buf_get_name(0) LazyVim.lazygit({args = { "-f", vim.trim(git_path) }}) -end, { desc = "Lazygit current file history" }) +end, { desc = "Lazygit Current File History" }) -- quit -map("n", "qq", "qa", { desc = "Quit all" }) +map("n", "qq", "qa", { desc = "Quit All" }) -- highlights under cursor map("n", "ui", vim.show_pos, { desc = "Inspect Pos" }) @@ -144,27 +144,27 @@ map("n", "L", function() LazyVim.news.changelog() end, { desc = "LazyVim -- floating terminal local lazyterm = function() LazyVim.terminal(nil, { cwd = LazyVim.root() }) end -map("n", "ft", lazyterm, { desc = "Terminal (root dir)" }) +map("n", "ft", lazyterm, { desc = "Terminal (Root Dir)" }) map("n", "fT", function() LazyVim.terminal() end, { desc = "Terminal (cwd)" }) -map("n", "", lazyterm, { desc = "Terminal (root dir)" }) +map("n", "", lazyterm, { desc = "Terminal (Root Dir)" }) map("n", "", lazyterm, { desc = "which_key_ignore" }) -- Terminal Mappings map("t", "", "", { desc = "Enter Normal Mode" }) -map("t", "", "wincmd h", { desc = "Go to left window" }) -map("t", "", "wincmd j", { desc = "Go to lower window" }) -map("t", "", "wincmd k", { desc = "Go to upper window" }) -map("t", "", "wincmd l", { desc = "Go to right window" }) +map("t", "", "wincmd h", { desc = "Go to Left Window" }) +map("t", "", "wincmd j", { desc = "Go to Lower Window" }) +map("t", "", "wincmd k", { desc = "Go to Upper Window" }) +map("t", "", "wincmd l", { desc = "Go to Right Window" }) map("t", "", "close", { desc = "Hide Terminal" }) map("t", "", "close", { desc = "which_key_ignore" }) -- windows -map("n", "ww", "p", { desc = "Other window", remap = true }) -map("n", "wd", "c", { desc = "Delete window", remap = true }) -map("n", "w-", "s", { desc = "Split window below", remap = true }) -map("n", "w|", "v", { desc = "Split window right", remap = true }) -map("n", "-", "s", { desc = "Split window below", remap = true }) -map("n", "|", "v", { desc = "Split window right", remap = true }) +map("n", "ww", "p", { desc = "Other Window", remap = true }) +map("n", "wd", "c", { desc = "Delete Window", remap = true }) +map("n", "w-", "s", { desc = "Split Window Below", remap = true }) +map("n", "w|", "v", { desc = "Split Window Right", remap = true }) +map("n", "-", "s", { desc = "Split Window Below", remap = true }) +map("n", "|", "v", { desc = "Split Window Right", remap = true }) -- tabs map("n", "l", "tablast", { desc = "Last Tab" }) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 6e8549a4..9a00a8c9 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -129,7 +129,7 @@ return { LazyVim.info("Enabled auto pairs", { title = "Option" }) end end, - desc = "Toggle auto pairs", + desc = "Toggle Auto Pairs", }, }, }, @@ -145,12 +145,12 @@ return { local plugin = require("lazy.core.config").spec.plugins["mini.surround"] local opts = require("lazy.core.plugin").values(plugin, "opts", false) local mappings = { - { opts.mappings.add, desc = "Add surrounding", mode = { "n", "v" } }, - { opts.mappings.delete, desc = "Delete surrounding" }, - { opts.mappings.find, desc = "Find right surrounding" }, - { opts.mappings.find_left, desc = "Find left surrounding" }, - { opts.mappings.highlight, desc = "Highlight surrounding" }, - { opts.mappings.replace, desc = "Replace surrounding" }, + { opts.mappings.add, desc = "Add Surrounding", mode = { "n", "v" } }, + { opts.mappings.delete, desc = "Delete Surrounding" }, + { opts.mappings.find, desc = "Find Right Surrounding" }, + { opts.mappings.find_left, desc = "Find Left Surrounding" }, + { opts.mappings.highlight, desc = "Highlight Surrounding" }, + { opts.mappings.replace, desc = "Replace Surrounding" }, { opts.mappings.update_n_lines, desc = "Update `MiniSurround.config.n_lines`" }, } mappings = vim.tbl_filter(function(m) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 622d7b3f..37bcc9cb 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -11,7 +11,7 @@ return { function() require("neo-tree.command").execute({ toggle = true, dir = LazyVim.root() }) end, - desc = "Explorer NeoTree (root dir)", + desc = "Explorer NeoTree (Root Dir)", }, { "fE", @@ -20,21 +20,21 @@ return { end, desc = "Explorer NeoTree (cwd)", }, - { "e", "fe", desc = "Explorer NeoTree (root dir)", remap = true }, + { "e", "fe", desc = "Explorer NeoTree (Root Dir)", remap = true }, { "E", "fE", desc = "Explorer NeoTree (cwd)", remap = true }, { "ge", function() require("neo-tree.command").execute({ source = "git_status", toggle = true }) end, - desc = "Git explorer", + desc = "Git Explorer", }, { "be", function() require("neo-tree.command").execute({ source = "buffers", toggle = true }) end, - desc = "Buffer explorer", + desc = "Buffer Explorer", }, }, deactivate = function() @@ -65,13 +65,13 @@ return { local path = node:get_id() vim.fn.setreg("+", path, "c") end, - desc = "copy path to clipboard", + desc = "Copy Path to Clipboard", }, ["O"] = { function(state) require("lazy.util").open(state.tree:get_node().path, { system = true }) end, - desc = "open with system application", + desc = "Open with System Application", }, }, }, @@ -115,7 +115,7 @@ return { opts = { open_cmd = "noswapfile vnew" }, -- stylua: ignore keys = { - { "sr", function() require("spectre").open() end, desc = "Replace in files (Spectre)" }, + { "sr", function() require("spectre").open() end, desc = "Replace in Files (Spectre)" }, }, }, @@ -146,29 +146,29 @@ return { "Telescope buffers sort_mru=true sort_lastused=true", desc = "Switch Buffer", }, - { "/", LazyVim.telescope("live_grep"), desc = "Grep (root dir)" }, + { "/", LazyVim.telescope("live_grep"), desc = "Grep (Root Dir)" }, { ":", "Telescope command_history", desc = "Command History" }, - { "", LazyVim.telescope("files"), desc = "Find Files (root dir)" }, + { "", LazyVim.telescope("files"), desc = "Find Files (Root Dir)" }, -- find { "fb", "Telescope buffers sort_mru=true sort_lastused=true", desc = "Buffers" }, { "fc", LazyVim.telescope.config_files(), desc = "Find Config File" }, - { "ff", LazyVim.telescope("files"), desc = "Find Files (root dir)" }, + { "ff", LazyVim.telescope("files"), desc = "Find Files (Root Dir)" }, { "fF", LazyVim.telescope("files", { cwd = false }), desc = "Find Files (cwd)" }, { "fg", "Telescope git_files", desc = "Find Files (git-files)" }, { "fr", "Telescope oldfiles", desc = "Recent" }, { "fR", LazyVim.telescope("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" }, -- git - { "gc", "Telescope git_commits", desc = "commits" }, - { "gs", "Telescope git_status", desc = "status" }, + { "gc", "Telescope git_commits", desc = "Commits" }, + { "gs", "Telescope git_status", desc = "Status" }, -- search { 's"', "Telescope registers", desc = "Registers" }, { "sa", "Telescope autocommands", desc = "Auto Commands" }, { "sb", "Telescope current_buffer_fuzzy_find", desc = "Buffer" }, { "sc", "Telescope command_history", desc = "Command History" }, { "sC", "Telescope commands", desc = "Commands" }, - { "sd", "Telescope diagnostics bufnr=0", desc = "Document diagnostics" }, - { "sD", "Telescope diagnostics", desc = "Workspace diagnostics" }, - { "sg", LazyVim.telescope("live_grep"), desc = "Grep (root dir)" }, + { "sd", "Telescope diagnostics bufnr=0", desc = "Document Diagnostics" }, + { "sD", "Telescope diagnostics", desc = "Workspace Diagnostics" }, + { "sg", LazyVim.telescope("live_grep"), desc = "Grep (Root Dir)" }, { "sG", LazyVim.telescope("live_grep", { cwd = false }), desc = "Grep (cwd)" }, { "sh", "Telescope help_tags", desc = "Help Pages" }, { "sH", "Telescope highlights", desc = "Search Highlight Groups" }, @@ -177,11 +177,11 @@ return { { "sm", "Telescope marks", desc = "Jump to Mark" }, { "so", "Telescope vim_options", desc = "Options" }, { "sR", "Telescope resume", desc = "Resume" }, - { "sw", LazyVim.telescope("grep_string", { word_match = "-w" }), desc = "Word (root dir)" }, + { "sw", LazyVim.telescope("grep_string", { word_match = "-w" }), desc = "Word (Root Dir)" }, { "sW", LazyVim.telescope("grep_string", { cwd = false, word_match = "-w" }), desc = "Word (cwd)" }, - { "sw", LazyVim.telescope("grep_string"), mode = "v", desc = "Selection (root dir)" }, + { "sw", LazyVim.telescope("grep_string"), mode = "v", desc = "Selection (Root Dir)" }, { "sW", LazyVim.telescope("grep_string", { cwd = false }), mode = "v", desc = "Selection (cwd)" }, - { "uC", LazyVim.telescope("colorscheme", { enable_preview = true }), desc = "Colorscheme with preview" }, + { "uC", LazyVim.telescope("colorscheme", { enable_preview = true }), desc = "Colorscheme with Preview" }, { "ss", function() @@ -472,7 +472,7 @@ return { end end end, - desc = "Previous trouble/quickfix item", + desc = "Previous Trouble/Quickfix Item", }, { "]q", @@ -486,7 +486,7 @@ return { end end end, - desc = "Next trouble/quickfix item", + desc = "Next Trouble/Quickfix Item", }, }, }, @@ -500,8 +500,8 @@ return { config = true, -- stylua: ignore keys = { - { "]t", function() require("todo-comments").jump_next() end, desc = "Next todo comment" }, - { "[t", function() require("todo-comments").jump_prev() end, desc = "Previous todo comment" }, + { "]t", function() require("todo-comments").jump_next() end, desc = "Next Todo Comment" }, + { "[t", function() require("todo-comments").jump_prev() end, desc = "Previous Todo Comment" }, { "xt", "TodoTrouble", desc = "Todo (Trouble)" }, { "xT", "TodoTrouble keywords=TODO,FIX,FIXME", desc = "Todo/Fix/Fixme (Trouble)" }, { "st", "TodoTelescope", desc = "Todo" }, diff --git a/lua/lazyvim/plugins/extras/coding/yanky.lua b/lua/lazyvim/plugins/extras/coding/yanky.lua index 9f7911cb..e3549643 100644 --- a/lua/lazyvim/plugins/extras/coding/yanky.lua +++ b/lua/lazyvim/plugins/extras/coding/yanky.lua @@ -10,23 +10,23 @@ return { keys = { -- stylua: ignore { "p", function() require("telescope").extensions.yank_history.yank_history({ }) end, desc = "Open Yank History" }, - { "y", "(YankyYank)", mode = { "n", "x" }, desc = "Yank text" }, - { "p", "(YankyPutAfter)", mode = { "n", "x" }, desc = "Put yanked text after cursor" }, - { "P", "(YankyPutBefore)", mode = { "n", "x" }, desc = "Put yanked text before cursor" }, - { "gp", "(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put yanked text after selection" }, - { "gP", "(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put yanked text before selection" }, - { "[y", "(YankyCycleForward)", desc = "Cycle forward through yank history" }, - { "]y", "(YankyCycleBackward)", desc = "Cycle backward through yank history" }, - { "]p", "(YankyPutIndentAfterLinewise)", desc = "Put indented after cursor (linewise)" }, - { "[p", "(YankyPutIndentBeforeLinewise)", desc = "Put indented before cursor (linewise)" }, - { "]P", "(YankyPutIndentAfterLinewise)", desc = "Put indented after cursor (linewise)" }, - { "[P", "(YankyPutIndentBeforeLinewise)", desc = "Put indented before cursor (linewise)" }, - { ">p", "(YankyPutIndentAfterShiftRight)", desc = "Put and indent right" }, - { "(YankyPutIndentAfterShiftLeft)", desc = "Put and indent left" }, - { ">P", "(YankyPutIndentBeforeShiftRight)", desc = "Put before and indent right" }, - { "(YankyPutIndentBeforeShiftLeft)", desc = "Put before and indent left" }, - { "=p", "(YankyPutAfterFilter)", desc = "Put after applying a filter" }, - { "=P", "(YankyPutBeforeFilter)", desc = "Put before applying a filter" }, + { "y", "(YankyYank)", mode = { "n", "x" }, desc = "Yank Text" }, + { "p", "(YankyPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Cursor" }, + { "P", "(YankyPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Cursor" }, + { "gp", "(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Selection" }, + { "gP", "(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Selection" }, + { "[y", "(YankyCycleForward)", desc = "Cycle Forward Through Yank History" }, + { "]y", "(YankyCycleBackward)", desc = "Cycle Backward Through Yank History" }, + { "]p", "(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" }, + { "[p", "(YankyPutIndentBeforeLinewise)", desc = "Put Indented Before Cursor (Linewise)" }, + { "]P", "(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" }, + { "[P", "(YankyPutIndentBeforeLinewise)", desc = "Put Indented Before Cursor (Linewise)" }, + { ">p", "(YankyPutIndentAfterShiftRight)", desc = "Put and Indent Right" }, + { "(YankyPutIndentAfterShiftLeft)", desc = "Put and Indent Left" }, + { ">P", "(YankyPutIndentBeforeShiftRight)", desc = "Put Before and Indent Right" }, + { "(YankyPutIndentBeforeShiftLeft)", desc = "Put Before and Indent Left" }, + { "=p", "(YankyPutAfterFilter)", desc = "Put After Applying a Filter" }, + { "=P", "(YankyPutBeforeFilter)", desc = "Put Before Applying a Filter" }, }, }, } diff --git a/lua/lazyvim/plugins/extras/dap/core.lua b/lua/lazyvim/plugins/extras/dap/core.lua index 343e35b9..7e370629 100644 --- a/lua/lazyvim/plugins/extras/dap/core.lua +++ b/lua/lazyvim/plugins/extras/dap/core.lua @@ -90,7 +90,7 @@ return { { "dc", function() require("dap").continue() end, desc = "Continue" }, { "da", function() require("dap").continue({ before = get_args }) end, desc = "Run with Args" }, { "dC", function() require("dap").run_to_cursor() end, desc = "Run to Cursor" }, - { "dg", function() require("dap").goto_() end, desc = "Go to line (no execute)" }, + { "dg", function() require("dap").goto_() end, desc = "Go to Line (No Execute)" }, { "di", function() require("dap").step_into() end, desc = "Step Into" }, { "dj", function() require("dap").down() end, desc = "Down" }, { "dk", function() require("dap").up() end, desc = "Up" }, diff --git a/lua/lazyvim/plugins/extras/editor/harpoon2.lua b/lua/lazyvim/plugins/extras/editor/harpoon2.lua index 202f3c04..0aecc1cd 100644 --- a/lua/lazyvim/plugins/extras/editor/harpoon2.lua +++ b/lua/lazyvim/plugins/extras/editor/harpoon2.lua @@ -12,7 +12,7 @@ return { function() require("harpoon"):list():append() end, - desc = "Harpoon file", + desc = "Harpoon File", }, { "h", @@ -20,42 +20,42 @@ return { local harpoon = require("harpoon") harpoon.ui:toggle_quick_menu(harpoon:list()) end, - desc = "Harpoon quick menu", + desc = "Harpoon Quick Menu", }, { "1", function() require("harpoon"):list():select(1) end, - desc = "Harpoon to file 1", + desc = "Harpoon to File 1", }, { "2", function() require("harpoon"):list():select(2) end, - desc = "Harpoon to file 2", + desc = "Harpoon to File 2", }, { "3", function() require("harpoon"):list():select(3) end, - desc = "Harpoon to file 3", + desc = "Harpoon to File 3", }, { "4", function() require("harpoon"):list():select(4) end, - desc = "Harpoon to file 4", + desc = "Harpoon to File 4", }, { "5", function() require("harpoon"):list():select(5) end, - desc = "Harpoon to file 5", + desc = "Harpoon to File 5", }, }, } diff --git a/lua/lazyvim/plugins/extras/editor/leap.lua b/lua/lazyvim/plugins/extras/editor/leap.lua index ab422abf..19bfd4a8 100644 --- a/lua/lazyvim/plugins/extras/editor/leap.lua +++ b/lua/lazyvim/plugins/extras/editor/leap.lua @@ -20,9 +20,9 @@ return { "ggandor/leap.nvim", enabled = true, keys = { - { "s", mode = { "n", "x", "o" }, desc = "Leap forward to" }, - { "S", mode = { "n", "x", "o" }, desc = "Leap backward to" }, - { "gs", mode = { "n", "x", "o" }, desc = "Leap from windows" }, + { "s", mode = { "n", "x", "o" }, desc = "Leap Forward to" }, + { "S", mode = { "n", "x", "o" }, desc = "Leap Backward to" }, + { "gs", mode = { "n", "x", "o" }, desc = "Leap from Windows" }, }, config = function(_, opts) local leap = require("leap") diff --git a/lua/lazyvim/plugins/extras/editor/mini-files.lua b/lua/lazyvim/plugins/extras/editor/mini-files.lua index cc829bb5..344981c3 100644 --- a/lua/lazyvim/plugins/extras/editor/mini-files.lua +++ b/lua/lazyvim/plugins/extras/editor/mini-files.lua @@ -18,7 +18,7 @@ return { function() require("mini.files").open(vim.api.nvim_buf_get_name(0), true) end, - desc = "Open mini.files (directory of current file)", + desc = "Open mini.files (Directory of Current File)", }, { "fM", @@ -50,7 +50,7 @@ return { callback = function(args) local buf_id = args.data.buf_id -- Tweak left-hand side of mapping to your liking - vim.keymap.set("n", "g.", toggle_dotfiles, { buffer = buf_id, desc = "Toggle hidden files" }) + vim.keymap.set("n", "g.", toggle_dotfiles, { buffer = buf_id, desc = "Toggle Hidden Files" }) end, }) diff --git a/lua/lazyvim/plugins/extras/lang/rust.lua b/lua/lazyvim/plugins/extras/lang/rust.lua index 397b6fc2..613bc0f7 100644 --- a/lua/lazyvim/plugins/extras/lang/rust.lua +++ b/lua/lazyvim/plugins/extras/lang/rust.lua @@ -52,7 +52,7 @@ return { end, { desc = "Code Action", buffer = bufnr }) vim.keymap.set("n", "dr", function() vim.cmd.RustLsp("debuggables") - end, { desc = "Rust debuggables", buffer = bufnr }) + end, { desc = "Rust Debuggables", buffer = bufnr }) end, default_settings = { -- rust-analyzer language server configuration diff --git a/lua/lazyvim/plugins/extras/util/gitui.lua b/lua/lazyvim/plugins/extras/util/gitui.lua index 53869c33..588cdbfd 100644 --- a/lua/lazyvim/plugins/extras/util/gitui.lua +++ b/lua/lazyvim/plugins/extras/util/gitui.lua @@ -8,12 +8,12 @@ return { function() LazyVim.terminal.open({ "gitui" }, { esc_esc = false, ctrl_hjkl = false }) end, - desc = "gitui (cwd)" }, + desc = "GitUi (cwd)" }, { "gg", function() LazyVim.terminal.open({ "gitui" }, { cwd = LazyVim.root.get(), esc_esc = false, ctrl_hjkl = false }) end, - desc = "gitui (root dir)" } + desc = "GitUi (Root Dir)" } }, opts = function(_, opts) opts.ensure_installed = opts.ensure_installed or {} diff --git a/lua/lazyvim/plugins/treesitter.lua b/lua/lazyvim/plugins/treesitter.lua index 30130dc6..108582ff 100644 --- a/lua/lazyvim/plugins/treesitter.lua +++ b/lua/lazyvim/plugins/treesitter.lua @@ -45,8 +45,8 @@ return { }, cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" }, keys = { - { "", desc = "Increment selection" }, - { "", desc = "Decrement selection", mode = "x" }, + { "", desc = "Increment Selection" }, + { "", desc = "Decrement Selection", mode = "x" }, }, ---@type TSConfig ---@diagnostic disable-next-line: missing-fields diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index f71a43a6..47fb4280 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -8,7 +8,7 @@ return { function() require("notify").dismiss({ silent = true, pending = true }) end, - desc = "Dismiss all Notifications", + desc = "Dismiss All Notifications", }, }, opts = { @@ -58,15 +58,15 @@ return { "akinsho/bufferline.nvim", event = "VeryLazy", keys = { - { "bp", "BufferLineTogglePin", desc = "Toggle pin" }, - { "bP", "BufferLineGroupClose ungrouped", desc = "Delete non-pinned buffers" }, - { "bo", "BufferLineCloseOthers", desc = "Delete other buffers" }, - { "br", "BufferLineCloseRight", desc = "Delete buffers to the right" }, - { "bl", "BufferLineCloseLeft", desc = "Delete buffers to the left" }, - { "", "BufferLineCyclePrev", desc = "Prev buffer" }, - { "", "BufferLineCycleNext", desc = "Next buffer" }, - { "[b", "BufferLineCyclePrev", desc = "Prev buffer" }, - { "]b", "BufferLineCycleNext", desc = "Next buffer" }, + { "bp", "BufferLineTogglePin", desc = "Toggle Pin" }, + { "bP", "BufferLineGroupClose ungrouped", desc = "Delete Non-Pinned Buffers" }, + { "bo", "BufferLineCloseOthers", desc = "Delete Other Buffers" }, + { "br", "BufferLineCloseRight", desc = "Delete Buffers to the Right" }, + { "bl", "BufferLineCloseLeft", desc = "Delete Buffers to the Left" }, + { "", "BufferLineCyclePrev", desc = "Prev Buffer" }, + { "", "BufferLineCycleNext", desc = "Next Buffer" }, + { "[b", "BufferLineCyclePrev", desc = "Prev Buffer" }, + { "]b", "BufferLineCycleNext", desc = "Next Buffer" }, }, opts = { options = { @@ -322,8 +322,8 @@ return { { "snh", function() require("noice").cmd("history") end, desc = "Noice History" }, { "sna", function() require("noice").cmd("all") end, desc = "Noice All" }, { "snd", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" }, - { "", function() if not require("noice.lsp").scroll(4) then return "" end end, silent = true, expr = true, desc = "Scroll forward", mode = {"i", "n", "s"} }, - { "", function() if not require("noice.lsp").scroll(-4) then return "" end end, silent = true, expr = true, desc = "Scroll backward", mode = {"i", "n", "s"}}, + { "", function() if not require("noice.lsp").scroll(4) then return "" end end, silent = true, expr = true, desc = "Scroll Forward", mode = {"i", "n", "s"} }, + { "", function() if not require("noice.lsp").scroll(-4) then return "" end end, silent = true, expr = true, desc = "Scroll Backward", mode = {"i", "n", "s"}}, }, }, @@ -372,10 +372,10 @@ return { header = vim.split(logo, "\n"), -- stylua: ignore center = { - { action = LazyVim.telescope("files"), desc = " Find file", icon = " ", key = "f" }, - { action = "ene | startinsert", desc = " New file", icon = " ", key = "n" }, - { action = "Telescope oldfiles", desc = " Recent files", icon = " ", key = "r" }, - { action = "Telescope live_grep", desc = " Find text", icon = " ", key = "g" }, + { action = LazyVim.telescope("files"), desc = " Find File", icon = " ", key = "f" }, + { action = "ene | startinsert", desc = " New File", icon = " ", key = "n" }, + { action = "Telescope oldfiles", desc = " Recent Files", icon = " ", key = "r" }, + { action = "Telescope live_grep", desc = " Find Text", icon = " ", key = "g" }, { action = [[lua LazyVim.telescope.config_files()()]], desc = " Config", icon = " ", key = "c" }, { action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" }, { action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" }, diff --git a/lua/lazyvim/util/telescope.lua b/lua/lazyvim/util/telescope.lua index 641c751a..bb030627 100644 --- a/lua/lazyvim/util/telescope.lua +++ b/lua/lazyvim/util/telescope.lua @@ -47,7 +47,7 @@ function M.telescope(builtin, opts) ---@diagnostic disable-next-line: inject-field opts.attach_mappings = function(_, map) -- opts.desc is overridden by telescope, until it's changed there is this fix - map("i", "", open_cwd_dir, { desc = "Open cwd directory" }) + map("i", "", open_cwd_dir, { desc = "Open cwd Directory" }) return true end end From 2a8bfccc3ef4020a30654b3dee1ffac51e4f64f3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 27 Mar 2024 07:57:14 +0000 Subject: [PATCH 151/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index d0bfca70..7645b584 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 26 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 27 ============================================================================== Table of Contents *LazyVim-table-of-contents* From ce5917a58965b47ed09462ddb5d160dee2b130ae Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 27 Mar 2024 10:20:51 +0100 Subject: [PATCH 152/526] fix(lazygit): error handling for getting lazygit's config path --- lua/lazyvim/util/lazygit.lua | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/util/lazygit.lua b/lua/lazyvim/util/lazygit.lua index c51af485..0b751f68 100644 --- a/lua/lazyvim/util/lazygit.lua +++ b/lua/lazyvim/util/lazygit.lua @@ -38,8 +38,22 @@ function M.open(opts) if M.dirty then M.update_config() end - M.config_dir = M.config_dir or vim.trim(vim.fn.system("lazygit -cd")) - vim.env.LG_CONFIG_FILE = M.config_dir .. "/config.yml" .. "," .. M.theme_path + + if not M.config_dir then + local Process = require("lazy.manage.process") + local ok, lines = pcall(Process.exec, { "lazygit", "-cd" }) + if ok then + M.config_dir = lines[1] + vim.env.LG_CONFIG_FILE = M.config_dir .. "/config.yml" .. "," .. M.theme_path + else + ---@diagnostic disable-next-line: cast-type-mismatch + ---@cast lines string + LazyVim.error( + { "Failed to get **lazygit** config directory.", "Will not apply **lazygit** config.", "", "# Error:", lines }, + { title = "lazygit" } + ) + end + end end return LazyVim.terminal(cmd, opts) From 6ed771de9dd3b14de78e83ed1c62b4f4fcee3c03 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 27 Mar 2024 10:43:32 +0100 Subject: [PATCH 153/526] fix(lazygit): use `Visual` instead of `CursorLine` for selected line. Fixes #2846 --- lua/lazyvim/util/lazygit.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/lazygit.lua b/lua/lazyvim/util/lazygit.lua index 0b751f68..94a561a2 100644 --- a/lua/lazyvim/util/lazygit.lua +++ b/lua/lazyvim/util/lazygit.lua @@ -76,7 +76,7 @@ function M.update_config() inactiveBorderColor = { LazyVim.ui.color("FloatBorder") or "blue" }, optionsTextColor = { "blue" }, searchingActiveBorderColor = { LazyVim.ui.color("MatchParen") or "orange", "bold" }, - selectedLineBgColor = { LazyVim.ui.color("CursorLine", true) }, -- set to `default` to have no background colour + selectedLineBgColor = { LazyVim.ui.color("Visual", true) }, -- set to `default` to have no background colour unstagedChangesColor = { "red" }, } local config = [[ From bb1480a6b9ca9e524450192423eac88ba2a32e18 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 27 Mar 2024 11:18:44 +0100 Subject: [PATCH 154/526] feat(lazygit): allow customizing the lazygit theme. Check the code to change the hl group mapping. Fixes #2846 --- lua/lazyvim/util/lazygit.lua | 70 ++++++++++++++++++++++++++++-------- 1 file changed, 55 insertions(+), 15 deletions(-) diff --git a/lua/lazyvim/util/lazygit.lua b/lua/lazyvim/util/lazygit.lua index 94a561a2..7a7af81e 100644 --- a/lua/lazyvim/util/lazygit.lua +++ b/lua/lazyvim/util/lazygit.lua @@ -7,6 +7,31 @@ local M = setmetatable({}, { end, }) +---@alias LazyGitColor {fg?:string, bg?:string, bold?:boolean} + +---@class LazyGitTheme: table +---@field activeBorderColor LazyGitColor +---@field cherryPickedCommitBgColor LazyGitColor +---@field cherryPickedCommitFgColor LazyGitColor +---@field defaultFgColor LazyGitColor +---@field inactiveBorderColor LazyGitColor +---@field optionsTextColor LazyGitColor +---@field searchingActiveBorderColor LazyGitColor +---@field selectedLineBgColor LazyGitColor +---@field unstagedChangesColor LazyGitColor +M.theme = { + [241] = { fg = "Special" }, + activeBorderColor = { fg = "MatchParen", bold = true }, + cherryPickedCommitBgColor = { fg = "Identifier" }, + cherryPickedCommitFgColor = { fg = "Function" }, + defaultFgColor = { fg = "Normal" }, + inactiveBorderColor = { fg = "FloatBorder" }, + optionsTextColor = { fg = "Function" }, + searchingActiveBorderColor = { fg = "MatchParen", bold = true }, + selectedLineBgColor = { bg = "Visual" }, -- set to `default` to have no background colour + unstagedChangesColor = { fg = "DiagnosticError" }, +} + M.theme_path = vim.fn.stdpath("cache") .. "/lazygit-theme.yml" -- re-create config file on startup @@ -63,22 +88,37 @@ function M.set_ansi_color(idx, color) io.write(("\27]4;%d;%s\7"):format(idx, color)) end -function M.update_config() - -- LazyGit uses color 241 a lot, so also set it to a nice color - -- pcall, since some terminals don't like this - pcall(M.set_ansi_color, 241, LazyVim.ui.color("Special") or "blue") +---@param v LazyGitColor +---@return string[] +function M.get_color(v) + ---@type string[] + local color = {} + if v.fg then + color[1] = LazyVim.ui.color(v.fg) + elseif v.bg then + color[1] = LazyVim.ui.color(v.bg, true) + end + if v.bold then + table.insert(color, "bold") + end + return color +end + +function M.update_config() + ---@type table + local theme = {} + + for k, v in pairs(M.theme) do + if type(k) == "number" then + local color = M.get_color(v) + -- LazyGit uses color 241 a lot, so also set it to a nice color + -- pcall, since some terminals don't like this + pcall(M.set_ansi_color, k, color[1]) + else + theme[k] = M.get_color(v) + end + end - local theme = { - activeBorderColor = { LazyVim.ui.color("MatchParen") or "orange", "bold" }, - cherryPickedCommitBgColor = { "cyan" }, - cherryPickedCommitFgColor = { "blue" }, - defaultFgColor = { "default" }, - inactiveBorderColor = { LazyVim.ui.color("FloatBorder") or "blue" }, - optionsTextColor = { "blue" }, - searchingActiveBorderColor = { LazyVim.ui.color("MatchParen") or "orange", "bold" }, - selectedLineBgColor = { LazyVim.ui.color("Visual", true) }, -- set to `default` to have no background colour - unstagedChangesColor = { "red" }, - } local config = [[ os: editPreset: "nvim-remote" From d945137a323c6c0200af50444981c7d05ed93f3f Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Wed, 27 Mar 2024 06:23:26 -0400 Subject: [PATCH 155/526] fix(python-semshi): better highlights (#2839) --- lua/lazyvim/plugins/extras/lang/python-semshi.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/python-semshi.lua b/lua/lazyvim/plugins/extras/lang/python-semshi.lua index e4e32c10..2e6df6f9 100644 --- a/lua/lazyvim/plugins/extras/lang/python-semshi.lua +++ b/lua/lazyvim/plugins/extras/lang/python-semshi.lua @@ -16,15 +16,16 @@ return { callback = function() -- Only add style, inherit or link to the LSP's colors vim.cmd([[ - highlight! semshiGlobal gui=italic + highlight! link semshiGlobal @none highlight! link semshiImported @none highlight! link semshiParameter @lsp.type.parameter - highlight! link semshiParameterUnused DiagnosticUnnecessary highlight! link semshiBuiltin @function.builtin highlight! link semshiAttribute @field highlight! link semshiSelf @lsp.type.selfKeyword - highlight! link semshiUnresolved @lsp.type.unresolvedReference + highlight! link semshiUnresolved @none highlight! link semshiFree @none + highlight! link semshiAttribute @none + highlight! link semshiParameterUnused @none ]]) end, }) From c901640167ec5b123ff8524b01518c9a370a0d31 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 27 Mar 2024 11:28:17 +0100 Subject: [PATCH 156/526] chore(main): release 10.19.0 (#2835) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 16 ++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 516c1434..00a3861d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [10.19.0](https://github.com/LazyVim/LazyVim/compare/v10.18.0...v10.19.0) (2024-03-27) + + +### Features + +* **lazygit:** allow customizing the lazygit theme. Check the code to change the hl group mapping. Fixes [#2846](https://github.com/LazyVim/LazyVim/issues/2846) ([bb1480a](https://github.com/LazyVim/LazyVim/commit/bb1480a6b9ca9e524450192423eac88ba2a32e18)) + + +### Bug Fixes + +* **autocmds:** auto create directory on windows for uris. Fixes [#2442](https://github.com/LazyVim/LazyVim/issues/2442) ([7d570fa](https://github.com/LazyVim/LazyVim/commit/7d570fad7949288711c6238468add594963cabaa)) +* **keymaps:** update all keymap descriptions to be Title Case ([#2844](https://github.com/LazyVim/LazyVim/issues/2844)) ([eb9f9a8](https://github.com/LazyVim/LazyVim/commit/eb9f9a8862983abe1c7dd51f5f6bf2bd6978346f)) +* **lazygit:** error handling for getting lazygit's config path ([ce5917a](https://github.com/LazyVim/LazyVim/commit/ce5917a58965b47ed09462ddb5d160dee2b130ae)) +* **lazygit:** use `Visual` instead of `CursorLine` for selected line. Fixes [#2846](https://github.com/LazyVim/LazyVim/issues/2846) ([6ed771d](https://github.com/LazyVim/LazyVim/commit/6ed771de9dd3b14de78e83ed1c62b4f4fcee3c03)) +* **python-semshi:** better highlights ([#2839](https://github.com/LazyVim/LazyVim/issues/2839)) ([d945137](https://github.com/LazyVim/LazyVim/commit/d945137a323c6c0200af50444981c7d05ed93f3f)) + ## [10.18.0](https://github.com/LazyVim/LazyVim/compare/v10.17.3...v10.18.0) (2024-03-26) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index c1b14714..d1cb3e57 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "10.18.0" -- x-release-please-version +M.version = "10.19.0" -- x-release-please-version ---@class LazyVimOptions local defaults = { From e3075b05ef9646e07639ae896bd8896f68ad5d5f Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 27 Mar 2024 15:04:22 +0100 Subject: [PATCH 157/526] fix(config): type filter was broken for telescope symbols --- lua/lazyvim/config/init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index d1cb3e57..725e395a 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -221,6 +221,9 @@ function M.get_kind_filter(buf) if M.kind_filter[ft] == false then return end + if type(M.kind_filter[ft]) == "table" then + return M.kind_filter[ft] + end ---@diagnostic disable-next-line: return-type-mismatch return type(M.kind_filter) == "table" and type(M.kind_filter.default) == "table" and M.kind_filter.default or nil end From cfbd3582736286433ee5532e1ea3a8d05a1e2649 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 27 Mar 2024 16:54:38 +0100 Subject: [PATCH 158/526] fix(nvim-lint): don't duplicate linters. Fixes #2852 --- lua/lazyvim/plugins/linting.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/lazyvim/plugins/linting.lua b/lua/lazyvim/plugins/linting.lua index caeaf6ec..c532e59b 100644 --- a/lua/lazyvim/plugins/linting.lua +++ b/lua/lazyvim/plugins/linting.lua @@ -11,6 +11,7 @@ return { -- ['*'] = { 'global linter' }, -- Use the "_" filetype to run linters on filetypes that don't have other linters configured. -- ['_'] = { 'fallback linter' }, + -- ["*"] = { "typos" }, }, -- LazyVim extension to easily override linter options -- or add custom linters. @@ -57,6 +58,9 @@ return { -- * this differs from conform.nvim which only uses the first filetype that has a formatter local names = lint._resolve_linter_by_ft(vim.bo.filetype) + -- Create a copy of the names table to avoid modifying the original. + names = vim.list_extend({}, names) + -- Add fallback linters. if #names == 0 then vim.list_extend(names, lint.linters_by_ft["_"] or {}) From bf8ce8076e283ecabce6b2f2a04995b3deeeb593 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 28 Mar 2024 21:32:09 +0100 Subject: [PATCH 159/526] feat(cmp): added option `auto_brackets` that adds brackets to functions/methods in configured filetypes --- lua/lazyvim/plugins/coding.lua | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 9a00a8c9..0823c12e 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -10,11 +10,22 @@ return { "hrsh7th/cmp-buffer", "hrsh7th/cmp-path", }, + -- Not all LSP servers add brackets when completing a function. + -- To better deal with this, LazyVim adds a custom option to cmp, + -- that you can configure. For example: + -- + -- ```lua + -- opts = { + -- auto_brackets = { "python" } + -- } + -- ``` + opts = function() vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true }) local cmp = require("cmp") local defaults = require("cmp.config.default")() return { + auto_brackets = {}, -- configure any filetype to auto add brackets completion = { completeopt = "menu,menuone,noinsert", }, @@ -58,12 +69,25 @@ return { sorting = defaults.sorting, } end, - ---@param opts cmp.ConfigSchema + ---@param opts cmp.ConfigSchema | {auto_brackets?: string[]} config = function(_, opts) for _, source in ipairs(opts.sources) do source.group_index = source.group_index or 1 end - require("cmp").setup(opts) + local cmp = require("cmp") + local Kind = cmp.lsp.CompletionItemKind + cmp.setup(opts) + cmp.event:on("confirm_done", function(event) + if not vim.tbl_contains(opts.auto_brackets or {}, vim.bo.filetype) then + return + end + local entry = event.entry + local item = entry:get_completion_item() + if vim.tbl_contains({ Kind.Function, Kind.Method }, item.kind) then + local keys = vim.api.nvim_replace_termcodes("()", false, false, true) + vim.api.nvim_feedkeys(keys, "i", true) + end + end) end, }, From d95c2ba1dc75307b154c870aa808f322debc6070 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 28 Mar 2024 21:32:37 +0100 Subject: [PATCH 160/526] feat(python): enable auto_brackets for python, since pyright and basedpyright dont support this natively --- lua/lazyvim/plugins/extras/lang/python.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index c2843503..bc1e28cf 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -108,4 +108,11 @@ return { end, keys = { { "cv", ":VenvSelect", desc = "Select VirtualEnv" } }, }, + { + "hrsh7th/nvim-cmp", + opts = function(_, opts) + opts.auto_brackets = opts.auto_brackets or {} + table.insert(opts.auto_brackets, "python") + end, + }, } From dd54a29cc53221765cc22332d8ebfcdc3677473a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 28 Mar 2024 20:33:40 +0000 Subject: [PATCH 161/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 7645b584..ec1712fc 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 27 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 28 ============================================================================== Table of Contents *LazyVim-table-of-contents* @@ -8,6 +8,7 @@ Table of Contents *LazyVim-table-of-contents* - Getting Started |LazyVim-getting-started| - File Structure |LazyVim-file-structure| - Configuration |LazyVim-configuration| +1. Links |LazyVim-links| Install · From bb6aa98cbfe0547150be89dc42f35e3b3eef8b5d Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 28 Mar 2024 22:11:51 +0100 Subject: [PATCH 162/526] feat(extras): added extra for the `trouble.nvim` v3 beta --- NEWS.md | 4 ++ .../plugins/extras/editor/trouble-v3.lua | 71 +++++++++++++++++++ lua/lazyvim/plugins/extras/ui/edgy.lua | 6 -- lua/lazyvim/plugins/xtras.lua | 1 + 4 files changed, 76 insertions(+), 6 deletions(-) create mode 100644 lua/lazyvim/plugins/extras/editor/trouble-v3.lua diff --git a/NEWS.md b/NEWS.md index d301ca14..5aabce42 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,10 @@ ## 10.x +- **trouble.nvim** has been rewritten from scratch and is now in beta. + I've added a new extra for it (`trouble-v3`) for those of you who want to try it out. + You can find the updated docs [here](https://github.com/folke/trouble.nvim/tree/dev) + - The **lazygit** integration now configures: - the theme based on the colorscheme diff --git a/lua/lazyvim/plugins/extras/editor/trouble-v3.lua b/lua/lazyvim/plugins/extras/editor/trouble-v3.lua new file mode 100644 index 00000000..0de564b5 --- /dev/null +++ b/lua/lazyvim/plugins/extras/editor/trouble-v3.lua @@ -0,0 +1,71 @@ +local Config = require("lazyvim.config") + +for _, other in ipairs({ "aerial", "outline" }) do + local extra = "lazyvim.plugins.extras.editor." .. other + if vim.tbl_contains(Config.json.data.extras, extra) then + other = other:gsub("^%l", string.upper) + LazyVim.error({ + "**Trouble v3** includes support for document symbols.", + ("You currently have the **%s** extra enabled."):format(other), + "Please disable it in your config.", + }) + end +end + +return { + { + "folke/trouble.nvim", + branch = "dev", + keys = { + { "xx", "Trouble diagnostics toggle", desc = "Diagnostics (Trouble)" }, + { "xX", "Trouble diagnostics toggle filter.buf=0", desc = "Buffer Diagnostics (Trouble)" }, + { "cs", "Trouble symbols toggle focus=false", desc = "Symbols (Trouble)" }, + { "xL", "Trouble loclist toggle", desc = "Location List (Trouble)" }, + { "xQ", "Trouble qflist toggle", desc = "Quickfix List (Trouble)" }, + }, + }, + + -- lualine integration + { + "nvim-lualine/lualine.nvim", + optional = true, + opts = function(_, opts) + local trouble = require("trouble") + local symbols = trouble.statusline({ + mode = "lsp_document_symbols", + groups = {}, + title = false, + filter = { range = true }, + format = "{kind_icon}{symbol.name:Normal}", + }) + table.insert(opts.sections.lualine_c, { + symbols.get, + cond = symbols.has, + }) + end, + }, + + { + "folke/edgy.nvim", + optional = true, + opts = function(_, opts) + -- disable for now + do + return + end + for _, pos in ipairs({ "top", "bottom", "left", "right" }) do + opts[pos] = opts[pos] or {} + table.insert(opts[pos], { + ft = "trouble", + filter = function(_buf, win) + return vim.w[win].trouble + and vim.w[win].trouble.position == pos + and vim.w[win].trouble.type == "split" + and vim.w[win].trouble.relative == "editor" + and not vim.w[win].trouble_preview + end, + }) + end + end, + }, +} diff --git a/lua/lazyvim/plugins/extras/ui/edgy.lua b/lua/lazyvim/plugins/extras/ui/edgy.lua index e2513828..1a9c5e12 100644 --- a/lua/lazyvim/plugins/extras/ui/edgy.lua +++ b/lua/lazyvim/plugins/extras/ui/edgy.lua @@ -40,12 +40,6 @@ return { end, }, "Trouble", - { - ft = "trouble", - filter = function(buf, win) - return vim.api.nvim_win_get_config(win).relative == "" - end, - }, { ft = "qf", title = "QuickFix" }, { ft = "help", diff --git a/lua/lazyvim/plugins/xtras.lua b/lua/lazyvim/plugins/xtras.lua index a130da1e..39a561a1 100644 --- a/lua/lazyvim/plugins/xtras.lua +++ b/lua/lazyvim/plugins/xtras.lua @@ -4,6 +4,7 @@ local Config = require("lazyvim.config") local prios = { ["lazyvim.plugins.extras.editor.aerial"] = 100, ["lazyvim.plugins.extras.editor.outline"] = 100, + ["lazyvim.plugins.extras.editor.trouble-v3"] = 100, ["lazyvim.plugins.extras.test.core"] = 1, ["lazyvim.plugins.extras.dap.core"] = 1, } From 9a2f7730907fd9124ec536f8dc2ad0a253f18f36 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 28 Mar 2024 22:48:09 +0100 Subject: [PATCH 163/526] fix(trouble): show message if use hasnt updated with Lazy yet after enabling the extra --- lua/lazyvim/plugins/extras/editor/trouble-v3.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/trouble-v3.lua b/lua/lazyvim/plugins/extras/editor/trouble-v3.lua index 0de564b5..a5487888 100644 --- a/lua/lazyvim/plugins/extras/editor/trouble-v3.lua +++ b/lua/lazyvim/plugins/extras/editor/trouble-v3.lua @@ -31,6 +31,11 @@ return { optional = true, opts = function(_, opts) local trouble = require("trouble") + if not trouble.statusline then + LazyVim.error("You have enabled the **trouble-v3** extra,\nbut still need to update it with `:Lazy`") + return + end + local symbols = trouble.statusline({ mode = "lsp_document_symbols", groups = {}, From a786c471df5c048690618b6ff17fa2bc9648891d Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 28 Mar 2024 23:25:06 +0100 Subject: [PATCH 164/526] fix(statuscolumn): right align signs when virtnum > 0 --- lua/lazyvim/util/ui.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/lazyvim/util/ui.lua b/lua/lazyvim/util/ui.lua index a65eabbb..dc0ccfbe 100644 --- a/lua/lazyvim/util/ui.lua +++ b/lua/lazyvim/util/ui.lua @@ -136,6 +136,10 @@ function M.statuscolumn() components[2] = "%=" .. components[2] .. " " -- right align end + if vim.v.virtnum ~= 0 then + components[2] = "%= " + end + return table.concat(components, "") end From e29c7acd2d149da8166f2f44c920cc7d5c89971a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 28 Mar 2024 23:41:54 +0100 Subject: [PATCH 165/526] feat(extras): added extra for mini.diff --- NEWS.md | 4 ++ .../plugins/extras/editor/mini-diff.lua | 54 +++++++++++++++++++ lua/lazyvim/util/ui.lua | 2 +- 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 lua/lazyvim/plugins/extras/editor/mini-diff.lua diff --git a/NEWS.md b/NEWS.md index 5aabce42..1ca0ea62 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,10 @@ ## 10.x +- added new extra for [mini.diff](https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-diff.md) + This is a plugin similar to gitsigns but with a neat diff overlay + that can be toggled with `go`. + - **trouble.nvim** has been rewritten from scratch and is now in beta. I've added a new extra for it (`trouble-v3`) for those of you who want to try it out. You can find the updated docs [here](https://github.com/folke/trouble.nvim/tree/dev) diff --git a/lua/lazyvim/plugins/extras/editor/mini-diff.lua b/lua/lazyvim/plugins/extras/editor/mini-diff.lua new file mode 100644 index 00000000..6e5040ad --- /dev/null +++ b/lua/lazyvim/plugins/extras/editor/mini-diff.lua @@ -0,0 +1,54 @@ +return { + -- disable gitsigns.nvim + { + "lewis6991/gitsigns.nvim", + enabled = false, + }, + + -- setup mini.diff + { + "echasnovski/mini.diff", + event = "VeryLazy", + keys = { + { + "go", + function() + require("mini.diff").toggle_overlay(0) + end, + desc = "Toggle mini.diff overlay", + }, + }, + opts = { + view = { + style = "sign", + signs = { + add = "▎", + change = "▎", + delete = "", + }, + }, + }, + }, + + -- lualine integration + { + "nvim-lualine/lualine.nvim", + opts = function(_, opts) + local x = opts.sections.lualine_x + for _, comp in ipairs(x) do + if comp[1] == "diff" then + comp.source = function() + local summary = vim.b.minidiff_summary + return summary + and { + added = summary.add, + modified = summary.change, + removed = summary.delete, + } + end + break + end + end + end, + }, +} diff --git a/lua/lazyvim/util/ui.lua b/lua/lazyvim/util/ui.lua index dc0ccfbe..91339ca7 100644 --- a/lua/lazyvim/util/ui.lua +++ b/lua/lazyvim/util/ui.lua @@ -103,7 +103,7 @@ function M.statuscolumn() ---@type Sign?,Sign?,Sign? local left, right, fold for _, s in ipairs(M.get_signs(buf, vim.v.lnum)) do - if s.name and s.name:find("GitSign") then + if s.name and (s.name:find("GitSign") or s.name:find("MiniDiffSign")) then right = s else left = s From 8f1fb60f0a78cb2e83b485e1f946822812c5ff50 Mon Sep 17 00:00:00 2001 From: ammon134 <113684938+ammon134@users.noreply.github.com> Date: Fri, 29 Mar 2024 05:49:48 +0700 Subject: [PATCH 166/526] feat(extras): use mini.move instead of native move (#2865) --- .../plugins/extras/editor/mini-move.lua | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/editor/mini-move.lua diff --git a/lua/lazyvim/plugins/extras/editor/mini-move.lua b/lua/lazyvim/plugins/extras/editor/mini-move.lua new file mode 100644 index 00000000..96cd129a --- /dev/null +++ b/lua/lazyvim/plugins/extras/editor/mini-move.lua @@ -0,0 +1,32 @@ +return { + { + "echasnovski/mini.move", + event = "VeryLazy", + opts = {}, + keys = function() + local ret = {} + local directions = { "left", "down", "up", "right" } + local keys = { "h", "j", "k", "l" } + local move = require("mini.move") + for i, dir in ipairs(directions) do + ret[#ret + 1] = { + "", + mode = { "i", "n" }, + function() + move.move_line(dir) + end, + } + end + for i, dir in ipairs(directions) do + ret[#ret + 1] = { + "", + mode = { "v" }, + function() + move.move_selection(dir) + end, + } + end + return ret + end, + }, +} From b26be293304da16eba099e25724384f334250dbb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 28 Mar 2024 23:51:31 +0100 Subject: [PATCH 167/526] chore(main): release 10.20.0 (#2849) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 19 +++++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00a3861d..67902e71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [10.20.0](https://github.com/LazyVim/LazyVim/compare/v10.19.0...v10.20.0) (2024-03-28) + + +### Features + +* **cmp:** added option `auto_brackets` that adds brackets to functions/methods in configured filetypes ([bf8ce80](https://github.com/LazyVim/LazyVim/commit/bf8ce8076e283ecabce6b2f2a04995b3deeeb593)) +* **extras:** added extra for mini.diff ([e29c7ac](https://github.com/LazyVim/LazyVim/commit/e29c7acd2d149da8166f2f44c920cc7d5c89971a)) +* **extras:** added extra for the `trouble.nvim` v3 beta ([bb6aa98](https://github.com/LazyVim/LazyVim/commit/bb6aa98cbfe0547150be89dc42f35e3b3eef8b5d)) +* **extras:** use mini.move instead of native move ([#2865](https://github.com/LazyVim/LazyVim/issues/2865)) ([8f1fb60](https://github.com/LazyVim/LazyVim/commit/8f1fb60f0a78cb2e83b485e1f946822812c5ff50)) +* **python:** enable auto_brackets for python, since pyright and basedpyright dont support this natively ([d95c2ba](https://github.com/LazyVim/LazyVim/commit/d95c2ba1dc75307b154c870aa808f322debc6070)) + + +### Bug Fixes + +* **config:** type filter was broken for telescope symbols ([e3075b0](https://github.com/LazyVim/LazyVim/commit/e3075b05ef9646e07639ae896bd8896f68ad5d5f)) +* **nvim-lint:** don't duplicate linters. Fixes [#2852](https://github.com/LazyVim/LazyVim/issues/2852) ([cfbd358](https://github.com/LazyVim/LazyVim/commit/cfbd3582736286433ee5532e1ea3a8d05a1e2649)) +* **statuscolumn:** right align signs when virtnum > 0 ([a786c47](https://github.com/LazyVim/LazyVim/commit/a786c471df5c048690618b6ff17fa2bc9648891d)) +* **trouble:** show message if use hasnt updated with Lazy yet after enabling the extra ([9a2f773](https://github.com/LazyVim/LazyVim/commit/9a2f7730907fd9124ec536f8dc2ad0a253f18f36)) + ## [10.19.0](https://github.com/LazyVim/LazyVim/compare/v10.18.0...v10.19.0) (2024-03-27) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 725e395a..91061a8f 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "10.19.0" -- x-release-please-version +M.version = "10.20.0" -- x-release-please-version ---@class LazyVimOptions local defaults = { From 4ca0bf69dd1e4a359af6894490f794bd5fc12cf0 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 28 Mar 2024 23:55:38 +0100 Subject: [PATCH 168/526] fix(trouble-v3): use the filtered symbols list for lualine --- lua/lazyvim/plugins/extras/editor/trouble-v3.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/trouble-v3.lua b/lua/lazyvim/plugins/extras/editor/trouble-v3.lua index a5487888..3b9a1d01 100644 --- a/lua/lazyvim/plugins/extras/editor/trouble-v3.lua +++ b/lua/lazyvim/plugins/extras/editor/trouble-v3.lua @@ -37,7 +37,7 @@ return { end local symbols = trouble.statusline({ - mode = "lsp_document_symbols", + mode = "symbols", groups = {}, title = false, filter = { range = true }, From 20b2806a8fa4862aa11cd6a443881368c54c65f1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 28 Mar 2024 23:57:49 +0100 Subject: [PATCH 169/526] chore(main): release 10.20.1 (#2869) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ lua/lazyvim/config/init.lua | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67902e71..de475165 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [10.20.1](https://github.com/LazyVim/LazyVim/compare/v10.20.0...v10.20.1) (2024-03-28) + + +### Bug Fixes + +* **trouble-v3:** use the filtered symbols list for lualine ([4ca0bf6](https://github.com/LazyVim/LazyVim/commit/4ca0bf69dd1e4a359af6894490f794bd5fc12cf0)) + ## [10.20.0](https://github.com/LazyVim/LazyVim/compare/v10.19.0...v10.20.0) (2024-03-28) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 91061a8f..94b4f0dd 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "10.20.0" -- x-release-please-version +M.version = "10.20.1" -- x-release-please-version ---@class LazyVimOptions local defaults = { From 3166236ff88a13e7e5b7579ae780b682f2356d62 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 29 Mar 2024 00:21:52 +0100 Subject: [PATCH 170/526] fix(mini.move): default mini.move setup already maps the correct keys --- .../plugins/extras/editor/mini-move.lua | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/mini-move.lua b/lua/lazyvim/plugins/extras/editor/mini-move.lua index 96cd129a..aa8823ef 100644 --- a/lua/lazyvim/plugins/extras/editor/mini-move.lua +++ b/lua/lazyvim/plugins/extras/editor/mini-move.lua @@ -3,30 +3,5 @@ return { "echasnovski/mini.move", event = "VeryLazy", opts = {}, - keys = function() - local ret = {} - local directions = { "left", "down", "up", "right" } - local keys = { "h", "j", "k", "l" } - local move = require("mini.move") - for i, dir in ipairs(directions) do - ret[#ret + 1] = { - "", - mode = { "i", "n" }, - function() - move.move_line(dir) - end, - } - end - for i, dir in ipairs(directions) do - ret[#ret + 1] = { - "", - mode = { "v" }, - function() - move.move_selection(dir) - end, - } - end - return ret - end, }, } From 754467525b420c85150f13b2cd9e280570c7556c Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 29 Mar 2024 07:27:43 +0100 Subject: [PATCH 171/526] feat(trouble): added `cS` to open a trouble list of all references / definitions / ... of the item under the cursor --- lua/lazyvim/plugins/extras/editor/trouble-v3.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/trouble-v3.lua b/lua/lazyvim/plugins/extras/editor/trouble-v3.lua index 3b9a1d01..ccdb96dc 100644 --- a/lua/lazyvim/plugins/extras/editor/trouble-v3.lua +++ b/lua/lazyvim/plugins/extras/editor/trouble-v3.lua @@ -20,6 +20,11 @@ return { { "xx", "Trouble diagnostics toggle", desc = "Diagnostics (Trouble)" }, { "xX", "Trouble diagnostics toggle filter.buf=0", desc = "Buffer Diagnostics (Trouble)" }, { "cs", "Trouble symbols toggle focus=false", desc = "Symbols (Trouble)" }, + { + "cS", + "Trouble lsp toggle focus=false win.position=right", + desc = "LSP references/definitions/... (Trouble)", + }, { "xL", "Trouble loclist toggle", desc = "Location List (Trouble)" }, { "xQ", "Trouble qflist toggle", desc = "Quickfix List (Trouble)" }, }, From 80a8b18be6577dcea35748eb563ebef7cf1b3c15 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 29 Mar 2024 07:27:55 +0100 Subject: [PATCH 172/526] feat(trouble): enabled edgy --- lua/lazyvim/plugins/extras/editor/trouble-v3.lua | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/trouble-v3.lua b/lua/lazyvim/plugins/extras/editor/trouble-v3.lua index ccdb96dc..98e2db4b 100644 --- a/lua/lazyvim/plugins/extras/editor/trouble-v3.lua +++ b/lua/lazyvim/plugins/extras/editor/trouble-v3.lua @@ -59,10 +59,6 @@ return { "folke/edgy.nvim", optional = true, opts = function(_, opts) - -- disable for now - do - return - end for _, pos in ipairs({ "top", "bottom", "left", "right" }) do opts[pos] = opts[pos] or {} table.insert(opts[pos], { From 3def2097ad3c20759cdec6db1d2292e24fb7afe9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 29 Mar 2024 06:28:38 +0000 Subject: [PATCH 173/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index ec1712fc..a88f4539 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 28 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 29 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 914f26d04e6b9a61f7d4fc80ad433d75dac3f14b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 29 Mar 2024 07:56:30 +0100 Subject: [PATCH 174/526] fix(tex): don't override conceallevel for tex. Not sure why that was added --- lua/lazyvim/plugins/extras/lang/tex.lua | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/tex.lua b/lua/lazyvim/plugins/extras/lang/tex.lua index e8d4feff..f8dacfb4 100644 --- a/lua/lazyvim/plugins/extras/lang/tex.lua +++ b/lua/lazyvim/plugins/extras/lang/tex.lua @@ -28,14 +28,6 @@ return { "lervag/vimtex", lazy = false, -- lazy-loading will disable inverse search config = function() - vim.api.nvim_create_autocmd({ "FileType" }, { - group = vim.api.nvim_create_augroup("lazyvim_vimtex_conceal", { clear = true }), - pattern = { "bib", "tex" }, - callback = function() - vim.wo.conceallevel = 2 - end, - }) - vim.g.vimtex_mappings_disable = { ["n"] = { "K" } } -- disable `K` as it conflicts with LSP hover vim.g.vimtex_quickfix_method = vim.fn.executable("pplatex") == 1 and "pplatex" or "latexlog" end, From 0af1fd82d70759aef3c2fe4c8d974329e238761d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 29 Mar 2024 08:19:18 +0100 Subject: [PATCH 175/526] chore(main): release 10.21.0 (#2870) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 14 ++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de475165..53f64474 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [10.21.0](https://github.com/LazyVim/LazyVim/compare/v10.20.1...v10.21.0) (2024-03-29) + + +### Features + +* **trouble:** added `<leader>cS` to open a trouble list of all references / definitions / ... of the item under the cursor ([7544675](https://github.com/LazyVim/LazyVim/commit/754467525b420c85150f13b2cd9e280570c7556c)) +* **trouble:** enabled edgy ([80a8b18](https://github.com/LazyVim/LazyVim/commit/80a8b18be6577dcea35748eb563ebef7cf1b3c15)) + + +### Bug Fixes + +* **mini.move:** default mini.move setup already maps the correct keys ([3166236](https://github.com/LazyVim/LazyVim/commit/3166236ff88a13e7e5b7579ae780b682f2356d62)) +* **tex:** don't override conceallevel for tex. Not sure why that was added ([914f26d](https://github.com/LazyVim/LazyVim/commit/914f26d04e6b9a61f7d4fc80ad433d75dac3f14b)) + ## [10.20.1](https://github.com/LazyVim/LazyVim/compare/v10.20.0...v10.20.1) (2024-03-28) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 94b4f0dd..d6d5bc29 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "10.20.1" -- x-release-please-version +M.version = "10.21.0" -- x-release-please-version ---@class LazyVimOptions local defaults = { From f3088675703986b6d37061ebcf0a417c132fd45f Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 29 Mar 2024 09:18:38 +0100 Subject: [PATCH 176/526] fix(native_snippets): don't try to enable native snippets on Neovim < 0.10.0 and show warning --- lua/lazyvim/plugins/extras/coding/native_snippets.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/lazyvim/plugins/extras/coding/native_snippets.lua b/lua/lazyvim/plugins/extras/coding/native_snippets.lua index 72080c92..74b70784 100644 --- a/lua/lazyvim/plugins/extras/coding/native_snippets.lua +++ b/lua/lazyvim/plugins/extras/coding/native_snippets.lua @@ -1,3 +1,8 @@ +if not vim.snippet then + LazyVim.warn("Native snippets are only supported on Neovim >= 0.10.0") + return {} +end + return { desc = "Use native snippets instead of LuaSnip. Only works on Neovim >= 0.10!", { From 349ae03f0997d20aa6b4a23315e62dfeab77d559 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 29 Mar 2024 09:45:31 +0100 Subject: [PATCH 177/526] fix: merge conflict --- lua/lazyvim/config/init.lua | 3 ++- lua/lazyvim/util/init.lua | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index d6d5bc29..a5e45dc0 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,8 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "10.21.0" -- x-release-please-version +M.version = "10.20.1" -- x-release-please-version +LazyVim.config = M ---@class LazyVimOptions local defaults = { diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index 93abe101..f343c338 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -1,6 +1,7 @@ local LazyUtil = require("lazy.core.util") ---@class lazyvim.util: LazyUtilCore +---@field config LazyVimConfig ---@field ui lazyvim.util.ui ---@field lsp lazyvim.util.lsp ---@field root lazyvim.util.root From 64f86147f9f4c67548185798f755c80e03c2098a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 29 Mar 2024 09:20:02 +0100 Subject: [PATCH 178/526] fix(lsp): dont define diagnostics signs on >= 0.10.0 --- lua/lazyvim/plugins/lsp/init.lua | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index f353e28b..a585d6b1 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -26,10 +26,10 @@ return { severity_sort = true, signs = { text = { - [vim.diagnostic.severity.ERROR] = require("lazyvim.config").icons.diagnostics.Error, - [vim.diagnostic.severity.WARN] = require("lazyvim.config").icons.diagnostics.Warn, - [vim.diagnostic.severity.HINT] = require("lazyvim.config").icons.diagnostics.Hint, - [vim.diagnostic.severity.INFO] = require("lazyvim.config").icons.diagnostics.Info, + [vim.diagnostic.severity.ERROR] = LazyVim.config.icons.diagnostics.Error, + [vim.diagnostic.severity.WARN] = LazyVim.config.icons.diagnostics.Warn, + [vim.diagnostic.severity.HINT] = LazyVim.config.icons.diagnostics.Hint, + [vim.diagnostic.severity.INFO] = LazyVim.config.icons.diagnostics.Info, }, }, }, @@ -124,10 +124,14 @@ return { return ret end - -- diagnostics - for name, icon in pairs(require("lazyvim.config").icons.diagnostics) do - name = "DiagnosticSign" .. name - vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) + -- diagnostics signs + if vim.fn.has("nvim-0.10.0") == 0 then + local text = vim.tbl_get(opts, "diagnostics", "signs", "text") or {} + for severity, icon in pairs(text) do + local name = vim.diagnostic.severity[severity]:lower():gsub("^%l", string.upper) + name = "DiagnosticSign" .. name + vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) + end end -- inlay hints From aaa10e717dbe76c5b6b0ab302698f1d151863dc6 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 29 Mar 2024 09:44:38 +0100 Subject: [PATCH 179/526] fix(lsp): better support for diagnostics icons on Neovim nightly/stable --- lua/lazyvim/plugins/lsp/init.lua | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index a585d6b1..c2a74ef5 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -12,6 +12,7 @@ return { ---@class PluginLspOpts opts = { -- options for vim.diagnostic.config() + ---@type vim.diagnostic.Opts diagnostics = { underline = true, update_in_insert = false, @@ -101,12 +102,6 @@ return { -- setup autoformat LazyVim.format.register(LazyVim.lsp.formatter()) - -- deprecated options - if opts.autoformat ~= nil then - vim.g.autoformat = opts.autoformat - LazyVim.deprecate("nvim-lspconfig.opts.autoformat", "vim.g.autoformat") - end - -- setup keymaps LazyVim.lsp.on_attach(function(client, buffer) require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer) @@ -115,10 +110,9 @@ return { local register_capability = vim.lsp.handlers["client/registerCapability"] vim.lsp.handlers["client/registerCapability"] = function(err, res, ctx) + ---@diagnostic disable-next-line: no-unknown local ret = register_capability(err, res, ctx) - local client_id = ctx.client_id - ---@type lsp.Client - local client = vim.lsp.get_client_by_id(client_id) + local client = vim.lsp.get_client_by_id(ctx.client_id) local buffer = vim.api.nvim_get_current_buf() require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer) return ret @@ -126,8 +120,7 @@ return { -- diagnostics signs if vim.fn.has("nvim-0.10.0") == 0 then - local text = vim.tbl_get(opts, "diagnostics", "signs", "text") or {} - for severity, icon in pairs(text) do + for severity, icon in pairs(opts.diagnostics.signs.text) do local name = vim.diagnostic.severity[severity]:lower():gsub("^%l", string.upper) name = "DiagnosticSign" .. name vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) From 5646ee5191da244ff8ea57b9dba8a7e0d1dbdd42 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 29 Mar 2024 10:08:37 +0100 Subject: [PATCH 180/526] chore(main): release 10.21.1 (#2873) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 10 ++++++++++ lua/lazyvim/config/init.lua | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53f64474..4e3109d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [10.21.1](https://github.com/LazyVim/LazyVim/compare/v10.21.0...v10.21.1) (2024-03-29) + + +### Bug Fixes + +* **lsp:** better support for diagnostics icons on Neovim nightly/stable ([aaa10e7](https://github.com/LazyVim/LazyVim/commit/aaa10e717dbe76c5b6b0ab302698f1d151863dc6)) +* **lsp:** dont define diagnostics signs on >= 0.10.0 ([64f8614](https://github.com/LazyVim/LazyVim/commit/64f86147f9f4c67548185798f755c80e03c2098a)) +* merge conflict ([349ae03](https://github.com/LazyVim/LazyVim/commit/349ae03f0997d20aa6b4a23315e62dfeab77d559)) +* **native_snippets:** don't try to enable native snippets on Neovim < 0.10.0 and show warning ([f308867](https://github.com/LazyVim/LazyVim/commit/f3088675703986b6d37061ebcf0a417c132fd45f)) + ## [10.21.0](https://github.com/LazyVim/LazyVim/compare/v10.20.1...v10.21.0) (2024-03-29) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index a5e45dc0..cea25f8b 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "10.20.1" -- x-release-please-version +M.version = "10.21.1" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 50b7f426f287ecfc542dd9c197e430b0aca8af04 Mon Sep 17 00:00:00 2001 From: Rubin Bhandari Date: Fri, 29 Mar 2024 19:36:56 +0545 Subject: [PATCH 181/526] fix(harpoon): optimizes harpoon keys (#2877) --- .../plugins/extras/editor/harpoon2.lua | 82 +++++++------------ 1 file changed, 30 insertions(+), 52 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/harpoon2.lua b/lua/lazyvim/plugins/extras/editor/harpoon2.lua index 0aecc1cd..666f7d58 100644 --- a/lua/lazyvim/plugins/extras/editor/harpoon2.lua +++ b/lua/lazyvim/plugins/extras/editor/harpoon2.lua @@ -6,56 +6,34 @@ return { width = vim.api.nvim_win_get_width(0) - 4, }, }, - keys = { - { - "H", - function() - require("harpoon"):list():append() - end, - desc = "Harpoon File", - }, - { - "h", - function() - local harpoon = require("harpoon") - harpoon.ui:toggle_quick_menu(harpoon:list()) - end, - desc = "Harpoon Quick Menu", - }, - { - "1", - function() - require("harpoon"):list():select(1) - end, - desc = "Harpoon to File 1", - }, - { - "2", - function() - require("harpoon"):list():select(2) - end, - desc = "Harpoon to File 2", - }, - { - "3", - function() - require("harpoon"):list():select(3) - end, - desc = "Harpoon to File 3", - }, - { - "4", - function() - require("harpoon"):list():select(4) - end, - desc = "Harpoon to File 4", - }, - { - "5", - function() - require("harpoon"):list():select(5) - end, - desc = "Harpoon to File 5", - }, - }, + keys = function() + local keys = { + { + "H", + function() + require("harpoon"):list():append() + end, + desc = "Harpoon File", + }, + { + "h", + function() + local harpoon = require("harpoon") + harpoon.ui:toggle_quick_menu(harpoon:list()) + end, + desc = "Harpoon Quick Menu", + } + } + + for i = 1, 5 do + table.insert(keys, { + "" .. i, + function() + require("harpoon"):list():select(i) + end, + desc = "Harpoon to File " .. i, + }) + end + return keys + end } From 97480dc5d2dbb717b45a351e0b04835f138a9094 Mon Sep 17 00:00:00 2001 From: Rubin Bhandari Date: Sat, 30 Mar 2024 02:55:03 +0545 Subject: [PATCH 182/526] feat(dot): add bashls and shellcheck (#2879) --- lua/lazyvim/plugins/extras/util/dot.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lua/lazyvim/plugins/extras/util/dot.lua b/lua/lazyvim/plugins/extras/util/dot.lua index 8ba24b51..cf5c048f 100644 --- a/lua/lazyvim/plugins/extras/util/dot.lua +++ b/lua/lazyvim/plugins/extras/util/dot.lua @@ -7,6 +7,23 @@ local function have(path) end return { + { + "neovim/nvim-lspconfig", + opts = { + servers = { + bashls = {}, + }, + }, + }, + { + "williamboman/mason.nvim", + opts = function(_, opts) + vim.list_extend(opts.ensure_installed or {}, { + "shfmt", + "shellcheck", + }) + end, + }, -- add some stuff to treesitter { "nvim-treesitter/nvim-treesitter", From 32eacde793fddcca0bcfbbd494b6aa8b2c870d0f Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 11 Apr 2024 17:23:17 +0200 Subject: [PATCH 183/526] fix(mini.pairs): better default for ```` --- lua/lazyvim/plugins/coding.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 0823c12e..3cdcc668 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -141,7 +141,11 @@ return { { "echasnovski/mini.pairs", event = "VeryLazy", - opts = {}, + opts = { + mappings = { + ["`"] = { action = "closeopen", pair = "``", neigh_pattern = "[^\\`].", register = { cr = false } }, + }, + }, keys = { { "up", From 9e3af1070fc1932da322105708ebb32a2cd9572b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 11 Apr 2024 17:23:46 +0200 Subject: [PATCH 184/526] feat(git): `gb` for Git Blame Line --- lua/lazyvim/config/keymaps.lua | 1 + lua/lazyvim/util/lazygit.lua | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 49f693c9..38c0ae4e 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -127,6 +127,7 @@ map("n", "ub", function() LazyVim.toggle("background", false, {"light", -- lazygit map("n", "gg", function() LazyVim.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" }) map("n", "gG", function() LazyVim.lazygit() end, { desc = "Lazygit (cwd)" }) +map("n", "gb", LazyVim.lazygit.blame_line, { desc = "Git Blame Line" }) map("n", "gf", function() local git_path = vim.api.nvim_buf_get_name(0) diff --git a/lua/lazyvim/util/lazygit.lua b/lua/lazyvim/util/lazygit.lua index 7a7af81e..1b0d3922 100644 --- a/lua/lazyvim/util/lazygit.lua +++ b/lua/lazyvim/util/lazygit.lua @@ -140,4 +140,22 @@ gui: M.dirty = false end +---@param opts? {count?: number}|LazyCmdOptions +function M.blame_line(opts) + opts = vim.tbl_deep_extend("force", { + count = 3, + filetype = "git", + size = { + width = 0.6, + height = 0.6, + }, + border = "rounded", + }, opts or {}) + local cursor = vim.api.nvim_win_get_cursor(0) + local line = cursor[1] - 1 + local file = vim.api.nvim_buf_get_name(0) + local cmd = { "git", "log", "-n", opts.count, "-u", "-L", line .. ",+1:" .. file } + return require("lazy.util").float_cmd(cmd, opts) +end + return M From bb36f71b77d8e15788a5b62c82a1c9ec7b209e49 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 11 Apr 2024 15:24:29 +0000 Subject: [PATCH 185/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index a88f4539..303c881e 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 29 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 April 11 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 74eb25d57918b371386139b113d5cfd18f170b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tuna=20Alika=C5=9Fifo=C4=9Flu?= Date: Mon, 22 Apr 2024 10:35:17 +0300 Subject: [PATCH 186/526] ci: update action versions to remove node warning (#3029) Since Node.js 16 actions are deprecated, and updating the actions to use Node.js 20 is recommended. All actions in `ci.yml` have a newer version, this change bumps the actions to next versions. --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51c47553..6b36e4c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Neovim shell: bash run: | @@ -31,7 +31,7 @@ jobs: needs: tests if: ${{ github.ref == 'refs/heads/main' }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: panvimdoc uses: kdheepak/panvimdoc@main with: @@ -40,7 +40,7 @@ jobs: demojify: true treesitter: true - name: Push changes - uses: stefanzweifel/git-auto-commit-action@v4 + uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: "chore(build): auto-generate vimdoc" commit_user_name: "github-actions[bot]" @@ -54,14 +54,14 @@ jobs: - tests runs-on: ubuntu-latest steps: - - uses: google-github-actions/release-please-action@v3 + - uses: google-github-actions/release-please-action@v4 id: release with: release-type: simple package-name: LazyVim extra-files: | lua/lazyvim/config/init.lua - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: tag stable versions if: ${{ steps.release.outputs.release_created }} run: | From 7834d77adaa9f1305923f791efed6556e981fe5f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 22 Apr 2024 07:35:47 +0000 Subject: [PATCH 187/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 303c881e..38e7d18d 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 April 11 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 April 22 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 5f92dc5304b99a3e76dca878d9b47557fb64f384 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis Date: Mon, 22 Apr 2024 10:36:05 +0300 Subject: [PATCH 188/526] fix(toggle): use new `inlay_hint.enable()` signature (#3013) --- lua/lazyvim/util/toggle.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index cb380d0d..a377064e 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -67,7 +67,7 @@ function M.inlay_hints(buf, value) if value == nil then value = not ih.is_enabled(buf) end - ih.enable(buf, value) + ih.enable(value, { bufnr = buf }) end end From cd04b58fe3f7299fbca75e7eb47287617ac23fcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ph=C3=BAc=20H=2E=20L=C3=AA=20Kh=E1=BA=AFc?= Date: Mon, 22 Apr 2024 08:40:09 +0100 Subject: [PATCH 189/526] feat(python): use new `ruff` instead of `ruff_lsp` (#3016) --- lua/lazyvim/plugins/extras/lang/python.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index bc1e28cf..b36fd80c 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -28,7 +28,7 @@ return { [lsp] = { enabled = true, }, - ruff_lsp = { + ruff = { keys = { { "co", @@ -47,9 +47,9 @@ return { }, }, setup = { - ruff_lsp = function() + ruff = function() LazyVim.lsp.on_attach(function(client, _) - if client.name == "ruff_lsp" then + if client.name == "ruff" then -- Disable hover in favor of Pyright client.server_capabilities.hoverProvider = false end From 79fed97f2357b2969cb23d106137978ca7cdffb4 Mon Sep 17 00:00:00 2001 From: Alan Alvarenga <48456822+alan-alvarenga-telus@users.noreply.github.com> Date: Mon, 22 Apr 2024 01:45:59 -0600 Subject: [PATCH 190/526] fix(harpoon): harpoon2 deprecated message (#2920) * fix(config): harpoon2 deprecated message when adding new file to list and fix auto save on file list toggle * fix: Update harpoon2.lua to add pleanery dep * fix: no need for plenary deps here --------- Co-authored-by: Alan Alvarenga Co-authored-by: Rubin Bhandari Co-authored-by: Folke Lemaitre --- lua/lazyvim/plugins/extras/editor/harpoon2.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/harpoon2.lua b/lua/lazyvim/plugins/extras/editor/harpoon2.lua index 666f7d58..760d805a 100644 --- a/lua/lazyvim/plugins/extras/editor/harpoon2.lua +++ b/lua/lazyvim/plugins/extras/editor/harpoon2.lua @@ -5,13 +5,16 @@ return { menu = { width = vim.api.nvim_win_get_width(0) - 4, }, + settings = { + save_on_toggle = true, + }, }, keys = function() local keys = { { "H", function() - require("harpoon"):list():append() + require("harpoon"):list():add() end, desc = "Harpoon File", }, @@ -22,7 +25,7 @@ return { harpoon.ui:toggle_quick_menu(harpoon:list()) end, desc = "Harpoon Quick Menu", - } + }, } for i = 1, 5 do @@ -35,5 +38,5 @@ return { }) end return keys - end + end, } From ceb4855b434c8e7095bbf47cfc3b3647532d6a2c Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis Date: Mon, 22 Apr 2024 10:48:05 +0300 Subject: [PATCH 191/526] fix(trouble_v3): show error only when `trouble_v3` is enabled (#2989) --- .../plugins/extras/editor/trouble-v3.lua | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/trouble-v3.lua b/lua/lazyvim/plugins/extras/editor/trouble-v3.lua index 98e2db4b..6c964909 100644 --- a/lua/lazyvim/plugins/extras/editor/trouble-v3.lua +++ b/lua/lazyvim/plugins/extras/editor/trouble-v3.lua @@ -1,14 +1,16 @@ local Config = require("lazyvim.config") -for _, other in ipairs({ "aerial", "outline" }) do - local extra = "lazyvim.plugins.extras.editor." .. other - if vim.tbl_contains(Config.json.data.extras, extra) then - other = other:gsub("^%l", string.upper) - LazyVim.error({ - "**Trouble v3** includes support for document symbols.", - ("You currently have the **%s** extra enabled."):format(other), - "Please disable it in your config.", - }) +if vim.tbl_contains(Config.json.data.extras, "lazyvim.plugins.extras.editor.trouble-v3") then + for _, other in ipairs({ "aerial", "outline" }) do + local extra = "lazyvim.plugins.extras.editor." .. other + if vim.tbl_contains(Config.json.data.extras, extra) then + other = other:gsub("^%l", string.upper) + LazyVim.error({ + "**Trouble v3** includes support for document symbols.", + ("You currently have the **%s** extra enabled."):format(other), + "Please disable it in your config.", + }) + end end end From 15b09e800ba7fb0c9ca8270a77e71083396e9db1 Mon Sep 17 00:00:00 2001 From: Rubin Bhandari Date: Mon, 22 Apr 2024 13:34:16 +0545 Subject: [PATCH 192/526] feat(dot): add more filetypes (#2987) Adds dotenv files support for file names like prod.env .env .env.xyz Also adds configurationfiletypes rofi, wofi and vimfmrc --- lua/lazyvim/plugins/extras/util/dot.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/util/dot.lua b/lua/lazyvim/plugins/extras/util/dot.lua index cf5c048f..26af6a9b 100644 --- a/lua/lazyvim/plugins/extras/util/dot.lua +++ b/lua/lazyvim/plugins/extras/util/dot.lua @@ -35,12 +35,17 @@ return { end vim.filetype.add({ - extension = { rasi = "rasi" }, + extension = { rasi = "rasi", rofi = "rasi", wofi = "rasi" }, + filename = { + [".env"] = "dotenv", + ["vifmrc"] = "vim", + }, pattern = { [".*/waybar/config"] = "jsonc", [".*/mako/config"] = "dosini", [".*/kitty/*.conf"] = "bash", [".*/hypr/.*%.conf"] = "hyprlang", + ["%.env%.[%w_.-]+"] = "dotenv", }, }) From 6fdbc623e0a59220e754800df3b86788eca0813d Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 22 Apr 2024 09:54:29 +0200 Subject: [PATCH 193/526] fix(edgy): proper way of opening neo-tree. Fixes #2984 --- lua/lazyvim/plugins/extras/ui/edgy.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/ui/edgy.lua b/lua/lazyvim/plugins/extras/ui/edgy.lua index 1a9c5e12..f2249edd 100644 --- a/lua/lazyvim/plugins/extras/ui/edgy.lua +++ b/lua/lazyvim/plugins/extras/ui/edgy.lua @@ -61,7 +61,7 @@ return { end, pinned = true, open = function() - vim.api.nvim_input("e") + require("neo-tree.command").execute({ dir = LazyVim.root() }) end, size = { height = 0.5 }, }, From 0fa63603afcb9b478c49a54d94314d20af00ae95 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis Date: Mon, 22 Apr 2024 10:56:00 +0300 Subject: [PATCH 194/526] fix(trouble_v3): keymap `previous` is deprecated, use `prev` instead (#2968) --- lua/lazyvim/plugins/extras/editor/trouble-v3.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/trouble-v3.lua b/lua/lazyvim/plugins/extras/editor/trouble-v3.lua index 6c964909..8a40498f 100644 --- a/lua/lazyvim/plugins/extras/editor/trouble-v3.lua +++ b/lua/lazyvim/plugins/extras/editor/trouble-v3.lua @@ -29,6 +29,20 @@ return { }, { "xL", "Trouble loclist toggle", desc = "Location List (Trouble)" }, { "xQ", "Trouble qflist toggle", desc = "Quickfix List (Trouble)" }, + { + "[q", + function() + if require("trouble").is_open() then + require("trouble").prev({ skip_groups = true, jump = true }) + else + local ok, err = pcall(vim.cmd.cprev) + if not ok then + vim.notify(err, vim.log.levels.ERROR) + end + end + end, + desc = "Previous Trouble/Quickfix Item", + }, }, }, From 9da13ef7e8a0b6c07e8e35f7c93dc77f3408d38b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 22 Apr 2024 10:00:48 +0200 Subject: [PATCH 195/526] fix(trouble-v3): fix telescope integration --- .../plugins/extras/editor/trouble-v3.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/trouble-v3.lua b/lua/lazyvim/plugins/extras/editor/trouble-v3.lua index 8a40498f..41a773d1 100644 --- a/lua/lazyvim/plugins/extras/editor/trouble-v3.lua +++ b/lua/lazyvim/plugins/extras/editor/trouble-v3.lua @@ -90,4 +90,22 @@ return { end end, }, + + { + "nvim-telescope/telescope.nvim", + optional = true, + opts = function(_, opts) + local open_with_trouble = require("trouble.sources.telescope").open + return vim.tbl_deep_extend("force", opts, { + defaults = { + mappings = { + i = { + [""] = open_with_trouble, + [""] = open_with_trouble, + }, + }, + }, + }) + end, + }, } From 9b4675ddde38fdae09978bd7dbdba83ec91f4d80 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 10:19:46 +0200 Subject: [PATCH 196/526] chore(main): release 10.22.0 (#3037) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e3109d1..85059243 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## [10.22.0](https://github.com/LazyVim/LazyVim/compare/v10.21.1...v10.22.0) (2024-04-22) + + +### Features + +* **dot:** add bashls and shellcheck ([#2879](https://github.com/LazyVim/LazyVim/issues/2879)) ([97480dc](https://github.com/LazyVim/LazyVim/commit/97480dc5d2dbb717b45a351e0b04835f138a9094)) +* **dot:** add more filetypes ([#2987](https://github.com/LazyVim/LazyVim/issues/2987)) ([15b09e8](https://github.com/LazyVim/LazyVim/commit/15b09e800ba7fb0c9ca8270a77e71083396e9db1)) +* **git:** `<leader>gb` for Git Blame Line ([9e3af10](https://github.com/LazyVim/LazyVim/commit/9e3af1070fc1932da322105708ebb32a2cd9572b)) +* **python:** use new `ruff` instead of `ruff_lsp` ([#3016](https://github.com/LazyVim/LazyVim/issues/3016)) ([cd04b58](https://github.com/LazyVim/LazyVim/commit/cd04b58fe3f7299fbca75e7eb47287617ac23fcf)) + + +### Bug Fixes + +* **edgy:** proper way of opening neo-tree. Fixes [#2984](https://github.com/LazyVim/LazyVim/issues/2984) ([6fdbc62](https://github.com/LazyVim/LazyVim/commit/6fdbc623e0a59220e754800df3b86788eca0813d)) +* **harpoon:** harpoon2 deprecated message ([#2920](https://github.com/LazyVim/LazyVim/issues/2920)) ([79fed97](https://github.com/LazyVim/LazyVim/commit/79fed97f2357b2969cb23d106137978ca7cdffb4)) +* **harpoon:** optimizes harpoon keys ([#2877](https://github.com/LazyVim/LazyVim/issues/2877)) ([50b7f42](https://github.com/LazyVim/LazyVim/commit/50b7f426f287ecfc542dd9c197e430b0aca8af04)) +* **mini.pairs:** better default for ```` ([32eacde](https://github.com/LazyVim/LazyVim/commit/32eacde793fddcca0bcfbbd494b6aa8b2c870d0f)) +* **toggle:** use new `inlay_hint.enable()` signature ([#3013](https://github.com/LazyVim/LazyVim/issues/3013)) ([5f92dc5](https://github.com/LazyVim/LazyVim/commit/5f92dc5304b99a3e76dca878d9b47557fb64f384)) +* **trouble_v3:** keymap `previous` is deprecated, use `prev` instead ([#2968](https://github.com/LazyVim/LazyVim/issues/2968)) ([0fa6360](https://github.com/LazyVim/LazyVim/commit/0fa63603afcb9b478c49a54d94314d20af00ae95)) +* **trouble_v3:** show error only when `trouble_v3` is enabled ([#2989](https://github.com/LazyVim/LazyVim/issues/2989)) ([ceb4855](https://github.com/LazyVim/LazyVim/commit/ceb4855b434c8e7095bbf47cfc3b3647532d6a2c)) +* **trouble-v3:** fix telescope integration ([9da13ef](https://github.com/LazyVim/LazyVim/commit/9da13ef7e8a0b6c07e8e35f7c93dc77f3408d38b)) + ## [10.21.1](https://github.com/LazyVim/LazyVim/compare/v10.21.0...v10.21.1) (2024-03-29) From 5fb4cf0d365b65cb9b7afa8be047973b5fc1747a Mon Sep 17 00:00:00 2001 From: HyBer <59885141+BBboy01@users.noreply.github.com> Date: Tue, 23 Apr 2024 14:54:32 +0800 Subject: [PATCH 197/526] fix(dot): can't match kitty conf file (#3042) --- lua/lazyvim/plugins/extras/util/dot.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/util/dot.lua b/lua/lazyvim/plugins/extras/util/dot.lua index 26af6a9b..abbeaed9 100644 --- a/lua/lazyvim/plugins/extras/util/dot.lua +++ b/lua/lazyvim/plugins/extras/util/dot.lua @@ -43,8 +43,8 @@ return { pattern = { [".*/waybar/config"] = "jsonc", [".*/mako/config"] = "dosini", - [".*/kitty/*.conf"] = "bash", - [".*/hypr/.*%.conf"] = "hyprlang", + [".*/kitty/.+%.conf"] = "bash", + [".*/hypr/.+%.conf"] = "hyprlang", ["%.env%.[%w_.-]+"] = "dotenv", }, }) From f086bcde253c29be9a2b9c90b413a516f5d5a3b2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 23 Apr 2024 06:55:09 +0000 Subject: [PATCH 198/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 38e7d18d..dac065ba 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 April 22 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 April 23 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 3086bf03e96bfc0048e5b27f8d65a9170bca3f67 Mon Sep 17 00:00:00 2001 From: Daniel Mata <100956688+matadaniel@users.noreply.github.com> Date: Fri, 3 May 2024 02:06:33 -0500 Subject: [PATCH 199/526] fix(dot): install when list is empty (#3052) --- lua/lazyvim/plugins/extras/util/dot.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lua/lazyvim/plugins/extras/util/dot.lua b/lua/lazyvim/plugins/extras/util/dot.lua index abbeaed9..ffc46551 100644 --- a/lua/lazyvim/plugins/extras/util/dot.lua +++ b/lua/lazyvim/plugins/extras/util/dot.lua @@ -18,10 +18,8 @@ return { { "williamboman/mason.nvim", opts = function(_, opts) - vim.list_extend(opts.ensure_installed or {}, { - "shfmt", - "shellcheck", - }) + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, { "shellcheck" }) end, }, -- add some stuff to treesitter From 9d734c5ae232bd8dd46855b0582bbd0e3d13f6bb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 3 May 2024 07:07:12 +0000 Subject: [PATCH 200/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index dac065ba..602c7dd7 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 April 23 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 03 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 095bc13188cefb11dba2adc312cf0dc8cfce0b1f Mon Sep 17 00:00:00 2001 From: Michael Butler <158096643+michaelbutleridt@users.noreply.github.com> Date: Fri, 3 May 2024 03:10:36 -0400 Subject: [PATCH 201/526] style(keymaps): clarify no to use `LazyVim.safe_keymap_set` #3085 * Update keymaps.lua add more explanation about what to use * Update keymaps.lua * fix typo YOU => YOUR --- lua/lazyvim/config/keymaps.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 38c0ae4e..79ae665d 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -1,6 +1,6 @@ -- This file is automatically loaded by lazyvim.config.init --- DO NOT USE THIS IN YOU OWN CONFIG!! +-- DO NOT USE `LazyVim.safe_keymap_set` IN YOUR OWN CONFIG!! -- use `vim.keymap.set` instead local map = LazyVim.safe_keymap_set From 6004e8d4f60549bd2c5d6f3187a28d72b21e3261 Mon Sep 17 00:00:00 2001 From: Shixin Chai <1667482085@qq.com> Date: Fri, 3 May 2024 15:11:25 +0800 Subject: [PATCH 202/526] fix(native_snippets): Fix native_snippets for `vim.snippet api` changes (#3083) --- lua/lazyvim/plugins/extras/coding/native_snippets.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/coding/native_snippets.lua b/lua/lazyvim/plugins/extras/coding/native_snippets.lua index 74b70784..cc501ff7 100644 --- a/lua/lazyvim/plugins/extras/coding/native_snippets.lua +++ b/lua/lazyvim/plugins/extras/coding/native_snippets.lua @@ -22,7 +22,7 @@ return { { "", function() - if vim.snippet.jumpable(1) then + if vim.snippet.active({ direction = 1 }) then vim.schedule(function() vim.snippet.jump(1) end) @@ -47,7 +47,7 @@ return { { "", function() - if vim.snippet.jumpable(-1) then + if vim.snippet.active({ direction = -1 }) then vim.schedule(function() vim.snippet.jump(-1) end) From b8475f51949acf195729a1c4d057a06208a9add9 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Fri, 3 May 2024 10:16:50 +0300 Subject: [PATCH 203/526] feat(lualine): make path trimming configurable by user (#3062) * feat(lualine): make path trimming configurable by user * fix: always split both forward/backward slashes --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/util/lualine.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/util/lualine.lua b/lua/lazyvim/util/lualine.lua index db4600f4..757ddb01 100644 --- a/lua/lazyvim/util/lualine.lua +++ b/lua/lazyvim/util/lualine.lua @@ -79,6 +79,7 @@ function M.pretty_path(opts) directory_hl = "", filename_hl = "Bold", modified_sign = "", + length = 3, }, opts or {}) return function(self) @@ -100,8 +101,10 @@ function M.pretty_path(opts) local sep = package.config:sub(1, 1) local parts = vim.split(path, "[\\/]") - if #parts > 3 then - parts = { parts[1], "…", parts[#parts - 1], parts[#parts] } + if opts.length == 0 then + parts = parts + elseif #parts > opts.length then + parts = { parts[1], "…", table.concat({ unpack(parts, #parts - opts.length + 2, #parts) }, sep) } end if opts.modified_hl and vim.bo.modified then From a96348d7b076819f7580ea0c0ce467630bfc7cc5 Mon Sep 17 00:00:00 2001 From: Skywalker <51255100+imzhongqi@users.noreply.github.com> Date: Fri, 3 May 2024 15:17:55 +0800 Subject: [PATCH 204/526] fix(extras): Rust-Analyzer cargo option (#3061) * fix(extras): Rust-Analyzer cargo option * fix(extras): Rust-Analyzer cargo option --- lua/lazyvim/plugins/extras/lang/rust.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/rust.lua b/lua/lazyvim/plugins/extras/lang/rust.lua index 613bc0f7..8a665c6c 100644 --- a/lua/lazyvim/plugins/extras/lang/rust.lua +++ b/lua/lazyvim/plugins/extras/lang/rust.lua @@ -60,7 +60,9 @@ return { cargo = { allFeatures = true, loadOutDirsFromCheck = true, - runBuildScripts = true, + buildScripts = { + enable = true, + }, }, -- Add clippy lints for Rust. checkOnSave = { From 34183a2759828001b08679659f7d5170d7ec367e Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Fri, 3 May 2024 10:23:31 +0300 Subject: [PATCH 205/526] fix(python): make both `ruff` and `ruff_lsp` available to user (#3060) * fix(python): make both `ruff` and `ruff_lsp` available to user Provide global variable to choose between `ruff` and `ruff_lsp` in accordance to `pyright`/`basedpyright` * refactor(python): ruff stuff --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/plugins/extras/lang/python.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index b36fd80c..3e7f5d59 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -2,9 +2,11 @@ if lazyvim_docs then -- LSP Server to use for Python. -- Set to "basedpyright" to use basedpyright instead of pyright. vim.g.lazyvim_python_lsp = "pyright" + vim.g.lazyvim_python_ruff = "ruff_lsp" end local lsp = vim.g.lazyvim_python_lsp or "pyright" +local ruff = vim.g.lazyvim_python_ruff or "ruff_lsp" return { { @@ -28,7 +30,13 @@ return { [lsp] = { enabled = true, }, + ruff_lsp = { + enabled = ruff == "ruff_lsp", + }, ruff = { + enabled = ruff == "ruff", + }, + [ruff] = { keys = { { "co", @@ -47,9 +55,9 @@ return { }, }, setup = { - ruff = function() + [ruff] = function() LazyVim.lsp.on_attach(function(client, _) - if client.name == "ruff" then + if client.name == ruff then -- Disable hover in favor of Pyright client.server_capabilities.hoverProvider = false end From 530e94a9fa19577401e968a9673282c3d79f01e3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 3 May 2024 16:21:45 +0200 Subject: [PATCH 206/526] chore(main): release 10.23.0 (#3043) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85059243..541f2250 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [10.23.0](https://github.com/LazyVim/LazyVim/compare/v10.22.0...v10.23.0) (2024-05-03) + + +### Features + +* **lualine:** make path trimming configurable by user ([#3062](https://github.com/LazyVim/LazyVim/issues/3062)) ([b8475f5](https://github.com/LazyVim/LazyVim/commit/b8475f51949acf195729a1c4d057a06208a9add9)) + + +### Bug Fixes + +* **dot:** can't match kitty conf file ([#3042](https://github.com/LazyVim/LazyVim/issues/3042)) ([5fb4cf0](https://github.com/LazyVim/LazyVim/commit/5fb4cf0d365b65cb9b7afa8be047973b5fc1747a)) +* **dot:** install when list is empty ([#3052](https://github.com/LazyVim/LazyVim/issues/3052)) ([3086bf0](https://github.com/LazyVim/LazyVim/commit/3086bf03e96bfc0048e5b27f8d65a9170bca3f67)) +* **extras:** Rust-Analyzer cargo option ([#3061](https://github.com/LazyVim/LazyVim/issues/3061)) ([a96348d](https://github.com/LazyVim/LazyVim/commit/a96348d7b076819f7580ea0c0ce467630bfc7cc5)) +* **native_snippets:** Fix native_snippets for `vim.snippet api` changes ([#3083](https://github.com/LazyVim/LazyVim/issues/3083)) ([6004e8d](https://github.com/LazyVim/LazyVim/commit/6004e8d4f60549bd2c5d6f3187a28d72b21e3261)) +* **python:** make both `ruff` and `ruff_lsp` available to user ([#3060](https://github.com/LazyVim/LazyVim/issues/3060)) ([34183a2](https://github.com/LazyVim/LazyVim/commit/34183a2759828001b08679659f7d5170d7ec367e)) + ## [10.22.0](https://github.com/LazyVim/LazyVim/compare/v10.21.1...v10.22.0) (2024-04-22) From 30c9e4718a127f7d5a32f11c4d8dbba6b01f9858 Mon Sep 17 00:00:00 2001 From: Afiq Nazrie Date: Sun, 12 May 2024 14:57:29 +0700 Subject: [PATCH 207/526] fix(ui): don't lazy-load dashboard-nvim (#3107) As https://github.com/nvimdev/dashboard-nvim/pull/450, dashboard-nvim shouldn't be lazy-loaded to properly handle stdin --- lua/lazyvim/plugins/ui.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 47fb4280..2cd9496c 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -346,9 +346,10 @@ return { return false end, }, + { "nvimdev/dashboard-nvim", - event = "VimEnter", + lazy = false, -- As https://github.com/nvimdev/dashboard-nvim/pull/450, dashboard-nvim shouldn't be lazy-loaded to properly handle stdin. opts = function() local logo = [[ ██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z From f7450a523622152635e950716565e8d5c27b840d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 12 May 2024 07:58:05 +0000 Subject: [PATCH 208/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 602c7dd7..6460b1fa 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 03 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 12 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 30ce84f7a7fb4e88b47ddf2f569b2ea9b7d56717 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Sun, 12 May 2024 11:08:55 +0300 Subject: [PATCH 209/526] fix(neo-tree): correctly set up `cwd` (#3097) * fix(neo-tree): correctly set up `cwd` * refactor: cleanup --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/plugins/editor.lua | 23 +++++++++++++++++------ lua/lazyvim/util/root.lua | 5 ++++- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 37bcc9cb..c25537f4 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -41,12 +41,23 @@ return { vim.cmd([[Neotree close]]) end, init = function() - if vim.fn.argc(-1) == 1 then - local stat = vim.uv.fs_stat(vim.fn.argv(0)) - if stat and stat.type == "directory" then - require("neo-tree") - end - end + -- FIX: use `autocmd` for lazy-loading neo-tree instead of directly requiring it, + -- because `cwd` is not set up properly. + vim.api.nvim_create_autocmd("BufEnter", { + group = vim.api.nvim_create_augroup("Neotree_start_directory", { clear = true }), + desc = "Start Neo-tree with directory", + once = true, + callback = function() + if package.loaded["neo-tree"] then + return + else + local stats = vim.uv.fs_stat(vim.fn.argv(0)) + if stats and stats.type == "directory" then + require("neo-tree") + end + end + end, + }) end, opts = { sources = { "filesystem", "buffers", "git_status", "document_symbols" }, diff --git a/lua/lazyvim/util/root.lua b/lua/lazyvim/util/root.lua index 4143206c..c8de430d 100644 --- a/lua/lazyvim/util/root.lua +++ b/lua/lazyvim/util/root.lua @@ -142,7 +142,10 @@ function M.setup() LazyVim.root.info() end, { desc = "LazyVim roots for the current buffer" }) - vim.api.nvim_create_autocmd({ "LspAttach", "BufWritePost", "DirChanged" }, { + -- FIX: doesn't properly clear cache in neo-tree `set_root` (which should happen presumably on `DirChanged`), + -- probably because the event is triggered in the neo-tree buffer, therefore add `BufEnter` + -- Maybe this is too frequent on `BufEnter` and something else should be done instead?? + vim.api.nvim_create_autocmd({ "LspAttach", "BufWritePost", "DirChanged", "BufEnter" }, { group = vim.api.nvim_create_augroup("lazyvim_root_cache", { clear = true }), callback = function(event) M.cache[event.buf] = nil From 8968c9e9ea76f3a7616d9e249a3c9307a75fffad Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Sun, 12 May 2024 11:09:54 +0300 Subject: [PATCH 210/526] feat(mason-lspconfig): allow `opts.ensure_installed` to be taken into account (#3134) --- lua/lazyvim/plugins/lsp/init.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index c2a74ef5..30ef5115 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -212,7 +212,14 @@ return { end if have_mason then - mlsp.setup({ ensure_installed = ensure_installed, handlers = { setup } }) + mlsp.setup({ + ensure_installed = vim.tbl_deep_extend( + "force", + ensure_installed, + LazyVim.opts("mason-lspconfig.nvim").ensure_installed or {} + ), + handlers = { setup }, + }) end if LazyVim.lsp.get_config("denols") and LazyVim.lsp.get_config("tsserver") then From cfe87ba894b6c2c961827de45c55b57b1183865c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 12 May 2024 10:15:27 +0200 Subject: [PATCH 211/526] chore(main): release 10.24.0 (#3143) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 541f2250..ba1a334d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [10.24.0](https://github.com/LazyVim/LazyVim/compare/v10.23.0...v10.24.0) (2024-05-12) + + +### Features + +* **mason-lspconfig:** allow `opts.ensure_installed` to be taken into account ([#3134](https://github.com/LazyVim/LazyVim/issues/3134)) ([8968c9e](https://github.com/LazyVim/LazyVim/commit/8968c9e9ea76f3a7616d9e249a3c9307a75fffad)) + + +### Bug Fixes + +* **neo-tree:** correctly set up `cwd` ([#3097](https://github.com/LazyVim/LazyVim/issues/3097)) ([30ce84f](https://github.com/LazyVim/LazyVim/commit/30ce84f7a7fb4e88b47ddf2f569b2ea9b7d56717)) +* **ui:** don't lazy-load dashboard-nvim ([#3107](https://github.com/LazyVim/LazyVim/issues/3107)) ([30c9e47](https://github.com/LazyVim/LazyVim/commit/30c9e4718a127f7d5a32f11c4d8dbba6b01f9858)) + ## [10.23.0](https://github.com/LazyVim/LazyVim/compare/v10.22.0...v10.23.0) (2024-05-03) From 42010d1dfbb0ba9c74c1ec0c93c5c9db21ebee47 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 12 May 2024 16:39:00 +0200 Subject: [PATCH 212/526] fix(dot): use syntax `sh` for dotenv files. Closes #3145 --- lua/lazyvim/plugins/extras/util/dot.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/util/dot.lua b/lua/lazyvim/plugins/extras/util/dot.lua index ffc46551..d12171f5 100644 --- a/lua/lazyvim/plugins/extras/util/dot.lua +++ b/lua/lazyvim/plugins/extras/util/dot.lua @@ -35,7 +35,7 @@ return { vim.filetype.add({ extension = { rasi = "rasi", rofi = "rasi", wofi = "rasi" }, filename = { - [".env"] = "dotenv", + [".env"] = "sh", ["vifmrc"] = "vim", }, pattern = { @@ -43,7 +43,7 @@ return { [".*/mako/config"] = "dosini", [".*/kitty/.+%.conf"] = "bash", [".*/hypr/.+%.conf"] = "hyprlang", - ["%.env%.[%w_.-]+"] = "dotenv", + ["%.env%.[%w_.-]+"] = "sh", }, }) From a0afe8fef9dc76b469a78435cdd3f2c5ee01f282 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 12 May 2024 18:23:14 +0200 Subject: [PATCH 213/526] fix(dot): remove `.env` => `sh` since this is already the default --- lua/lazyvim/plugins/extras/util/dot.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/util/dot.lua b/lua/lazyvim/plugins/extras/util/dot.lua index d12171f5..ad4e2278 100644 --- a/lua/lazyvim/plugins/extras/util/dot.lua +++ b/lua/lazyvim/plugins/extras/util/dot.lua @@ -35,7 +35,6 @@ return { vim.filetype.add({ extension = { rasi = "rasi", rofi = "rasi", wofi = "rasi" }, filename = { - [".env"] = "sh", ["vifmrc"] = "vim", }, pattern = { From e89653f4107724f53964a379337947490117a7dc Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 12 May 2024 22:08:13 +0200 Subject: [PATCH 214/526] fix(pretty_path): properly escape `%` characters --- lua/lazyvim/util/lualine.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/util/lualine.lua b/lua/lazyvim/util/lualine.lua index 757ddb01..3e546873 100644 --- a/lua/lazyvim/util/lualine.lua +++ b/lua/lazyvim/util/lualine.lua @@ -46,6 +46,7 @@ end ---@param hl_group? string ---@return string function M.format(component, text, hl_group) + text = text:gsub("%%", "%%%%") if not hl_group or hl_group == "" then return text end From f4490252fb2262208923ba197eb521732a602ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=B5=20Quang=20Chi=E1=BA=BFn?= <87252943+2giosangmitom@users.noreply.github.com> Date: Mon, 13 May 2024 03:10:32 +0700 Subject: [PATCH 215/526] feat(vue): add Vue.js support to LazyVim (#3094) --- lua/lazyvim/plugins/extras/lang/vue.lua | 46 +++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lang/vue.lua diff --git a/lua/lazyvim/plugins/extras/lang/vue.lua b/lua/lazyvim/plugins/extras/lang/vue.lua new file mode 100644 index 00000000..a943874b --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/vue.lua @@ -0,0 +1,46 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + if type(opts.ensure_installed) == "table" then + vim.list_extend(opts.ensure_installed, { "vue" }) + end + end, + }, + + { + "neovim/nvim-lspconfig", + opts = function(_, opts) + local vue_typescript_plugin = require("mason-registry").get_package("vue-language-server"):get_install_path() + .. "/node_modules/@vue/language-server" + .. "/node_modules/@vue/typescript-plugin" + + opts.servers = vim.tbl_deep_extend("force", opts.servers, { + volar = {}, + -- Volar 2.0 has discontinued their "take over mode" which in previous version provided support for typescript in vue files. + -- The new approach to get typescript support involves using the typescript language server along side volar. + tsserver = { + init_options = { + plugins = { + -- Use typescript language server along with vue typescript plugin + { + name = "@vue/typescript-plugin", + location = vue_typescript_plugin, + languages = { "javascript", "typescript", "vue" }, + }, + }, + }, + filetypes = { + "javascript", + "javascriptreact", + "javascript.jsx", + "typescript", + "typescriptreact", + "typescript.tsx", + "vue", + }, + }, + }) + end, + }, +} From 73de8dde2bb513337426d5ead862e4fc6dbb8fdf Mon Sep 17 00:00:00 2001 From: Rubin Bhandari Date: Mon, 13 May 2024 01:57:05 +0545 Subject: [PATCH 216/526] feat(extras): add refactoring.nvim (#3040) * feat(editor): add refactoring.nvim More on: https://github.com/ThePrimeagen/refactoring.nvim#features * Update lua/lazyvim/plugins/extras/editor/refactoring.lua Co-authored-by: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> * Update lua/lazyvim/plugins/extras/editor/refactoring.lua Co-authored-by: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> * indent fixes --------- Co-authored-by: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> --- .../plugins/extras/editor/refactoring.lua | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/editor/refactoring.lua diff --git a/lua/lazyvim/plugins/extras/editor/refactoring.lua b/lua/lazyvim/plugins/extras/editor/refactoring.lua new file mode 100644 index 00000000..e5852a3c --- /dev/null +++ b/lua/lazyvim/plugins/extras/editor/refactoring.lua @@ -0,0 +1,125 @@ +return { + { + "ThePrimeagen/refactoring.nvim", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + }, + keys = { + { + "rs", + function() + require("telescope").extensions.refactoring.refactors() + end, + mode = "v", + desc = "Refactor", + }, + { + "ri", + function() + require("refactoring").refactor("Inline Variable") + end, + mode = { "n", "v" }, + desc = "Inline Variable", + }, + { + "rb", + function() + require("refactoring").refactor("Extract Block") + end, + desc = "Extract Block", + }, + { + "rf", + function() + require("refactoring").refactor("Extract Block To File") + end, + desc = "Extract Block To File", + }, + { + "rP", + function() + require("refactoring").debug.printf({ below = false }) + end, + desc = "Debug Print", + }, + { + "rp", + function() + require("refactoring").debug.print_var({ normal = true }) + end, + desc = "Debug Print Variable", + }, + { + "rc", + function() + require("refactoring").debug.cleanup({}) + end, + desc = "Debug Cleanup", + }, + { + "rf", + function() + require("refactoring").refactor("Extract Function") + end, + mode = "v", + desc = "Extract Function", + }, + { + "rF", + function() + require("refactoring").refactor("Extract Function To File") + end, + mode = "v", + desc = "Extract Function To File", + }, + { + "rx", + function() + require("refactoring").refactor("Extract Variable") + end, + mode = "v", + desc = "Extract Variable", + }, + { + "rp", + function() + require("refactoring").debug.print_var() + end, + mode = "v", + desc = "Debug Print Variable", + }, + }, + opts = { + prompt_func_return_type = { + go = false, + java = false, + cpp = false, + c = false, + h = false, + hpp = false, + cxx = false, + }, + prompt_func_param_type = { + go = false, + java = false, + cpp = false, + c = false, + h = false, + hpp = false, + cxx = false, + }, + printf_statements = {}, + print_var_statements = {}, + }, + config = function(_, opts) + require("refactoring").setup(opts) + if LazyVim.has("telescope.nvim") then + LazyVim.on_load("telescope.nvim", function() + require("telescope").load_extension("refactoring") + end) + end + end, + }, +} From 8087283fea62e5673764dfa13906eadb24110622 Mon Sep 17 00:00:00 2001 From: Akira Itai Date: Sun, 12 May 2024 22:03:10 -0700 Subject: [PATCH 217/526] fix(rust): update creates.nvim src option to completion (#3149) --- lua/lazyvim/plugins/extras/lang/rust.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/rust.lua b/lua/lazyvim/plugins/extras/lang/rust.lua index 8a665c6c..6fe9e88e 100644 --- a/lua/lazyvim/plugins/extras/lang/rust.lua +++ b/lua/lazyvim/plugins/extras/lang/rust.lua @@ -8,7 +8,7 @@ return { "Saecki/crates.nvim", event = { "BufRead Cargo.toml" }, opts = { - src = { + completion = { cmp = { enabled = true }, }, }, From 36b59b26088d240815ddcb0f76160a72ea2495a6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 13 May 2024 05:03:43 +0000 Subject: [PATCH 218/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 6460b1fa..53beed41 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 12 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 13 ============================================================================== Table of Contents *LazyVim-table-of-contents* From c54eeb53905e8da27814f52eaf1ad63aeff4cbe4 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Mon, 13 May 2024 09:20:34 +0300 Subject: [PATCH 219/526] fix(lazyfile): exclude `filetypedetect` from skips (#3004) --- lua/lazyvim/util/plugin.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/util/plugin.lua b/lua/lazyvim/util/plugin.lua index a8e784b6..13a2acec 100644 --- a/lua/lazyvim/util/plugin.lua +++ b/lua/lazyvim/util/plugin.lua @@ -86,7 +86,11 @@ function M.lazy_file() ---@type table local skips = {} for _, event in ipairs(events) do - skips[event.event] = skips[event.event] or Event.get_augroups(event.event) + local augroups = Event.get_augroups(event.event) + local groups = vim.tbl_filter(function(t) + return not vim.tbl_contains({ t }, "filetypedetect") + end, augroups) + skips[event.event] = skips[event.event] or groups end vim.api.nvim_exec_autocmds("User", { pattern = "LazyFile", modeline = false }) From abb1ff0d600b3446b612390f0482cf92bdc84ab0 Mon Sep 17 00:00:00 2001 From: Jordan McAlpine <128929391+mickalpine@users.noreply.github.com> Date: Mon, 13 May 2024 02:21:33 -0400 Subject: [PATCH 220/526] fix(ansible): ansiblels not loading, keymap desc. (#2739) If lazy extras yaml is enabled, yamlls was being loaded not ansiblels. Add ft = {} to nvim-ansible spec allows ft=yaml.ansible to be detected. Re-mapped nvim-ansible plugin key to not conflict with neotest. Added a description for the keymap. --- lua/lazyvim/plugins/extras/lang/ansible.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/ansible.lua b/lua/lazyvim/plugins/extras/lang/ansible.lua index 301fa494..d1112115 100644 --- a/lua/lazyvim/plugins/extras/lang/ansible.lua +++ b/lua/lazyvim/plugins/extras/lang/ansible.lua @@ -25,12 +25,14 @@ return { }, { "mfussenegger/nvim-ansible", + ft = {}, keys = { { - "tr", + "ta", function() require("ansible").run() end, + desc = "Ansible Run Playbook/Role", silent = true, }, }, From 39901c1f00eca36beb211978164744ae41be7781 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 13 May 2024 08:53:17 +0200 Subject: [PATCH 221/526] fix(fzf-native): try rebuilding fzf-native when needed. Fixes #2464 --- lua/lazyvim/plugins/editor.lua | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index c25537f4..907d2dc0 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -1,3 +1,6 @@ +local have_make = vim.fn.executable("make") == 1 +local have_cmake = vim.fn.executable("cmake") == 1 + return { -- file explorer @@ -141,12 +144,23 @@ return { dependencies = { { "nvim-telescope/telescope-fzf-native.nvim", - build = vim.fn.executable("make") == 1 and "make" + build = have_make and "make" or "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build", - enabled = vim.fn.executable("make") == 1 or vim.fn.executable("cmake") == 1, - config = function() + enabled = have_make or have_cmake, + config = function(plugin) LazyVim.on_load("telescope.nvim", function() - require("telescope").load_extension("fzf") + local ok, err = pcall(require("telescope").load_extension, "fzf") + if not ok then + local lib = plugin.dir .. "/build/libfzf." .. (LazyVim.is_win() and "dll" or "so") + if not vim.uv.fs_stat(lib) then + LazyVim.warn("`telescope-fzf-native.nvim` not built. Rebuilding...") + require("lazy").build({ plugins = { plugin }, show = false }):wait(function() + LazyVim.info("Rebuilding `telescope-fzf-native.nvim` done.\nPlease restart Neovim.") + end) + else + LazyVim.error("Failed to load `telescope-fzf-native.nvim`:\n" .. err) + end + end end) end, }, From 8301096c31f9855c74d5b732367b679bc8721b5e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 14 May 2024 21:36:43 +0200 Subject: [PATCH 222/526] perf(treesitter): dont let nvim-treesitter-textobjects stall loading treesitter --- lua/lazyvim/plugins/treesitter.lua | 57 ++++++++++++++++-------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/lua/lazyvim/plugins/treesitter.lua b/lua/lazyvim/plugins/treesitter.lua index 108582ff..a7ef36e5 100644 --- a/lua/lazyvim/plugins/treesitter.lua +++ b/lua/lazyvim/plugins/treesitter.lua @@ -16,33 +16,6 @@ return { require("lazy.core.loader").add_to_rtp(plugin) require("nvim-treesitter.query_predicates") end, - dependencies = { - { - "nvim-treesitter/nvim-treesitter-textobjects", - config = function() - -- When in diff mode, we want to use the default - -- vim text objects c & C instead of the treesitter ones. - local move = require("nvim-treesitter.textobjects.move") ---@type table - local configs = require("nvim-treesitter.configs") - for name, fn in pairs(move) do - if name:find("goto") == 1 then - move[name] = function(q, ...) - if vim.wo.diff then - local config = configs.get_module("textobjects.move")[name] ---@type table - for key, query in pairs(config or {}) do - if q == query and key:find("[%]%[][cC]") then - vim.cmd("normal! " .. key) - return - end - end - end - return fn(q, ...) - end - end - end - end, - }, - }, cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" }, keys = { { "", desc = "Increment Selection" }, @@ -111,6 +84,36 @@ return { end, opts.ensure_installed) end require("nvim-treesitter.configs").setup(opts) + vim.schedule(function() + require("lazy").load({ plugins = { "nvim-treesitter-textobjects" } }) + end) + end, + }, + + { + "nvim-treesitter/nvim-treesitter-textobjects", + lazy = true, + config = function() + -- When in diff mode, we want to use the default + -- vim text objects c & C instead of the treesitter ones. + local move = require("nvim-treesitter.textobjects.move") ---@type table + local configs = require("nvim-treesitter.configs") + for name, fn in pairs(move) do + if name:find("goto") == 1 then + move[name] = function(q, ...) + if vim.wo.diff then + local config = configs.get_module("textobjects.move")[name] ---@type table + for key, query in pairs(config or {}) do + if q == query and key:find("[%]%[][cC]") then + vim.cmd("normal! " .. key) + return + end + end + end + return fn(q, ...) + end + end + end end, }, From b29d169afb7560ed4a9276e4379e28ffaed1a171 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 14 May 2024 21:41:56 +0200 Subject: [PATCH 223/526] perf(treesitter): load treesitter early during startup when opening a file from the cmdline --- lua/lazyvim/plugins/treesitter.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/treesitter.lua b/lua/lazyvim/plugins/treesitter.lua index a7ef36e5..97479b91 100644 --- a/lua/lazyvim/plugins/treesitter.lua +++ b/lua/lazyvim/plugins/treesitter.lua @@ -7,6 +7,7 @@ return { version = false, -- last release is way too old and doesn't work on Windows build = ":TSUpdate", event = { "LazyFile", "VeryLazy" }, + lazy = vim.fn.argc(-1) == 0, -- load treesitter early when opening a file from the cmdline init = function(plugin) -- PERF: add nvim-treesitter queries to the rtp and it's custom query predicates early -- This is needed because a bunch of plugins no longer `require("nvim-treesitter")`, which From 965a469ca8cb1d58b49c4e5d8b85430e8c6c0a25 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 14 May 2024 21:43:02 +0200 Subject: [PATCH 224/526] perf(startup): render a file opened from the cmdline as soon as possible and get rid of lazy_file logic --- lua/lazyvim/util/plugin.lua | 93 +++++++++++-------------------------- 1 file changed, 27 insertions(+), 66 deletions(-) diff --git a/lua/lazyvim/util/plugin.lua b/lua/lazyvim/util/plugin.lua index 13a2acec..0a6edc3b 100644 --- a/lua/lazyvim/util/plugin.lua +++ b/lua/lazyvim/util/plugin.lua @@ -3,7 +3,6 @@ local Plugin = require("lazy.core.plugin") ---@class lazyvim.util.plugin local M = {} -M.use_lazy_file = true M.lazy_file_events = { "BufReadPost", "BufNewFile", "BufWritePre" } ---@type table @@ -55,76 +54,38 @@ function M.extra_idx(name) end end --- Properly load file based plugins without blocking the UI function M.lazy_file() - M.use_lazy_file = M.use_lazy_file and vim.fn.argc(-1) > 0 + -- This autocmd will only trigger when a file was loaded from the cmdline. + -- It will render the file as quickly as possible. + vim.api.nvim_create_autocmd("BufReadPost", { + once = true, + callback = function(event) + -- Skip if we already entered vim + if vim.v.vim_did_enter == 1 then + return + end + + -- Try to guess the filetype (may change later on during Neovim startup) + local ft = vim.filetype.match({ buf = event.buf }) + if ft then + -- Add treesitter highlights and fallback to syntax + local lang = vim.treesitter.language.get_lang(ft) + if not (lang and pcall(vim.treesitter.start, event.buf, lang)) then + vim.bo[event.buf].syntax = ft + vim.notify("Could not load treesitter for " .. ft, "warn", { title = "LazyVim" }) + end + + -- Trigger early redraw + vim.cmd([[redraw]]) + end + end, + }) -- Add support for the LazyFile event local Event = require("lazy.core.handler.event") - if M.use_lazy_file then - -- We'll handle delayed execution of events ourselves - Event.mappings.LazyFile = { id = "LazyFile", event = "User", pattern = "LazyFile" } - Event.mappings["User LazyFile"] = Event.mappings.LazyFile - else - -- Don't delay execution of LazyFile events, but let lazy know about the mapping - Event.mappings.LazyFile = { id = "LazyFile", event = { "BufReadPost", "BufNewFile", "BufWritePre" } } - Event.mappings["User LazyFile"] = Event.mappings.LazyFile - return - end - - local events = {} ---@type {event: string, buf: number, data?: any}[] - - local done = false - local function load() - if #events == 0 or done then - return - end - done = true - vim.api.nvim_del_augroup_by_name("lazy_file") - - ---@type table - local skips = {} - for _, event in ipairs(events) do - local augroups = Event.get_augroups(event.event) - local groups = vim.tbl_filter(function(t) - return not vim.tbl_contains({ t }, "filetypedetect") - end, augroups) - skips[event.event] = skips[event.event] or groups - end - - vim.api.nvim_exec_autocmds("User", { pattern = "LazyFile", modeline = false }) - for _, event in ipairs(events) do - if vim.api.nvim_buf_is_valid(event.buf) then - Event.trigger({ - event = event.event, - exclude = skips[event.event], - data = event.data, - buf = event.buf, - }) - if vim.bo[event.buf].filetype then - Event.trigger({ - event = "FileType", - buf = event.buf, - }) - end - end - end - vim.api.nvim_exec_autocmds("CursorMoved", { modeline = false }) - events = {} - end - - -- schedule wrap so that nested autocmds are executed - -- and the UI can continue rendering without blocking - load = vim.schedule_wrap(load) - - vim.api.nvim_create_autocmd(M.lazy_file_events, { - group = vim.api.nvim_create_augroup("lazy_file", { clear = true }), - callback = function(event) - table.insert(events, event) - load() - end, - }) + Event.mappings.LazyFile = { id = "LazyFile", event = M.lazy_file_events } + Event.mappings["User LazyFile"] = Event.mappings.LazyFile end function M.fix_imports() From cffed60fe4734d02e32efda5be22707342d5f9ea Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 14 May 2024 19:43:45 +0000 Subject: [PATCH 225/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 53beed41..b5925029 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 13 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 14 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 3585d61c938d62a331d474a8ff69c44faa4f3a10 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 14 May 2024 22:25:40 +0200 Subject: [PATCH 226/526] style: remove debug :) --- lua/lazyvim/util/plugin.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/lazyvim/util/plugin.lua b/lua/lazyvim/util/plugin.lua index 0a6edc3b..3e90a767 100644 --- a/lua/lazyvim/util/plugin.lua +++ b/lua/lazyvim/util/plugin.lua @@ -72,7 +72,6 @@ function M.lazy_file() local lang = vim.treesitter.language.get_lang(ft) if not (lang and pcall(vim.treesitter.start, event.buf, lang)) then vim.bo[event.buf].syntax = ft - vim.notify("Could not load treesitter for " .. ft, "warn", { title = "LazyVim" }) end -- Trigger early redraw From 1df3c5d70b2265f8582b0ed414f085e9066960da Mon Sep 17 00:00:00 2001 From: Gethin Davies Date: Tue, 14 May 2024 21:36:31 +0100 Subject: [PATCH 227/526] fix(dial): Fix dial commands in Visual line+block (#2933) --- lua/lazyvim/plugins/extras/editor/dial.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/dial.lua b/lua/lazyvim/plugins/extras/editor/dial.lua index 20ebd7ff..72ecc926 100644 --- a/lua/lazyvim/plugins/extras/editor/dial.lua +++ b/lua/lazyvim/plugins/extras/editor/dial.lua @@ -5,7 +5,9 @@ M.dials_by_ft = {} ---@param increment boolean ---@param g? boolean function M.dial(increment, g) - local is_visual = vim.fn.mode(true):sub(1, 1) == "v" + local mode = vim.fn.mode(true) + -- Use visual commands for VISUAL 'v', VISUAL LINE 'V' and VISUAL BLOCK '\22' + local is_visual = mode == "v" or mode == "V" or mode == "\22" local func = (increment and "inc" or "dec") .. (g and "_g" or "_") .. (is_visual and "visual" or "normal") local group = M.dials_by_ft[vim.bo.filetype] or "default" return require("dial.map")[func](group) From 3c04789ef15bba15e8c0c71ef31db38c76b2ad67 Mon Sep 17 00:00:00 2001 From: XY Lin Date: Tue, 14 May 2024 21:37:27 +0100 Subject: [PATCH 228/526] fix(clangd): update the attribute name for process ID (#3047) The attribute name for picked process id when attaching the debugger is `pid`, not `processId` --- lua/lazyvim/plugins/extras/lang/clangd.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/clangd.lua b/lua/lazyvim/plugins/extras/lang/clangd.lua index 7705360d..b5d707d7 100644 --- a/lua/lazyvim/plugins/extras/lang/clangd.lua +++ b/lua/lazyvim/plugins/extras/lang/clangd.lua @@ -144,7 +144,7 @@ return { type = "codelldb", request = "attach", name = "Attach to process", - processId = require("dap.utils").pick_process, + pid = require("dap.utils").pick_process, cwd = "${workspaceFolder}", }, } From 9047d041a8296e34ed7236e5344f5b927cd28f8b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 15 May 2024 08:48:55 +0200 Subject: [PATCH 229/526] perf(yanky): `schedule_wrap` sqlite push to history to prevent blocking Neovim on copy/paste --- lua/lazyvim/plugins/extras/coding/yanky.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/coding/yanky.lua b/lua/lazyvim/plugins/extras/coding/yanky.lua index e3549643..a1ef26c7 100644 --- a/lua/lazyvim/plugins/extras/coding/yanky.lua +++ b/lua/lazyvim/plugins/extras/coding/yanky.lua @@ -4,7 +4,7 @@ return { "gbprod/yanky.nvim", dependencies = not LazyVim.is_win() and { "kkharji/sqlite.lua" } or {}, opts = { - highlight = { timer = 250 }, + highlight = { timer = 150 }, ring = { storage = LazyVim.is_win() and "shada" or "sqlite" }, }, keys = { @@ -28,5 +28,11 @@ return { { "=p", "(YankyPutAfterFilter)", desc = "Put After Applying a Filter" }, { "=P", "(YankyPutBeforeFilter)", desc = "Put Before Applying a Filter" }, }, + config = function(_, opts) + require("yanky").setup(opts) + local sqlite = require("yanky.storage.sqlite") + local push = sqlite.push + sqlite.push = vim.schedule_wrap(push) + end, }, } From 1892ebad78f9e855797ee7859bf5c4e1c5c93c39 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 15 May 2024 06:49:36 +0000 Subject: [PATCH 230/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index b5925029..78d4c15c 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 14 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 15 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 6a2545025eb6fcc78998b8a4c6d121729980925b Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Wed, 15 May 2024 12:29:55 +0300 Subject: [PATCH 231/526] fix(lsp): check if `diagnostics.signs` is disabled by user (#2897) --- lua/lazyvim/plugins/lsp/init.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 30ef5115..4681b384 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -120,10 +120,12 @@ return { -- diagnostics signs if vim.fn.has("nvim-0.10.0") == 0 then - for severity, icon in pairs(opts.diagnostics.signs.text) do - local name = vim.diagnostic.severity[severity]:lower():gsub("^%l", string.upper) - name = "DiagnosticSign" .. name - vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) + if type(opts.diagnostics.signs) ~= "boolean" then + for severity, icon in pairs(opts.diagnostics.signs.text) do + local name = vim.diagnostic.severity[severity]:lower():gsub("^%l", string.upper) + name = "DiagnosticSign" .. name + vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) + end end end From 12a48b8ce1521fcac01b89099a4ca8bbc3547769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ph=C3=BAc=20H=2E=20L=C3=AA=20Kh=E1=BA=AFc?= Date: Wed, 15 May 2024 14:11:29 +0400 Subject: [PATCH 232/526] feat(snippet): add friendly-snippets to native extra (#2944) --- .../plugins/extras/coding/native_snippets.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lua/lazyvim/plugins/extras/coding/native_snippets.lua b/lua/lazyvim/plugins/extras/coding/native_snippets.lua index cc501ff7..e94d40ad 100644 --- a/lua/lazyvim/plugins/extras/coding/native_snippets.lua +++ b/lua/lazyvim/plugins/extras/coding/native_snippets.lua @@ -11,13 +11,18 @@ return { }, { "nvim-cmp", - opts = { - snippet = { + dependencies = { + { "rafamadriz/friendly-snippets" }, + { "garymjr/nvim-snippets", opts = { friendly_snippets = true } }, + }, + opts = function(_, opts) + opts.snippet = { expand = function(args) vim.snippet.expand(args.body) end, - }, - }, + } + table.insert(opts.sources, { name = "snippets" }) + end, keys = { { "", From a97fa3b7563eb2c5305c8f32461bb150d17e45ae Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 15 May 2024 15:31:08 +0200 Subject: [PATCH 233/526] feat(lua): added `LazyVim` as a treesitter builtin --- queries/lua/highlights.scm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/queries/lua/highlights.scm b/queries/lua/highlights.scm index 829b2b08..eb048490 100644 --- a/queries/lua/highlights.scm +++ b/queries/lua/highlights.scm @@ -2,3 +2,6 @@ ((identifier) @namespace.builtin (#eq? @namespace.builtin "vim")) + +((identifier) @namespace.builtin + (#eq? @namespace.builtin "LazyVim")) From 543dead590a949255fbbada9e1775c31ad654682 Mon Sep 17 00:00:00 2001 From: MoetaYuko Date: Wed, 15 May 2024 21:39:28 +0800 Subject: [PATCH 234/526] fix(dap): load vscode launch files with jsonc parser (#1839) This seems to be the proper fix for #1503. jsonc ensures compatibility with native vscode. Ref: https://github.com/mfussenegger/nvim-dap/issues/964 --- lua/lazyvim/plugins/extras/dap/core.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/dap/core.lua b/lua/lazyvim/plugins/extras/dap/core.lua index 7e370629..bf57ebc3 100644 --- a/lua/lazyvim/plugins/extras/dap/core.lua +++ b/lua/lazyvim/plugins/extras/dap/core.lua @@ -26,8 +26,6 @@ return { }, opts = {}, config = function(_, opts) - -- setup dap config by VsCode launch.json file - -- require("dap.ext.vscode").load_launchjs() local dap = require("dap") local dapui = require("dapui") dapui.setup(opts) @@ -81,6 +79,11 @@ return { }, }, }, + + -- VsCode launch.json parser + { + "folke/neoconf.nvim", + }, }, -- stylua: ignore @@ -115,5 +118,10 @@ return { { text = sign[1], texthl = sign[2] or "DiagnosticInfo", linehl = sign[3], numhl = sign[3] } ) end + + -- setup dap config by VsCode launch.json file + local vscode = require("dap.ext.vscode") + vscode.json_decode = require("neoconf.json.jsonc").decode_jsonc + vscode.load_launchjs() end, } From 2c86da7c2df61c23366e4073312ab12fa6d7e424 Mon Sep 17 00:00:00 2001 From: Radvil <36059968+radvil@users.noreply.github.com> Date: Wed, 15 May 2024 21:45:13 +0800 Subject: [PATCH 235/526] feat(typescript): configure inlayHint (#2995) * feat(typescript): configure inlayHint since LazyVim have toggle inlayhint keymap, it make sense to configure them for each extra languages provided. In this commit I just add the configuration for typescript, since IDK how to configure the rest of lang extras that was provided. * fix: changed defaults --------- Co-authored-by: Radvil Co-authored-by: Folke Lemaitre --- lua/lazyvim/plugins/extras/lang/typescript.lua | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua index 4bb280d6..4e3846ec 100644 --- a/lua/lazyvim/plugins/extras/lang/typescript.lua +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -1,3 +1,14 @@ +local inlay_hints_settings = { + includeInlayEnumMemberValueHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayFunctionParameterTypeHints = true, + includeInlayParameterNameHints = "literal", + includeInlayParameterNameHintsWhenArgumentMatchesName = false, + includeInlayPropertyDeclarationTypeHints = true, + includeInlayVariableTypeHints = false, + includeInlayVariableTypeHintsWhenTypeMatchesName = false, +} + return { -- add typescript to treesitter @@ -46,8 +57,13 @@ return { desc = "Remove Unused Imports", }, }, - ---@diagnostic disable-next-line: missing-fields settings = { + typescript = { + inlayHints = inlay_hints_settings, + }, + javascript = { + inlayHints = inlay_hints_settings, + }, completions = { completeFunctionCalls = true, }, From 91ead221167a722a8dd8651cb5c53bf5db4d1b4d Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 15 May 2024 15:48:46 +0200 Subject: [PATCH 236/526] feat(lua_ls): configure default lua_ls inlay hint settings --- lua/lazyvim/plugins/lsp/init.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 4681b384..26abffa0 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -75,6 +75,17 @@ return { completion = { callSnippet = "Replace", }, + doc = { + privateName = { "^_" }, + }, + hint = { + enable = true, + setType = false, + paramType = true, + paramName = "Disable", + semicolon = "Disable", + arrayIndex = "Disable", + }, }, }, }, From 914ca4a455169916da4614d76c15d1d1bf22e9bc Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 15 May 2024 15:53:19 +0200 Subject: [PATCH 237/526] feat(noice): added keymap `snt` to show Noice messages in telescope. Fixes #1306 --- lua/lazyvim/plugins/ui.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 2cd9496c..e983084f 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -322,6 +322,7 @@ return { { "snh", function() require("noice").cmd("history") end, desc = "Noice History" }, { "sna", function() require("noice").cmd("all") end, desc = "Noice All" }, { "snd", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" }, + { "snt", function() require("noice").cmd("telescope") end, desc = "Noice Telescope" }, { "", function() if not require("noice.lsp").scroll(4) then return "" end end, silent = true, expr = true, desc = "Scroll Forward", mode = {"i", "n", "s"} }, { "", function() if not require("noice.lsp").scroll(-4) then return "" end end, silent = true, expr = true, desc = "Scroll Backward", mode = {"i", "n", "s"}}, }, From 16e6c86b2778ba35696de5067ff033cc5bdbe6db Mon Sep 17 00:00:00 2001 From: Peter Benjamin Date: Wed, 15 May 2024 06:56:16 -0700 Subject: [PATCH 238/526] feat(terraform): ensure tflint is installed (#2336) --- lua/lazyvim/plugins/extras/lang/terraform.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/terraform.lua b/lua/lazyvim/plugins/extras/lang/terraform.lua index b199b4f1..02c05793 100644 --- a/lua/lazyvim/plugins/extras/lang/terraform.lua +++ b/lua/lazyvim/plugins/extras/lang/terraform.lua @@ -18,6 +18,14 @@ return { }, }, }, + -- ensure terraform tools are installed + { + "williamboman/mason.nvim", + opts = function(_, opts) + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, { "tflint" }) + end, + }, { "nvimtools/none-ls.nvim", optional = true, From a8659d02b954ca320088aab48aad8a95b3bbb86c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Schmidt?= Date: Wed, 15 May 2024 16:01:24 +0200 Subject: [PATCH 239/526] feat(omnisharp): support neotest dotnet (#3051) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Rafał Schmidt --- lua/lazyvim/plugins/extras/lang/omnisharp.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/omnisharp.lua b/lua/lazyvim/plugins/extras/lang/omnisharp.lua index d4bd698b..3885dd08 100644 --- a/lua/lazyvim/plugins/extras/lang/omnisharp.lua +++ b/lua/lazyvim/plugins/extras/lang/omnisharp.lua @@ -96,4 +96,18 @@ return { end end, }, + { + "nvim-neotest/neotest", + optional = true, + dependencies = { + "Issafalcon/neotest-dotnet", + }, + opts = { + adapters = { + ["neotest-dotnet"] = { + -- Here we can set options for neotest-dotnet + }, + }, + }, + }, } From d36e3a5c73c07f54b31c4ec5334f68ed5492123e Mon Sep 17 00:00:00 2001 From: Avinash Thakur <19588421+80avin@users.noreply.github.com> Date: Wed, 15 May 2024 19:38:15 +0530 Subject: [PATCH 240/526] fix(extras.lang.typescript): support `node` debug type along with `pwa-node` (#2983) * feat(typescript): add "node" debug adapter add "node" debug adapter for compatibility with .vscode/launch.json * refactor: ... --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/plugins/extras/lang/typescript.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua index 4e3846ec..a1c6aba1 100644 --- a/lua/lazyvim/plugins/extras/lang/typescript.lua +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -103,6 +103,20 @@ return { }, } end + if not dap.adapters["node"] then + dap.adapters["node"] = function(cb, config) + if config.type == "node" then + config.type = "pwa-node" + end + local nativeAdapter = dap.adapters["pwa-node"] + if type(nativeAdapter) == "function" then + nativeAdapter(cb, config) + else + cb(nativeAdapter) + end + end + end + for _, language in ipairs({ "typescript", "javascript", "typescriptreact", "javascriptreact" }) do if not dap.configurations[language] then dap.configurations[language] = { From 36802fea198f536ac20c0e2514fc4f54cee2904b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Freitas?= Date: Wed, 15 May 2024 14:10:06 +0000 Subject: [PATCH 241/526] fix(keymaps): better up/down keymaps description (#1909) --- lua/lazyvim/config/keymaps.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 79ae665d..71bc61b6 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -5,10 +5,10 @@ local map = LazyVim.safe_keymap_set -- better up/down -map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) -map({ "n", "x" }, "", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) -map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) -map({ "n", "x" }, "", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) +map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { desc = "Down", expr = true, silent = true }) +map({ "n", "x" }, "", "v:count == 0 ? 'gj' : 'j'", { desc = "Down", expr = true, silent = true }) +map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true }) +map({ "n", "x" }, "", "v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true }) -- Move to window using the hjkl keys map("n", "", "h", { desc = "Go to Left Window", remap = true }) From 9b7e4b7c030ebffa285288c5e96dc8e671b798a8 Mon Sep 17 00:00:00 2001 From: Leo Kirchner Date: Wed, 15 May 2024 16:11:27 +0200 Subject: [PATCH 242/526] docs(README-DE.md): improves German README (#2413) - Translates remaining English text - Fixes a couple of spelling and grammar issues --- README-DE.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/README-DE.md b/README-DE.md index e104f174..f5a05985 100644 --- a/README-DE.md +++ b/README-DE.md @@ -5,11 +5,11 @@

- Install + Installieren · - Configure + Konfigurieren · - Docs + Dokumentation

@@ -36,8 +36,8 @@

-LazyVim ist ein Neovim setup aufgebaut auf [💤 lazy.nvim](https://github.com/folke/lazy.nvim). -Es erleichter das Anpassen und erweitern von Ihrer Konfiguration. +LazyVim ist ein Neovim-Setup aufgebaut auf [💤 lazy.nvim](https://github.com/folke/lazy.nvim). +Es erleichtert das Anpassen und Erweitern von Ihrer Konfiguration. Anstatt von vorne anzufangen oder eine vorgefertigte Distro zu verwenden, gibt LazyVim das beste aus beiden Welten - die Flexibilität Ihre Konfiguration zu verändern und einzustellen wie Sie es wollen und die Einfachheit von einem vorgefertigten Setup. @@ -52,7 +52,7 @@ und die Einfachheit von einem vorgefertigten Setup. - 💤 Passe deine Konfiguration einfach an und erweitere diese mit [lazy.nvim](https://github.com/folke/lazy.nvim) - 🚀 Extrem schnell - 🧹 Logische Voreinstellungen für optionen, autocmds und keymaps -- 📦 Kommt mit einem Haufen vor Konfigurierten, ready to use Plugins +- 📦 Kommt mit einem Haufen vorkonfigurierter, ready-to-use Plugins ## ⚡️ Vorraussetzungen @@ -108,15 +108,15 @@ docker run -w /root -it --rm alpine:edge sh -uelic ' -## 📂 File Structure +## 📂 Dateistruktur -The files under config will be automatically loaded at the appropriate time, -so you don't need to require those files manually. -**LazyVim** comes with a set of default config files that will be loaded -**_before_** your own. See [here](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config) - -You can add your custom plugin specs under `lua/plugins/`. All files there -will be automatically loaded by [lazy.nvim](https://github.com/folke/lazy.nvim) +Die Dateien unter `config` werden automatisch und zur richtigen Zeit geladen, +sodass ein manuelles `require` nicht nötig ist. +**LazyVim** bringt Konfigurationsdatein mit, die **_vor_** Ihren eigenen geladen werden - +siehe [hier](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config) +Sie können eigene Plugins unter `lua/plugins/` hinzufügen. Alle Dateien innerhalb +dieses Ordners werden automatisch mit [lazy.nvim](https://github.com/folke/lazy.nvim) +geladen.
 ~/.config/nvim
@@ -133,6 +133,6 @@ will be automatically loaded by [lazy.nvim](https://github.com/folke/lazy.nvim)
 └── init.toml
 
-## ⚙️ Configuration +## ⚙️ Konfiguration -Refer to the [docs](https://lazyvim.github.io) +Siehe [Dokumentation](https://lazyvim.github.io). From 9337db17c2f6082e10c97456185d8ba3fa473769 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Wed, 15 May 2024 10:12:18 -0400 Subject: [PATCH 243/526] fix(autocmds): remove query from q-to-quit autocmd (#2838) --- lua/lazyvim/config/autocmds.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index 48faab3d..b2135870 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -59,7 +59,6 @@ vim.api.nvim_create_autocmd("FileType", { "lspinfo", "notify", "qf", - "query", "spectre_panel", "startuptime", "tsplayground", From fc5ee49495093fe8e63b1648f81af371c2930129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ph=C3=BAc=20H=2E=20L=C3=AA=20Kh=E1=BA=AFc?= Date: Wed, 15 May 2024 18:15:11 +0400 Subject: [PATCH 244/526] fix(gitsigns): update deprecated hunk nav mappings (#2935) --- lua/lazyvim/plugins/editor.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 907d2dc0..95267532 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -391,8 +391,10 @@ return { end -- stylua: ignore start - map("n", "]h", gs.next_hunk, "Next Hunk") - map("n", "[h", gs.prev_hunk, "Prev Hunk") + map("n", "]h", function() gs.nav_hunk("next") end, "Next Hunk") + map("n", "[h", function() gs.nav_hunk("prev") end, "Prev Hunk") + map("n", "]H", function() gs.nav_hunk("last") end, "Last Hunk") + map("n", "[H", function() gs.nav_hunk("first") end, "First Hunk") map({ "n", "v" }, "ghs", ":Gitsigns stage_hunk", "Stage Hunk") map({ "n", "v" }, "ghr", ":Gitsigns reset_hunk", "Reset Hunk") map("n", "ghS", gs.stage_buffer, "Stage Buffer") From c70a78e63137ec48e1c78b23413332716f572590 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 15 May 2024 16:23:38 +0200 Subject: [PATCH 245/526] fix(cmp): dont add autobrackets if prev char is a bracket. Closes #2949 --- lua/lazyvim/plugins/coding.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 3cdcc668..17380078 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -84,8 +84,11 @@ return { local entry = event.entry local item = entry:get_completion_item() if vim.tbl_contains({ Kind.Function, Kind.Method }, item.kind) then - local keys = vim.api.nvim_replace_termcodes("()", false, false, true) - vim.api.nvim_feedkeys(keys, "i", true) + local prev_char = vim.fn.getline("."):sub(vim.fn.col(".") - 1, vim.fn.col(".")) + if prev_char ~= "(" and prev_char ~= ")" then + local keys = vim.api.nvim_replace_termcodes("()", false, false, true) + vim.api.nvim_feedkeys(keys, "i", true) + end end end) end, From f25ac504b896a522c645d456766adac2afa28801 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 15 May 2024 18:09:55 +0200 Subject: [PATCH 246/526] perf(yanky): remove performance optim for sqlite since it has been merged upstream --- lua/lazyvim/plugins/extras/coding/yanky.lua | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lua/lazyvim/plugins/extras/coding/yanky.lua b/lua/lazyvim/plugins/extras/coding/yanky.lua index a1ef26c7..3e3a3bbc 100644 --- a/lua/lazyvim/plugins/extras/coding/yanky.lua +++ b/lua/lazyvim/plugins/extras/coding/yanky.lua @@ -28,11 +28,5 @@ return { { "=p", "(YankyPutAfterFilter)", desc = "Put After Applying a Filter" }, { "=P", "(YankyPutBeforeFilter)", desc = "Put Before Applying a Filter" }, }, - config = function(_, opts) - require("yanky").setup(opts) - local sqlite = require("yanky.storage.sqlite") - local push = sqlite.push - sqlite.push = vim.schedule_wrap(push) - end, }, } From b601ade71c7f8feacf62a762d4e81cf99c055ea7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 15 May 2024 18:12:55 +0200 Subject: [PATCH 247/526] chore(main): release 10.25.0 (#3147) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba1a334d..bc9ff8ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,49 @@ # Changelog +## [10.25.0](https://github.com/LazyVim/LazyVim/compare/v10.24.0...v10.25.0) (2024-05-15) + + +### Features + +* **extras:** add refactoring.nvim ([#3040](https://github.com/LazyVim/LazyVim/issues/3040)) ([73de8dd](https://github.com/LazyVim/LazyVim/commit/73de8dde2bb513337426d5ead862e4fc6dbb8fdf)) +* **lua_ls:** configure default lua_ls inlay hint settings ([91ead22](https://github.com/LazyVim/LazyVim/commit/91ead221167a722a8dd8651cb5c53bf5db4d1b4d)) +* **lua:** added `LazyVim` as a treesitter builtin ([a97fa3b](https://github.com/LazyVim/LazyVim/commit/a97fa3b7563eb2c5305c8f32461bb150d17e45ae)) +* **noice:** added keymap `<leader>snt` to show Noice messages in telescope. Fixes [#1306](https://github.com/LazyVim/LazyVim/issues/1306) ([914ca4a](https://github.com/LazyVim/LazyVim/commit/914ca4a455169916da4614d76c15d1d1bf22e9bc)) +* **omnisharp:** support neotest dotnet ([#3051](https://github.com/LazyVim/LazyVim/issues/3051)) ([a8659d0](https://github.com/LazyVim/LazyVim/commit/a8659d02b954ca320088aab48aad8a95b3bbb86c)) +* **snippet:** add friendly-snippets to native extra ([#2944](https://github.com/LazyVim/LazyVim/issues/2944)) ([12a48b8](https://github.com/LazyVim/LazyVim/commit/12a48b8ce1521fcac01b89099a4ca8bbc3547769)) +* **terraform:** ensure tflint is installed ([#2336](https://github.com/LazyVim/LazyVim/issues/2336)) ([16e6c86](https://github.com/LazyVim/LazyVim/commit/16e6c86b2778ba35696de5067ff033cc5bdbe6db)) +* **typescript:** configure inlayHint ([#2995](https://github.com/LazyVim/LazyVim/issues/2995)) ([2c86da7](https://github.com/LazyVim/LazyVim/commit/2c86da7c2df61c23366e4073312ab12fa6d7e424)) +* **vue:** add Vue.js support to LazyVim ([#3094](https://github.com/LazyVim/LazyVim/issues/3094)) ([f449025](https://github.com/LazyVim/LazyVim/commit/f4490252fb2262208923ba197eb521732a602ac1)) + + +### Bug Fixes + +* **ansible:** ansiblels not loading, keymap desc. ([#2739](https://github.com/LazyVim/LazyVim/issues/2739)) ([abb1ff0](https://github.com/LazyVim/LazyVim/commit/abb1ff0d600b3446b612390f0482cf92bdc84ab0)) +* **autocmds:** remove query from q-to-quit autocmd ([#2838](https://github.com/LazyVim/LazyVim/issues/2838)) ([9337db1](https://github.com/LazyVim/LazyVim/commit/9337db17c2f6082e10c97456185d8ba3fa473769)) +* **clangd:** update the attribute name for process ID ([#3047](https://github.com/LazyVim/LazyVim/issues/3047)) ([3c04789](https://github.com/LazyVim/LazyVim/commit/3c04789ef15bba15e8c0c71ef31db38c76b2ad67)) +* **cmp:** dont add autobrackets if prev char is a bracket. Closes [#2949](https://github.com/LazyVim/LazyVim/issues/2949) ([c70a78e](https://github.com/LazyVim/LazyVim/commit/c70a78e63137ec48e1c78b23413332716f572590)) +* **dap:** load vscode launch files with jsonc parser ([#1839](https://github.com/LazyVim/LazyVim/issues/1839)) ([543dead](https://github.com/LazyVim/LazyVim/commit/543dead590a949255fbbada9e1775c31ad654682)) +* **dial:** Fix dial commands in Visual line+block ([#2933](https://github.com/LazyVim/LazyVim/issues/2933)) ([1df3c5d](https://github.com/LazyVim/LazyVim/commit/1df3c5d70b2265f8582b0ed414f085e9066960da)) +* **dot:** remove `.env` => `sh` since this is already the default ([a0afe8f](https://github.com/LazyVim/LazyVim/commit/a0afe8fef9dc76b469a78435cdd3f2c5ee01f282)) +* **dot:** use syntax `sh` for dotenv files. Closes [#3145](https://github.com/LazyVim/LazyVim/issues/3145) ([42010d1](https://github.com/LazyVim/LazyVim/commit/42010d1dfbb0ba9c74c1ec0c93c5c9db21ebee47)) +* **extras.lang.typescript:** support `node` debug type along with `pwa-node` ([#2983](https://github.com/LazyVim/LazyVim/issues/2983)) ([d36e3a5](https://github.com/LazyVim/LazyVim/commit/d36e3a5c73c07f54b31c4ec5334f68ed5492123e)) +* **fzf-native:** try rebuilding fzf-native when needed. Fixes [#2464](https://github.com/LazyVim/LazyVim/issues/2464) ([39901c1](https://github.com/LazyVim/LazyVim/commit/39901c1f00eca36beb211978164744ae41be7781)) +* **gitsigns:** update deprecated hunk nav mappings ([#2935](https://github.com/LazyVim/LazyVim/issues/2935)) ([fc5ee49](https://github.com/LazyVim/LazyVim/commit/fc5ee49495093fe8e63b1648f81af371c2930129)) +* **keymaps:** better up/down keymaps description ([#1909](https://github.com/LazyVim/LazyVim/issues/1909)) ([36802fe](https://github.com/LazyVim/LazyVim/commit/36802fea198f536ac20c0e2514fc4f54cee2904b)) +* **lazyfile:** exclude `filetypedetect` from skips ([#3004](https://github.com/LazyVim/LazyVim/issues/3004)) ([c54eeb5](https://github.com/LazyVim/LazyVim/commit/c54eeb53905e8da27814f52eaf1ad63aeff4cbe4)) +* **lsp:** check if `diagnostics.signs` is disabled by user ([#2897](https://github.com/LazyVim/LazyVim/issues/2897)) ([6a25450](https://github.com/LazyVim/LazyVim/commit/6a2545025eb6fcc78998b8a4c6d121729980925b)) +* **pretty_path:** properly escape `%` characters ([e89653f](https://github.com/LazyVim/LazyVim/commit/e89653f4107724f53964a379337947490117a7dc)) +* **rust:** update creates.nvim src option to completion ([#3149](https://github.com/LazyVim/LazyVim/issues/3149)) ([8087283](https://github.com/LazyVim/LazyVim/commit/8087283fea62e5673764dfa13906eadb24110622)) + + +### Performance Improvements + +* **startup:** render a file opened from the cmdline as soon as possible and get rid of lazy_file logic ([965a469](https://github.com/LazyVim/LazyVim/commit/965a469ca8cb1d58b49c4e5d8b85430e8c6c0a25)) +* **treesitter:** dont let nvim-treesitter-textobjects stall loading treesitter ([8301096](https://github.com/LazyVim/LazyVim/commit/8301096c31f9855c74d5b732367b679bc8721b5e)) +* **treesitter:** load treesitter early during startup when opening a file from the cmdline ([b29d169](https://github.com/LazyVim/LazyVim/commit/b29d169afb7560ed4a9276e4379e28ffaed1a171)) +* **yanky:** `schedule_wrap` sqlite push to history to prevent blocking Neovim on copy/paste ([9047d04](https://github.com/LazyVim/LazyVim/commit/9047d041a8296e34ed7236e5344f5b927cd28f8b)) +* **yanky:** remove performance optim for sqlite since it has been merged upstream ([f25ac50](https://github.com/LazyVim/LazyVim/commit/f25ac504b896a522c645d456766adac2afa28801)) + ## [10.24.0](https://github.com/LazyVim/LazyVim/compare/v10.23.0...v10.24.0) (2024-05-12) From 44d51e5a6521aef6093751c263f73b149f1c3771 Mon Sep 17 00:00:00 2001 From: Rubin Bhandari Date: Thu, 16 May 2024 11:44:19 +0545 Subject: [PATCH 248/526] refactor(options): prefer opt in place of vim.opt (#3167) --- lua/lazyvim/config/options.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lua/lazyvim/config/options.lua b/lua/lazyvim/config/options.lua index c20adcec..31141c67 100644 --- a/lua/lazyvim/config/options.lua +++ b/lua/lazyvim/config/options.lua @@ -92,21 +92,21 @@ if vim.fn.has("nvim-0.10") == 1 then end -- Folding -vim.opt.foldlevel = 99 +opt.foldlevel = 99 if vim.fn.has("nvim-0.9.0") == 1 then - vim.opt.statuscolumn = [[%!v:lua.require'lazyvim.util'.ui.statuscolumn()]] - vim.opt.foldtext = "v:lua.require'lazyvim.util'.ui.foldtext()" + opt.statuscolumn = [[%!v:lua.require'lazyvim.util'.ui.statuscolumn()]] + opt.foldtext = "v:lua.require'lazyvim.util'.ui.foldtext()" end -- HACK: causes freezes on <= 0.9, so only enable on >= 0.10 for now if vim.fn.has("nvim-0.10") == 1 then - vim.opt.foldmethod = "expr" - vim.opt.foldexpr = "v:lua.require'lazyvim.util'.ui.foldexpr()" - vim.opt.foldtext = "" - vim.opt.fillchars = "fold: " + opt.foldmethod = "expr" + opt.foldexpr = "v:lua.require'lazyvim.util'.ui.foldexpr()" + opt.foldtext = "" + opt.fillchars = "fold: " else - vim.opt.foldmethod = "indent" + opt.foldmethod = "indent" end vim.o.formatexpr = "v:lua.require'lazyvim.util'.format.formatexpr()" From 97d7b2d262f18ad41b64299eeb02174ba1dde68b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 16 May 2024 05:59:54 +0000 Subject: [PATCH 249/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 78d4c15c..6df78613 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 15 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 16 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 6e7ba50141b1cda415c9391fd345a1e428bad9b6 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 16 May 2024 08:07:29 +0200 Subject: [PATCH 250/526] fix(cmp): never auto bracket for snippets and correct prev char check. Fixes #2949 --- lua/lazyvim/plugins/coding.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 17380078..e279187d 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -83,8 +83,9 @@ return { end local entry = event.entry local item = entry:get_completion_item() - if vim.tbl_contains({ Kind.Function, Kind.Method }, item.kind) then - local prev_char = vim.fn.getline("."):sub(vim.fn.col(".") - 1, vim.fn.col(".")) + if vim.tbl_contains({ Kind.Function, Kind.Method }, item.kind) and item.insertTextFormat ~= 2 then + local cursor = vim.api.nvim_win_get_cursor(0) + local prev_char = vim.api.nvim_buf_get_text(0, cursor[1] - 1, cursor[2], cursor[1] - 1, cursor[2] + 1, {})[1] if prev_char ~= "(" and prev_char ~= ")" then local keys = vim.api.nvim_replace_termcodes("()", false, false, true) vim.api.nvim_feedkeys(keys, "i", true) From 183d6eea606556c8bd7f80a70660c54670e04649 Mon Sep 17 00:00:00 2001 From: Avinash Thakur <19588421+80avin@users.noreply.github.com> Date: Thu, 16 May 2024 15:27:56 +0530 Subject: [PATCH 251/526] fix(dap): add debugger to filetypes mapping for launch.json (#3165) --- lua/lazyvim/plugins/extras/dap/core.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/dap/core.lua b/lua/lazyvim/plugins/extras/dap/core.lua index bf57ebc3..285d7258 100644 --- a/lua/lazyvim/plugins/extras/dap/core.lua +++ b/lua/lazyvim/plugins/extras/dap/core.lua @@ -121,7 +121,12 @@ return { -- setup dap config by VsCode launch.json file local vscode = require("dap.ext.vscode") + local _filetypes = require("mason-nvim-dap.mappings.filetypes") + local filetypes = vim.tbl_deep_extend("force", _filetypes, { + ["node"] = { "javascriptreact", "typescriptreact", "typescript", "javascript" }, + ["pwa-node"] = { "javascriptreact", "typescriptreact", "typescript", "javascript" }, + }) vscode.json_decode = require("neoconf.json.jsonc").decode_jsonc - vscode.load_launchjs() + vscode.load_launchjs(nil, filetypes) end, } From 2391ac04202b04c0321fedcf17e47859d56458b2 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 16 May 2024 16:37:26 +0200 Subject: [PATCH 252/526] refactor(options): refactored options --- lua/lazyvim/config/options.lua | 59 ++++++++++++---------------------- 1 file changed, 21 insertions(+), 38 deletions(-) diff --git a/lua/lazyvim/config/options.lua b/lua/lazyvim/config/options.lua index 31141c67..80223ad1 100644 --- a/lua/lazyvim/config/options.lua +++ b/lua/lazyvim/config/options.lua @@ -2,7 +2,7 @@ vim.g.mapleader = " " vim.g.maplocalleader = "\\" --- Enable LazyVim auto format +-- LazyVim auto format vim.g.autoformat = true -- LazyVim root dir detection @@ -28,18 +28,24 @@ vim.g.lazygit_config = true local opt = vim.opt opt.autowrite = true -- Enable auto write - -if not vim.env.SSH_TTY then - -- only set clipboard if not in ssh, to make sure the OSC 52 - -- integration works automatically. Requires Neovim >= 0.10.0 - opt.clipboard = "unnamedplus" -- Sync with system clipboard -end - +-- only set clipboard if not in ssh, to make sure the OSC 52 +-- integration works automatically. Requires Neovim >= 0.10.0 +opt.clipboard = vim.env.SSH_TTY and "" or "unnamedplus" -- Sync with system clipboard opt.completeopt = "menu,menuone,noselect" opt.conceallevel = 2 -- Hide * markup for bold and italic, but not markers with substitutions opt.confirm = true -- Confirm to save changes before exiting modified buffer opt.cursorline = true -- Enable highlighting of the current line opt.expandtab = true -- Use spaces instead of tabs +opt.fillchars = { + foldopen = "", + foldclose = "", + fold = " ", + foldsep = " ", + diff = "╱", + eob = " ", +} +opt.foldlevel = 99 +opt.formatexpr = "v:lua.require'lazyvim.util'.format.formatexpr()" opt.formatoptions = "jcroqlnt" -- tcqj opt.grepformat = "%f:%l:%c:%m" opt.grepprg = "rg --vimgrep" @@ -66,11 +72,10 @@ opt.spelllang = { "en" } opt.splitbelow = true -- Put new windows below current opt.splitkeep = "screen" opt.splitright = true -- Put new windows right of current +opt.statuscolumn = [[%!v:lua.require'lazyvim.util'.ui.statuscolumn()]] opt.tabstop = 2 -- Number of spaces tabs count for opt.termguicolors = true -- True color support -if not vim.g.vscode then - opt.timeoutlen = 300 -- Lower than default (1000) to quickly trigger which-key -end +opt.timeoutlen = vim.g.vscode and 1000 or 300 -- Lower than default (1000) to quickly trigger which-key opt.undofile = true opt.undolevels = 10000 opt.updatetime = 200 -- Save swap file and trigger CursorHold @@ -78,38 +83,16 @@ opt.virtualedit = "block" -- Allow cursor to move where there is no text in visu opt.wildmode = "longest:full,full" -- Command-line completion mode opt.winminwidth = 5 -- Minimum window width opt.wrap = false -- Disable line wrap -opt.fillchars = { - foldopen = "", - foldclose = "", - fold = " ", - foldsep = " ", - diff = "╱", - eob = " ", -} if vim.fn.has("nvim-0.10") == 1 then opt.smoothscroll = true -end - --- Folding -opt.foldlevel = 99 - -if vim.fn.has("nvim-0.9.0") == 1 then - opt.statuscolumn = [[%!v:lua.require'lazyvim.util'.ui.statuscolumn()]] + opt.foldexpr = "v:lua.require'lazyvim.util'.ui.foldexpr()" + opt.foldmethod = "expr" + opt.foldtext = "" +else + opt.foldmethod = "indent" opt.foldtext = "v:lua.require'lazyvim.util'.ui.foldtext()" end --- HACK: causes freezes on <= 0.9, so only enable on >= 0.10 for now -if vim.fn.has("nvim-0.10") == 1 then - opt.foldmethod = "expr" - opt.foldexpr = "v:lua.require'lazyvim.util'.ui.foldexpr()" - opt.foldtext = "" - opt.fillchars = "fold: " -else - opt.foldmethod = "indent" -end - -vim.o.formatexpr = "v:lua.require'lazyvim.util'.format.formatexpr()" - -- Fix markdown indentation settings vim.g.markdown_recommended_style = 0 From 8dae76c1fd6fb90199b56cda8b6ec21576d02eb5 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 16 May 2024 16:44:01 +0200 Subject: [PATCH 253/526] fix(dap): use jsonc support from plenary. Same as the code from neoconf. Fixes #3174 --- lua/lazyvim/plugins/extras/dap/core.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/dap/core.lua b/lua/lazyvim/plugins/extras/dap/core.lua index 285d7258..fa6724b3 100644 --- a/lua/lazyvim/plugins/extras/dap/core.lua +++ b/lua/lazyvim/plugins/extras/dap/core.lua @@ -126,7 +126,10 @@ return { ["node"] = { "javascriptreact", "typescriptreact", "typescript", "javascript" }, ["pwa-node"] = { "javascriptreact", "typescriptreact", "typescript", "javascript" }, }) - vscode.json_decode = require("neoconf.json.jsonc").decode_jsonc + local json = require("plenary.json") + vscode.json_decode = function(str) + return vim.json.decode(json.json_strip_comments(str)) + end vscode.load_launchjs(nil, filetypes) end, } From 9fe8b15928077cb0c20aeea111b42f9698c78330 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 16 May 2024 16:49:35 +0200 Subject: [PATCH 254/526] fix(health): add warning when not using 0.10.0 --- lua/lazyvim/health.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lazyvim/health.lua b/lua/lazyvim/health.lua index a23c90f5..4822de86 100644 --- a/lua/lazyvim/health.lua +++ b/lua/lazyvim/health.lua @@ -10,6 +10,9 @@ function M.check() if vim.fn.has("nvim-0.9.0") == 1 then ok("Using Neovim >= 0.9.0") + if vim.fn.has("nvim-0.10.0") == 0 then + warn("Use Neovim >= 0.10.0 for the best experience") + end else error("Neovim >= 0.9.0 is required") end From f02507b1598379250baab293c423f79c393e28e5 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 16 May 2024 17:44:32 +0200 Subject: [PATCH 255/526] feat(util): set_upvalue --- lua/lazyvim/util/inject.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lua/lazyvim/util/inject.lua b/lua/lazyvim/util/inject.lua index 81e0f57a..859afc81 100644 --- a/lua/lazyvim/util/inject.lua +++ b/lua/lazyvim/util/inject.lua @@ -31,4 +31,20 @@ function M.get_upvalue(func, name) end end +function M.set_upvalue(func, name, value) + local i = 1 + while true do + local n = debug.getupvalue(func, i) + if not n then + break + end + if n == name then + debug.setupvalue(func, i, value) + return + end + i = i + 1 + end + LazyVim.error("upvalue not found: " .. name) +end + return M From d999be7401783e0f3a610319fa1b327d38fa3e52 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 16 May 2024 17:45:12 +0200 Subject: [PATCH 256/526] feat(coding)!: use native comments on 0.10, with support for ts_context_commentstring --- lua/lazyvim/plugins/coding.lua | 26 +++++++++++-------- .../plugins/extras/coding/mini-comment.lua | 13 ++++++++++ 2 files changed, 28 insertions(+), 11 deletions(-) create mode 100644 lua/lazyvim/plugins/extras/coding/mini-comment.lua diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index e279187d..a917cbc4 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -210,18 +210,22 @@ return { opts = { enable_autocmd = false, }, + init = function() + if vim.fn.has("nvim-0.10") == 1 then + -- Majestically override the native `get_commentstring` function. + vim.schedule(function() + LazyVim.inject.set_upvalue( + LazyVim.inject.get_upvalue(require("vim._comment").textobject, "get_comment_parts"), + "get_commentstring", + function() + return require("ts_context_commentstring.internal").calculate_commentstring() or vim.bo.commentstring + end + ) + end) + end + end, }, - { - "echasnovski/mini.comment", - event = "VeryLazy", - opts = { - options = { - custom_commentstring = function() - return require("ts_context_commentstring.internal").calculate_commentstring() or vim.bo.commentstring - end, - }, - }, - }, + { import = "lazyvim.plugins.extras.coding.mini-comment", enabled = vim.fn.has("nvim-0.10") == 0 }, -- Better text-objects { diff --git a/lua/lazyvim/plugins/extras/coding/mini-comment.lua b/lua/lazyvim/plugins/extras/coding/mini-comment.lua new file mode 100644 index 00000000..d401c9de --- /dev/null +++ b/lua/lazyvim/plugins/extras/coding/mini-comment.lua @@ -0,0 +1,13 @@ +return { + { + "echasnovski/mini.comment", + event = "VeryLazy", + opts = { + options = { + custom_commentstring = function() + return require("ts_context_commentstring.internal").calculate_commentstring() or vim.bo.commentstring + end, + }, + }, + }, +} From 3c4ebd522e7c475cfedcee5dfa7a008e798c404c Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 16 May 2024 18:03:58 +0200 Subject: [PATCH 257/526] feat(coding)!: native snippets are now the default on Neovim 0.10. Install the luasnip extra to get luasnip back --- lua/lazyvim/plugins/coding.lua | 85 +++++++++++-------- lua/lazyvim/plugins/extras/coding/luasnip.lua | 44 ++++++++++ .../plugins/extras/coding/native_snippets.lua | 69 --------------- lua/lazyvim/util/plugin.lua | 3 +- 4 files changed, 96 insertions(+), 105 deletions(-) create mode 100644 lua/lazyvim/plugins/extras/coding/luasnip.lua delete mode 100644 lua/lazyvim/plugins/extras/coding/native_snippets.lua diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index a917cbc4..3280f957 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -96,50 +96,65 @@ return { }, -- snippets - { - "L3MON4D3/LuaSnip", - build = (not LazyVim.is_win()) - and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp" - or nil, - dependencies = { - { - "rafamadriz/friendly-snippets", - config = function() - require("luasnip.loaders.from_vscode").lazy_load() - end, - }, - { + vim.snippet + and { "nvim-cmp", dependencies = { - "saadparwaiz1/cmp_luasnip", + { "rafamadriz/friendly-snippets" }, + { "garymjr/nvim-snippets", opts = { friendly_snippets = true } }, }, opts = function(_, opts) opts.snippet = { expand = function(args) - require("luasnip").lsp_expand(args.body) + vim.snippet.expand(args.body) end, } - table.insert(opts.sources, { name = "luasnip" }) + table.insert(opts.sources, { name = "snippets" }) end, - }, - }, - opts = { - history = true, - delete_check_events = "TextChanged", - }, - -- stylua: ignore - keys = { - { - "", - function() - return require("luasnip").jumpable(1) and "luasnip-jump-next" or "" - end, - expr = true, silent = true, mode = "i", - }, - { "", function() require("luasnip").jump(1) end, mode = "s" }, - { "", function() require("luasnip").jump(-1) end, mode = { "i", "s" } }, - }, - }, + keys = { + { + "", + function() + if vim.snippet.active({ direction = 1 }) then + vim.schedule(function() + vim.snippet.jump(1) + end) + return + end + return "" + end, + expr = true, + silent = true, + mode = "i", + }, + { + "", + function() + vim.schedule(function() + vim.snippet.jump(1) + end) + end, + silent = true, + mode = "s", + }, + { + "", + function() + if vim.snippet.active({ direction = -1 }) then + vim.schedule(function() + vim.snippet.jump(-1) + end) + return + end + return "" + end, + expr = true, + silent = true, + mode = { "i", "s" }, + }, + }, + } + or { import = "lazyvim.plugins.extras.coding.luasnip", enabled = vim.fn.has("nvim-0.10") == 0 }, -- auto pairs { diff --git a/lua/lazyvim/plugins/extras/coding/luasnip.lua b/lua/lazyvim/plugins/extras/coding/luasnip.lua new file mode 100644 index 00000000..3a12f9db --- /dev/null +++ b/lua/lazyvim/plugins/extras/coding/luasnip.lua @@ -0,0 +1,44 @@ +return { + "L3MON4D3/LuaSnip", + build = (not LazyVim.is_win()) + and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp" + or nil, + dependencies = { + { + "rafamadriz/friendly-snippets", + config = function() + require("luasnip.loaders.from_vscode").lazy_load() + end, + }, + { + "nvim-cmp", + dependencies = { + "saadparwaiz1/cmp_luasnip", + }, + opts = function(_, opts) + opts.snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + } + table.insert(opts.sources, { name = "luasnip" }) + end, + }, + }, + opts = { + history = true, + delete_check_events = "TextChanged", + }, + -- stylua: ignore + keys = { + { + "", + function() + return require("luasnip").jumpable(1) and "luasnip-jump-next" or "" + end, + expr = true, silent = true, mode = "i", + }, + { "", function() require("luasnip").jump(1) end, mode = "s" }, + { "", function() require("luasnip").jump(-1) end, mode = { "i", "s" } }, + }, +} diff --git a/lua/lazyvim/plugins/extras/coding/native_snippets.lua b/lua/lazyvim/plugins/extras/coding/native_snippets.lua deleted file mode 100644 index e94d40ad..00000000 --- a/lua/lazyvim/plugins/extras/coding/native_snippets.lua +++ /dev/null @@ -1,69 +0,0 @@ -if not vim.snippet then - LazyVim.warn("Native snippets are only supported on Neovim >= 0.10.0") - return {} -end - -return { - desc = "Use native snippets instead of LuaSnip. Only works on Neovim >= 0.10!", - { - "L3MON4D3/LuaSnip", - enabled = false, - }, - { - "nvim-cmp", - dependencies = { - { "rafamadriz/friendly-snippets" }, - { "garymjr/nvim-snippets", opts = { friendly_snippets = true } }, - }, - opts = function(_, opts) - opts.snippet = { - expand = function(args) - vim.snippet.expand(args.body) - end, - } - table.insert(opts.sources, { name = "snippets" }) - end, - keys = { - { - "", - function() - if vim.snippet.active({ direction = 1 }) then - vim.schedule(function() - vim.snippet.jump(1) - end) - return - end - return "" - end, - expr = true, - silent = true, - mode = "i", - }, - { - "", - function() - vim.schedule(function() - vim.snippet.jump(1) - end) - end, - silent = true, - mode = "s", - }, - { - "", - function() - if vim.snippet.active({ direction = -1 }) then - vim.schedule(function() - vim.snippet.jump(-1) - end) - return - end - return "" - end, - expr = true, - silent = true, - mode = { "i", "s" }, - }, - }, - }, -} diff --git a/lua/lazyvim/util/plugin.lua b/lua/lazyvim/util/plugin.lua index 3e90a767..ad13247a 100644 --- a/lua/lazyvim/util/plugin.lua +++ b/lua/lazyvim/util/plugin.lua @@ -10,6 +10,7 @@ M.deprecated_extras = { ["lazyvim.plugins.extras.formatting.conform"] = "`conform.nvim` is now the default **LazyVim** formatter.", ["lazyvim.plugins.extras.linting.nvim-lint"] = "`nvim-lint` is now the default **LazyVim** linter.", ["lazyvim.plugins.extras.ui.dashboard"] = "`dashboard.nvim` is now the default **LazyVim** starter.", + ["lazyvim.plugins.extras.coding.native_snippets"] = "Native snippets are now the default for **Neovim >= 0.10**", } M.deprecated_modules = { @@ -91,7 +92,7 @@ function M.fix_imports() Plugin.Spec.import = LazyVim.inject.args(Plugin.Spec.import, function(_, spec) local dep = M.deprecated_extras[spec and spec.import] if dep then - dep = dep .. "\n" .. "Please remove the extra to hide this warning." + dep = dep .. "\n" .. "Please remove the extra from `lazyvim.json` to hide this warning." LazyVim.warn(dep, { title = "LazyVim", once = true, stacktrace = true, stacklevel = 6 }) return false end From 9839f10013b287229f4aaad14e75a6044d0f6cb5 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 16 May 2024 18:07:38 +0200 Subject: [PATCH 258/526] refactor: comments code --- lua/lazyvim/plugins/coding.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 3280f957..d4070b4c 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -225,7 +225,10 @@ return { opts = { enable_autocmd = false, }, - init = function() + }, + { + import = "lazyvim.plugins.extras.coding.mini-comment", + enabled = function() if vim.fn.has("nvim-0.10") == 1 then -- Majestically override the native `get_commentstring` function. vim.schedule(function() @@ -237,10 +240,11 @@ return { end ) end) + else + return true end end, }, - { import = "lazyvim.plugins.extras.coding.mini-comment", enabled = vim.fn.has("nvim-0.10") == 0 }, -- Better text-objects { From 03704e22998be9db17f114acc4060d714fe652fb Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 16 May 2024 18:20:09 +0200 Subject: [PATCH 259/526] feat(ui)!: moved treesitter-context to an extra. No longer a core plugin --- lua/lazyvim/plugins/editor.lua | 1 - .../plugins/extras/ui/treesitter-context.lua | 21 +++++++++++++++++ lua/lazyvim/plugins/treesitter.lua | 23 ------------------- 3 files changed, 21 insertions(+), 24 deletions(-) create mode 100644 lua/lazyvim/plugins/extras/ui/treesitter-context.lua diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 95267532..61f9cd86 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -452,7 +452,6 @@ return { -- buffer remove { "echasnovski/mini.bufremove", - keys = { { "bd", diff --git a/lua/lazyvim/plugins/extras/ui/treesitter-context.lua b/lua/lazyvim/plugins/extras/ui/treesitter-context.lua new file mode 100644 index 00000000..a1f8d5f3 --- /dev/null +++ b/lua/lazyvim/plugins/extras/ui/treesitter-context.lua @@ -0,0 +1,21 @@ +-- Show context of the current function +return { + "nvim-treesitter/nvim-treesitter-context", + event = "LazyFile", + opts = { mode = "cursor", max_lines = 3 }, + keys = { + { + "ut", + function() + local tsc = require("treesitter-context") + tsc.toggle() + if LazyVim.inject.get_upvalue(tsc.toggle, "enabled") then + LazyVim.info("Enabled Treesitter Context", { title = "Option" }) + else + LazyVim.warn("Disabled Treesitter Context", { title = "Option" }) + end + end, + desc = "Toggle Treesitter Context", + }, + }, +} diff --git a/lua/lazyvim/plugins/treesitter.lua b/lua/lazyvim/plugins/treesitter.lua index 97479b91..19aef89b 100644 --- a/lua/lazyvim/plugins/treesitter.lua +++ b/lua/lazyvim/plugins/treesitter.lua @@ -118,29 +118,6 @@ return { end, }, - -- Show context of the current function - { - "nvim-treesitter/nvim-treesitter-context", - event = "LazyFile", - enabled = true, - opts = { mode = "cursor", max_lines = 3 }, - keys = { - { - "ut", - function() - local tsc = require("treesitter-context") - tsc.toggle() - if LazyVim.inject.get_upvalue(tsc.toggle, "enabled") then - LazyVim.info("Enabled Treesitter Context", { title = "Option" }) - else - LazyVim.warn("Disabled Treesitter Context", { title = "Option" }) - end - end, - desc = "Toggle Treesitter Context", - }, - }, - }, - -- Automatically add closing tags for HTML and JSX { "windwp/nvim-ts-autotag", From 69e6daae2ccb4b7b7180e439c1b05d72d3c64e11 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 16 May 2024 18:53:21 +0200 Subject: [PATCH 260/526] feat(ui)!: move `mini.indentscope` to an extra --- .../plugins/extras/ui/mini-indentscope.lua | 42 +++++++++++++++++++ lua/lazyvim/plugins/ui.lua | 36 +--------------- 2 files changed, 43 insertions(+), 35 deletions(-) create mode 100644 lua/lazyvim/plugins/extras/ui/mini-indentscope.lua diff --git a/lua/lazyvim/plugins/extras/ui/mini-indentscope.lua b/lua/lazyvim/plugins/extras/ui/mini-indentscope.lua new file mode 100644 index 00000000..a7632145 --- /dev/null +++ b/lua/lazyvim/plugins/extras/ui/mini-indentscope.lua @@ -0,0 +1,42 @@ +return { + -- Active indent guide and indent text objects. When you're browsing + -- code, this highlights the current level of indentation, and animates + -- the highlighting. + { + "echasnovski/mini.indentscope", + version = false, -- wait till new 0.7.0 release to put it back on semver + event = "LazyFile", + opts = { + -- symbol = "▏", + symbol = "│", + options = { try_as_border = true }, + }, + init = function() + vim.api.nvim_create_autocmd("FileType", { + pattern = { + "help", + "alpha", + "dashboard", + "neo-tree", + "Trouble", + "trouble", + "lazy", + "mason", + "notify", + "toggleterm", + "lazyterm", + }, + callback = function() + vim.b.miniindentscope_disable = true + end, + }) + end, + }, + { + "lukas-reineke/indent-blankline.nvim", + event = "LazyFile", + opts = { + scope = { enabled = false }, + }, + }, +} diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index e983084f..c24b6e44 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -219,7 +219,7 @@ return { char = "│", tab_char = "│", }, - scope = { enabled = false }, + scope = { show_start = false, show_end = false }, exclude = { filetypes = { "help", @@ -239,40 +239,6 @@ return { main = "ibl", }, - -- Active indent guide and indent text objects. When you're browsing - -- code, this highlights the current level of indentation, and animates - -- the highlighting. - { - "echasnovski/mini.indentscope", - version = false, -- wait till new 0.7.0 release to put it back on semver - event = "LazyFile", - opts = { - -- symbol = "▏", - symbol = "│", - options = { try_as_border = true }, - }, - init = function() - vim.api.nvim_create_autocmd("FileType", { - pattern = { - "help", - "alpha", - "dashboard", - "neo-tree", - "Trouble", - "trouble", - "lazy", - "mason", - "notify", - "toggleterm", - "lazyterm", - }, - callback = function() - vim.b.miniindentscope_disable = true - end, - }) - end, - }, - -- Displays a popup with possible key bindings of the command you started typing { "folke/which-key.nvim", From e37a699096ccb209c1babc29c1d5eeeab74102a1 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 16 May 2024 18:55:50 +0200 Subject: [PATCH 261/526] feat(mini.surround)!: move `mini.surround` to an extra --- lua/lazyvim/plugins/coding.lua | 37 ------------------- .../plugins/extras/coding/mini-surround.lua | 36 ++++++++++++++++++ lua/lazyvim/plugins/extras/editor/leap.lua | 1 + 3 files changed, 37 insertions(+), 37 deletions(-) create mode 100644 lua/lazyvim/plugins/extras/coding/mini-surround.lua diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index d4070b4c..30331e10 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -181,43 +181,6 @@ return { }, }, - -- Fast and feature-rich surround actions. For text that includes - -- surrounding characters like brackets or quotes, this allows you - -- to select the text inside, change or modify the surrounding characters, - -- and more. - { - "echasnovski/mini.surround", - keys = function(_, keys) - -- Populate the keys based on the user's options - local plugin = require("lazy.core.config").spec.plugins["mini.surround"] - local opts = require("lazy.core.plugin").values(plugin, "opts", false) - local mappings = { - { opts.mappings.add, desc = "Add Surrounding", mode = { "n", "v" } }, - { opts.mappings.delete, desc = "Delete Surrounding" }, - { opts.mappings.find, desc = "Find Right Surrounding" }, - { opts.mappings.find_left, desc = "Find Left Surrounding" }, - { opts.mappings.highlight, desc = "Highlight Surrounding" }, - { opts.mappings.replace, desc = "Replace Surrounding" }, - { opts.mappings.update_n_lines, desc = "Update `MiniSurround.config.n_lines`" }, - } - mappings = vim.tbl_filter(function(m) - return m[1] and #m[1] > 0 - end, mappings) - return vim.list_extend(mappings, keys) - end, - opts = { - mappings = { - add = "gsa", -- Add surrounding in Normal and Visual modes - delete = "gsd", -- Delete surrounding - find = "gsf", -- Find surrounding (to the right) - find_left = "gsF", -- Find surrounding (to the left) - highlight = "gsh", -- Highlight surrounding - replace = "gsr", -- Replace surrounding - update_n_lines = "gsn", -- Update `n_lines` - }, - }, - }, - -- comments { "JoosepAlviste/nvim-ts-context-commentstring", diff --git a/lua/lazyvim/plugins/extras/coding/mini-surround.lua b/lua/lazyvim/plugins/extras/coding/mini-surround.lua new file mode 100644 index 00000000..101903e6 --- /dev/null +++ b/lua/lazyvim/plugins/extras/coding/mini-surround.lua @@ -0,0 +1,36 @@ +-- Fast and feature-rich surround actions. For text that includes +-- surrounding characters like brackets or quotes, this allows you +-- to select the text inside, change or modify the surrounding characters, +-- and more. +return { + "echasnovski/mini.surround", + keys = function(_, keys) + -- Populate the keys based on the user's options + local plugin = require("lazy.core.config").spec.plugins["mini.surround"] + local opts = require("lazy.core.plugin").values(plugin, "opts", false) + local mappings = { + { opts.mappings.add, desc = "Add Surrounding", mode = { "n", "v" } }, + { opts.mappings.delete, desc = "Delete Surrounding" }, + { opts.mappings.find, desc = "Find Right Surrounding" }, + { opts.mappings.find_left, desc = "Find Left Surrounding" }, + { opts.mappings.highlight, desc = "Highlight Surrounding" }, + { opts.mappings.replace, desc = "Replace Surrounding" }, + { opts.mappings.update_n_lines, desc = "Update `MiniSurround.config.n_lines`" }, + } + mappings = vim.tbl_filter(function(m) + return m[1] and #m[1] > 0 + end, mappings) + return vim.list_extend(mappings, keys) + end, + opts = { + mappings = { + add = "gsa", -- Add surrounding in Normal and Visual modes + delete = "gsd", -- Delete surrounding + find = "gsf", -- Find surrounding (to the right) + find_left = "gsF", -- Find surrounding (to the left) + highlight = "gsh", -- Highlight surrounding + replace = "gsr", -- Replace surrounding + update_n_lines = "gsn", -- Update `n_lines` + }, + }, +} diff --git a/lua/lazyvim/plugins/extras/editor/leap.lua b/lua/lazyvim/plugins/extras/editor/leap.lua index 19bfd4a8..afcdc4b7 100644 --- a/lua/lazyvim/plugins/extras/editor/leap.lua +++ b/lua/lazyvim/plugins/extras/editor/leap.lua @@ -38,6 +38,7 @@ return { -- rename surround mappings from gs to gz to prevent conflict with leap { "echasnovski/mini.surround", + optional = true, opts = { mappings = { add = "gza", -- Add surrounding in Normal and Visual modes From 4f4911ff95bc35438a2b8dd2d058b15f105f2ff1 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 16 May 2024 18:56:54 +0200 Subject: [PATCH 262/526] feat(coding)!: move `mini.ai` to an extra --- lua/lazyvim/plugins/coding.lua | 96 ------------------- lua/lazyvim/plugins/extras/coding/mini-ai.lua | 95 ++++++++++++++++++ 2 files changed, 95 insertions(+), 96 deletions(-) create mode 100644 lua/lazyvim/plugins/extras/coding/mini-ai.lua diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 30331e10..a2a36581 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -208,100 +208,4 @@ return { end end, }, - - -- Better text-objects - { - "echasnovski/mini.ai", - -- keys = { - -- { "a", mode = { "x", "o" } }, - -- { "i", mode = { "x", "o" } }, - -- }, - event = "VeryLazy", - opts = function() - local ai = require("mini.ai") - return { - n_lines = 500, - custom_textobjects = { - o = ai.gen_spec.treesitter({ - a = { "@block.outer", "@conditional.outer", "@loop.outer" }, - i = { "@block.inner", "@conditional.inner", "@loop.inner" }, - }, {}), - f = ai.gen_spec.treesitter({ a = "@function.outer", i = "@function.inner" }, {}), - c = ai.gen_spec.treesitter({ a = "@class.outer", i = "@class.inner" }, {}), - t = { "<([%p%w]-)%f[^<%w][^<>]->.-", "^<.->().*()$" }, - d = { "%f[%d]%d+" }, -- digits - e = { -- Word with case - { - "%u[%l%d]+%f[^%l%d]", - "%f[%S][%l%d]+%f[^%l%d]", - "%f[%P][%l%d]+%f[^%l%d]", - "^[%l%d]+%f[^%l%d]", - }, - "^().*()$", - }, - g = function() -- Whole buffer, similar to `gg` and 'G' motion - local from = { line = 1, col = 1 } - local to = { - line = vim.fn.line("$"), - col = math.max(vim.fn.getline("$"):len(), 1), - } - return { from = from, to = to } - end, - u = ai.gen_spec.function_call(), -- u for "Usage" - U = ai.gen_spec.function_call({ name_pattern = "[%w_]" }), -- without dot in function name - }, - } - end, - config = function(_, opts) - require("mini.ai").setup(opts) - -- register all text objects with which-key - LazyVim.on_load("which-key.nvim", function() - ---@type table - local i = { - [" "] = "Whitespace", - ['"'] = 'Balanced "', - ["'"] = "Balanced '", - ["`"] = "Balanced `", - ["("] = "Balanced (", - [")"] = "Balanced ) including white-space", - [">"] = "Balanced > including white-space", - [""] = "Balanced <", - ["]"] = "Balanced ] including white-space", - ["["] = "Balanced [", - ["}"] = "Balanced } including white-space", - ["{"] = "Balanced {", - ["?"] = "User Prompt", - _ = "Underscore", - a = "Argument", - b = "Balanced ), ], }", - c = "Class", - d = "Digit(s)", - e = "Word in CamelCase & snake_case", - f = "Function", - g = "Entire file", - o = "Block, conditional, loop", - q = "Quote `, \", '", - t = "Tag", - u = "Use/call function & method", - U = "Use/call without dot in name", - } - local a = vim.deepcopy(i) - for k, v in pairs(a) do - a[k] = v:gsub(" including.*", "") - end - - local ic = vim.deepcopy(i) - local ac = vim.deepcopy(a) - for key, name in pairs({ n = "Next", l = "Last" }) do - i[key] = vim.tbl_extend("force", { name = "Inside " .. name .. " textobject" }, ic) - a[key] = vim.tbl_extend("force", { name = "Around " .. name .. " textobject" }, ac) - end - require("which-key").register({ - mode = { "o", "x" }, - i = i, - a = a, - }) - end) - end, - }, } diff --git a/lua/lazyvim/plugins/extras/coding/mini-ai.lua b/lua/lazyvim/plugins/extras/coding/mini-ai.lua new file mode 100644 index 00000000..b97c248e --- /dev/null +++ b/lua/lazyvim/plugins/extras/coding/mini-ai.lua @@ -0,0 +1,95 @@ +-- Better text-objects +return { + "echasnovski/mini.ai", + -- keys = { + -- { "a", mode = { "x", "o" } }, + -- { "i", mode = { "x", "o" } }, + -- }, + event = "VeryLazy", + opts = function() + local ai = require("mini.ai") + return { + n_lines = 500, + custom_textobjects = { + o = ai.gen_spec.treesitter({ + a = { "@block.outer", "@conditional.outer", "@loop.outer" }, + i = { "@block.inner", "@conditional.inner", "@loop.inner" }, + }, {}), + f = ai.gen_spec.treesitter({ a = "@function.outer", i = "@function.inner" }, {}), + c = ai.gen_spec.treesitter({ a = "@class.outer", i = "@class.inner" }, {}), + t = { "<([%p%w]-)%f[^<%w][^<>]->.-", "^<.->().*()$" }, + d = { "%f[%d]%d+" }, -- digits + e = { -- Word with case + { + "%u[%l%d]+%f[^%l%d]", + "%f[%S][%l%d]+%f[^%l%d]", + "%f[%P][%l%d]+%f[^%l%d]", + "^[%l%d]+%f[^%l%d]", + }, + "^().*()$", + }, + g = function() -- Whole buffer, similar to `gg` and 'G' motion + local from = { line = 1, col = 1 } + local to = { + line = vim.fn.line("$"), + col = math.max(vim.fn.getline("$"):len(), 1), + } + return { from = from, to = to } + end, + u = ai.gen_spec.function_call(), -- u for "Usage" + U = ai.gen_spec.function_call({ name_pattern = "[%w_]" }), -- without dot in function name + }, + } + end, + config = function(_, opts) + require("mini.ai").setup(opts) + -- register all text objects with which-key + LazyVim.on_load("which-key.nvim", function() + ---@type table + local i = { + [" "] = "Whitespace", + ['"'] = 'Balanced "', + ["'"] = "Balanced '", + ["`"] = "Balanced `", + ["("] = "Balanced (", + [")"] = "Balanced ) including white-space", + [">"] = "Balanced > including white-space", + [""] = "Balanced <", + ["]"] = "Balanced ] including white-space", + ["["] = "Balanced [", + ["}"] = "Balanced } including white-space", + ["{"] = "Balanced {", + ["?"] = "User Prompt", + _ = "Underscore", + a = "Argument", + b = "Balanced ), ], }", + c = "Class", + d = "Digit(s)", + e = "Word in CamelCase & snake_case", + f = "Function", + g = "Entire file", + o = "Block, conditional, loop", + q = "Quote `, \", '", + t = "Tag", + u = "Use/call function & method", + U = "Use/call without dot in name", + } + local a = vim.deepcopy(i) + for k, v in pairs(a) do + a[k] = v:gsub(" including.*", "") + end + + local ic = vim.deepcopy(i) + local ac = vim.deepcopy(a) + for key, name in pairs({ n = "Next", l = "Last" }) do + i[key] = vim.tbl_extend("force", { name = "Inside " .. name .. " textobject" }, ic) + a[key] = vim.tbl_extend("force", { name = "Around " .. name .. " textobject" }, ac) + end + require("which-key").register({ + mode = { "o", "x" }, + i = i, + a = a, + }) + end) + end, +} From 66dc9c09d6356ddc7e5870a4aa74824d3623d315 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 16 May 2024 19:00:13 +0200 Subject: [PATCH 263/526] feat(util)!: move `vim-startuptime` to an extra --- lua/lazyvim/plugins/extras/util/startuptime.lua | 8 ++++++++ lua/lazyvim/plugins/util.lua | 9 --------- 2 files changed, 8 insertions(+), 9 deletions(-) create mode 100644 lua/lazyvim/plugins/extras/util/startuptime.lua diff --git a/lua/lazyvim/plugins/extras/util/startuptime.lua b/lua/lazyvim/plugins/extras/util/startuptime.lua new file mode 100644 index 00000000..5775b564 --- /dev/null +++ b/lua/lazyvim/plugins/extras/util/startuptime.lua @@ -0,0 +1,8 @@ +-- measure startuptime +return { + "dstein64/vim-startuptime", + cmd = "StartupTime", + config = function() + vim.g.startuptime_tries = 10 + end, +} diff --git a/lua/lazyvim/plugins/util.lua b/lua/lazyvim/plugins/util.lua index c3870889..cf5d9e03 100644 --- a/lua/lazyvim/plugins/util.lua +++ b/lua/lazyvim/plugins/util.lua @@ -1,14 +1,5 @@ return { - -- measure startuptime - { - "dstein64/vim-startuptime", - cmd = "StartupTime", - config = function() - vim.g.startuptime_tries = 10 - end, - }, - -- Session management. This saves your session in the background, -- keeping track of open buffers, window arrangement, and more. -- You can restore sessions when returning through the dashboard. From 20081460b65bc7a117933b0dcebbcaa4dcb82b23 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 16 May 2024 20:52:53 +0200 Subject: [PATCH 264/526] feat(extras): added extra for the `nvim-treesitter` rewrite. Some plugins are not compatible and will be disabled. --- .../plugins/extras/ui/treesitter-rewrite.lua | 93 +++++++++++++++++++ lua/lazyvim/util/init.lua | 15 +++ 2 files changed, 108 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua diff --git a/lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua b/lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua new file mode 100644 index 00000000..034462d5 --- /dev/null +++ b/lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua @@ -0,0 +1,93 @@ +-- backwards compatibility with the old treesitter config for adding custom parsers +local function patch() + local parsers = require("nvim-treesitter.parsers") + parsers.get_parser_configs = setmetatable({}, { + __call = function() + return parsers + end, + }) +end + +if vim.fn.executable("tree-sitter") == 0 then + LazyVim.error("**treesitter-rewrite** requires the `tree-sitter` executable to be installed") + return {} +end + +return { + { + "nvim-treesitter/nvim-treesitter", + version = false, -- last release is way too old and doesn't work on Windows + branch = "main", + build = ":TSUpdate", + lazy = false, + cmd = {}, + opts = function() + patch() + return { + highlight = { enable = true }, + indent = { enable = true }, + ensure_install = { + "bash", + "c", + "diff", + "html", + "javascript", + "jsdoc", + "json", + "jsonc", + "lua", + "luadoc", + "luap", + "markdown", + "markdown_inline", + "python", + "query", + "regex", + "toml", + "tsx", + "typescript", + "vim", + "vimdoc", + "xml", + "yaml", + }, + } + end, + init = function() end, + ---@param opts TSConfig + config = function(_, opts) + ---@return string[] + local function norm(ensure) + return ensure == nil and {} or type(ensure) == "string" and { ensure } or ensure + end + + -- ensure_installed is deprecated, but still supported + opts.ensure_install = LazyVim.dedup(vim.list_extend(norm(opts.ensure_install), norm(opts.ensure_installed))) + + require("nvim-treesitter").setup(opts) + patch() + + -- backwards compatibility with the old treesitter config for indent + if vim.tbl_get(opts, "indent", "enable") then + vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" + end + + -- backwards compatibility with the old treesitter config for highlight + if vim.tbl_get(opts, "highlight", "enable") then + vim.api.nvim_create_autocmd("FileType", { + callback = function() + pcall(vim.treesitter.start) + end, + }) + end + end, + }, + { + "nvim-treesitter/nvim-treesitter-textobjects", + enabled = false, + }, + { + "windwp/nvim-ts-autotag", + enabled = false, + }, +} diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index f343c338..2d7be13f 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -170,4 +170,19 @@ function M.safe_keymap_set(mode, lhs, rhs, opts) end end +---@generic T +---@param list T[] +---@return T[] +function M.dedup(list) + local ret = {} + local seen = {} + for _, v in ipairs(list) do + if not seen[v] then + table.insert(ret, v) + seen[v] = true + end + end + return ret +end + return M From 73126e30c7d0a2e2e1ad78226a954d26dbffe841 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 16 May 2024 21:06:45 +0200 Subject: [PATCH 265/526] docs: updated news for 11.0 release --- NEWS.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/NEWS.md b/NEWS.md index 1ca0ea62..11477bcd 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,30 @@ # What's new? +## 11.x + +Since Neovim 0.10 has been released, I've been working on a new version of **LazyVim** +that is fully compatible with all the latest Neovim features. + +Additionally, some core plugins have been moved to extras. + +- `native snippets` are not the default on Neovim 0.10 + Older versions of Neovim will use the new `luasnip` extra. + +- `native comments` are now the default on Neovim 0.10 + Older versions of Neovim will use the new `mini-comment` extra. + `nvim-ts-context-commentstring` has been integrated in the native comments. + +- plugins moved to extras: + + - `mini.ai` which I couldn't live without, but not everyone needs it + - `mini.surround` + - `mini.indentscope` scopes are now also highlighted with `indent-blankline` + - `nvim-treesitter-context` + +- There's a new extra for the `nvim-treesitter` **rewrite**. + Since the rewrite is not backward compatible, some plugins will be disabled + when you enable this extra: `vim-illuminate`, `nvim-ts-autotag`, and `nvim-ts-autotag`. + ## 10.x - added new extra for [mini.diff](https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-diff.md) From 2de7f24530eacd31b0089f45a8e6081b834b8ff9 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 16 May 2024 21:23:29 +0200 Subject: [PATCH 266/526] docs: update --- NEWS.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/NEWS.md b/NEWS.md index 11477bcd..0d425f43 100644 --- a/NEWS.md +++ b/NEWS.md @@ -14,6 +14,18 @@ Additionally, some core plugins have been moved to extras. Older versions of Neovim will use the new `mini-comment` extra. `nvim-ts-context-commentstring` has been integrated in the native comments. +- `inlay hints` have been in **LazyVim** for a while, but are now + enabled by default. To disable then: + + ```lua + { + "nvim-lspconfig", + opts = { + inlay_hints = { enabled = true }, + } + } + ``` + - plugins moved to extras: - `mini.ai` which I couldn't live without, but not everyone needs it @@ -24,6 +36,7 @@ Additionally, some core plugins have been moved to extras. - There's a new extra for the `nvim-treesitter` **rewrite**. Since the rewrite is not backward compatible, some plugins will be disabled when you enable this extra: `vim-illuminate`, `nvim-ts-autotag`, and `nvim-ts-autotag`. + I would **NOT** recommend enabling this extra for now. ## 10.x From 960e958548adce7d96ff2e0c014ce2249897125e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 16 May 2024 21:20:24 +0200 Subject: [PATCH 267/526] feat(lsp): enable inlay hints by default on Neovim 0.10 --- lua/lazyvim/plugins/lsp/init.lua | 44 +++++++++++++++++--------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 26abffa0..41a89724 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -38,7 +38,7 @@ return { -- Be aware that you also will need to properly configure your LSP server to -- provide the inlay hints. inlay_hints = { - enabled = false, + enabled = true, }, -- Enable this to enable the builtin LSP code lenses on Neovim >= 0.10.0 -- Be aware that you also will need to properly configure your LSP server to @@ -140,27 +140,29 @@ return { end end - -- inlay hints - if opts.inlay_hints.enabled then - LazyVim.lsp.on_attach(function(client, buffer) - if client.supports_method("textDocument/inlayHint") then - LazyVim.toggle.inlay_hints(buffer, true) - end - end) - end + if vim.fn.has("nvim-0.10") == 1 then + -- inlay hints + if opts.inlay_hints.enabled then + LazyVim.lsp.on_attach(function(client, buffer) + if client.supports_method("textDocument/inlayHint") then + LazyVim.toggle.inlay_hints(buffer, true) + end + end) + end - -- code lens - if opts.codelens.enabled and vim.lsp.codelens then - LazyVim.lsp.on_attach(function(client, buffer) - if client.supports_method("textDocument/codeLens") then - vim.lsp.codelens.refresh() - --- autocmd BufEnter,CursorHold,InsertLeave lua vim.lsp.codelens.refresh() - vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave" }, { - buffer = buffer, - callback = vim.lsp.codelens.refresh, - }) - end - end) + -- code lens + if opts.codelens.enabled and vim.lsp.codelens then + LazyVim.lsp.on_attach(function(client, buffer) + if client.supports_method("textDocument/codeLens") then + vim.lsp.codelens.refresh() + --- autocmd BufEnter,CursorHold,InsertLeave lua vim.lsp.codelens.refresh() + vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave" }, { + buffer = buffer, + callback = vim.lsp.codelens.refresh, + }) + end + end) + end end if type(opts.diagnostics.virtual_text) == "table" and opts.diagnostics.virtual_text.prefix == "icons" then From b739eb35033acaf20423920d103d5ad3e8350f23 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 16 May 2024 21:21:58 +0200 Subject: [PATCH 268/526] fix(treesitter-rewrite): disable vim-illuminate --- lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua b/lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua index 034462d5..d1b60c4c 100644 --- a/lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua +++ b/lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua @@ -13,6 +13,11 @@ if vim.fn.executable("tree-sitter") == 0 then return {} end +if vim.fn.has("nvim-0.10") == 0 then + LazyVim.error("**treesitter-rewrite** requires Neovim >= 0.10") + return {} +end + return { { "nvim-treesitter/nvim-treesitter", @@ -90,4 +95,8 @@ return { "windwp/nvim-ts-autotag", enabled = false, }, + { + "RRethy/vim-illuminate", + enabled = false, + }, } From 3b74ef793fb7cd8964231393a57b9e3c846b7d1e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 16 May 2024 21:22:17 +0200 Subject: [PATCH 269/526] feat(keymaps): added leader-uI to open InspectTree --- lua/lazyvim/config/keymaps.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 71bc61b6..089448d1 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -139,6 +139,7 @@ map("n", "qq", "qa", { desc = "Quit All" }) -- highlights under cursor map("n", "ui", vim.show_pos, { desc = "Inspect Pos" }) +map("n", "uI", "InspectTree", { desc = "Inspect Tree" }) -- LazyVim Changelog map("n", "L", function() LazyVim.news.changelog() end, { desc = "LazyVim Changelog" }) From e7ee289c7fbaf4f22854ebbadf733e7bd8069794 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 16 May 2024 19:27:11 +0000 Subject: [PATCH 270/526] chore(main): release 11.0.0 --- CHANGELOG.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc9ff8ac..5b773b41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,41 @@ # Changelog +## [11.0.0](https://github.com/LazyVim/LazyVim/compare/v10.25.0...v11.0.0) (2024-05-16) + + +### ⚠ BREAKING CHANGES + +* **util:** move `vim-startuptime` to an extra +* **coding:** move `mini.ai` to an extra +* **mini.surround:** move `mini.surround` to an extra +* **ui:** move `mini.indentscope` to an extra +* **ui:** moved treesitter-context to an extra. No longer a core plugin +* **coding:** native snippets are now the default on Neovim 0.10. Install the luasnip extra to get luasnip back +* **coding:** use native comments on 0.10, with support for ts_context_commentstring + +### Features + +* **coding:** move `mini.ai` to an extra ([4f4911f](https://github.com/LazyVim/LazyVim/commit/4f4911ff95bc35438a2b8dd2d058b15f105f2ff1)) +* **coding:** native snippets are now the default on Neovim 0.10. Install the luasnip extra to get luasnip back ([3c4ebd5](https://github.com/LazyVim/LazyVim/commit/3c4ebd522e7c475cfedcee5dfa7a008e798c404c)) +* **coding:** use native comments on 0.10, with support for ts_context_commentstring ([d999be7](https://github.com/LazyVim/LazyVim/commit/d999be7401783e0f3a610319fa1b327d38fa3e52)) +* **extras:** added extra for the `nvim-treesitter` rewrite. Some plugins are not compatible and will be disabled. ([2008146](https://github.com/LazyVim/LazyVim/commit/20081460b65bc7a117933b0dcebbcaa4dcb82b23)) +* **keymaps:** added leader-uI to open InspectTree ([3b74ef7](https://github.com/LazyVim/LazyVim/commit/3b74ef793fb7cd8964231393a57b9e3c846b7d1e)) +* **lsp:** enable inlay hints by default on Neovim 0.10 ([960e958](https://github.com/LazyVim/LazyVim/commit/960e958548adce7d96ff2e0c014ce2249897125e)) +* **mini.surround:** move `mini.surround` to an extra ([e37a699](https://github.com/LazyVim/LazyVim/commit/e37a699096ccb209c1babc29c1d5eeeab74102a1)) +* **ui:** move `mini.indentscope` to an extra ([69e6daa](https://github.com/LazyVim/LazyVim/commit/69e6daae2ccb4b7b7180e439c1b05d72d3c64e11)) +* **ui:** moved treesitter-context to an extra. No longer a core plugin ([03704e2](https://github.com/LazyVim/LazyVim/commit/03704e22998be9db17f114acc4060d714fe652fb)) +* **util:** move `vim-startuptime` to an extra ([66dc9c0](https://github.com/LazyVim/LazyVim/commit/66dc9c09d6356ddc7e5870a4aa74824d3623d315)) +* **util:** set_upvalue ([f02507b](https://github.com/LazyVim/LazyVim/commit/f02507b1598379250baab293c423f79c393e28e5)) + + +### Bug Fixes + +* **cmp:** never auto bracket for snippets and correct prev char check. Fixes [#2949](https://github.com/LazyVim/LazyVim/issues/2949) ([6e7ba50](https://github.com/LazyVim/LazyVim/commit/6e7ba50141b1cda415c9391fd345a1e428bad9b6)) +* **dap:** add debugger to filetypes mapping for launch.json ([#3165](https://github.com/LazyVim/LazyVim/issues/3165)) ([183d6ee](https://github.com/LazyVim/LazyVim/commit/183d6eea606556c8bd7f80a70660c54670e04649)) +* **dap:** use jsonc support from plenary. Same as the code from neoconf. Fixes [#3174](https://github.com/LazyVim/LazyVim/issues/3174) ([8dae76c](https://github.com/LazyVim/LazyVim/commit/8dae76c1fd6fb90199b56cda8b6ec21576d02eb5)) +* **health:** add warning when not using 0.10.0 ([9fe8b15](https://github.com/LazyVim/LazyVim/commit/9fe8b15928077cb0c20aeea111b42f9698c78330)) +* **treesitter-rewrite:** disable vim-illuminate ([b739eb3](https://github.com/LazyVim/LazyVim/commit/b739eb35033acaf20423920d103d5ad3e8350f23)) + ## [10.25.0](https://github.com/LazyVim/LazyVim/compare/v10.24.0...v10.25.0) (2024-05-15) From 58cf6f971b78170aef5f26ccb79149213f4a692d Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Thu, 16 May 2024 23:02:26 +0300 Subject: [PATCH 271/526] fix(news.md): correct phrase to disable `inlay_hints` --- NEWS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 0d425f43..34edd6d6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -15,13 +15,13 @@ Additionally, some core plugins have been moved to extras. `nvim-ts-context-commentstring` has been integrated in the native comments. - `inlay hints` have been in **LazyVim** for a while, but are now - enabled by default. To disable then: + enabled by default. To disable them: ```lua { "nvim-lspconfig", opts = { - inlay_hints = { enabled = true }, + inlay_hints = { enabled = false }, } } ``` From 76f9dbb40c807738ba5516ea3b5da7e3b6886166 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 16 May 2024 22:11:52 +0200 Subject: [PATCH 272/526] refactor: use LazyVim.opts --- lua/lazyvim/plugins/extras/coding/mini-surround.lua | 3 +-- lua/lazyvim/plugins/formatting.lua | 4 +--- lua/lazyvim/plugins/lsp/init.lua | 3 +-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/lua/lazyvim/plugins/extras/coding/mini-surround.lua b/lua/lazyvim/plugins/extras/coding/mini-surround.lua index 101903e6..d8ff25c5 100644 --- a/lua/lazyvim/plugins/extras/coding/mini-surround.lua +++ b/lua/lazyvim/plugins/extras/coding/mini-surround.lua @@ -6,8 +6,7 @@ return { "echasnovski/mini.surround", keys = function(_, keys) -- Populate the keys based on the user's options - local plugin = require("lazy.core.config").spec.plugins["mini.surround"] - local opts = require("lazy.core.plugin").values(plugin, "opts", false) + local opts = LazyVim.opts("mini.surround") local mappings = { { opts.mappings.add, desc = "Add Surrounding", mode = { "n", "v" } }, { opts.mappings.delete, desc = "Delete Surrounding" }, diff --git a/lua/lazyvim/plugins/formatting.lua b/lua/lazyvim/plugins/formatting.lua index 718cb0f9..28dea8ed 100644 --- a/lua/lazyvim/plugins/formatting.lua +++ b/lua/lazyvim/plugins/formatting.lua @@ -54,9 +54,7 @@ return { priority = 100, primary = true, format = function(buf) - local plugin = require("lazy.core.config").plugins["conform.nvim"] - local Plugin = require("lazy.core.plugin") - local opts = Plugin.values(plugin, "opts", false) + local opts = LazyVim.opts("conform.nvim") require("conform").format(LazyVim.merge({}, opts.format, { bufnr = buf })) end, sources = function(buf) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 41a89724..f66b21a6 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -106,8 +106,7 @@ return { ---@param opts PluginLspOpts config = function(_, opts) if LazyVim.has("neoconf.nvim") then - local plugin = require("lazy.core.config").spec.plugins["neoconf.nvim"] - require("neoconf").setup(require("lazy.core.plugin").values(plugin, "opts", false)) + require("neoconf").setup(LazyVim.opts("neoconf.nvim")) end -- setup autoformat From 14872fa816fd770eba0f2b5efc69d5b29d4073fb Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 16 May 2024 22:14:57 +0200 Subject: [PATCH 273/526] fix(util): get opts from parsing specs instead of plugins --- lua/lazyvim/util/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index 2d7be13f..d6907a60 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -72,7 +72,7 @@ end ---@param name string function M.opts(name) - local plugin = require("lazy.core.config").plugins[name] + local plugin = require("lazy.core.config").spec.plugins[name] if not plugin then return {} end From 639dfce0101cc6c0174e116872df91ccb30cb597 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Thu, 16 May 2024 23:28:25 +0300 Subject: [PATCH 274/526] fix(treesitter-rewrite): show error in Extras only when enabled (#3178) --- .../plugins/extras/ui/treesitter-rewrite.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua b/lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua index d1b60c4c..8459c06e 100644 --- a/lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua +++ b/lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua @@ -8,14 +8,16 @@ local function patch() }) end -if vim.fn.executable("tree-sitter") == 0 then - LazyVim.error("**treesitter-rewrite** requires the `tree-sitter` executable to be installed") - return {} -end +if vim.tbl_contains(Config.json.data.extras, "lazyvim.plugins.extras.ui.treesitter-rewrite") then + if vim.fn.executable("tree-sitter") == 0 then + LazyVim.error("**treesitter-rewrite** requires the `tree-sitter` executable to be installed") + return {} + end -if vim.fn.has("nvim-0.10") == 0 then - LazyVim.error("**treesitter-rewrite** requires Neovim >= 0.10") - return {} + if vim.fn.has("nvim-0.10") == 0 then + LazyVim.error("**treesitter-rewrite** requires Neovim >= 0.10") + return {} + end end return { From 07923f3701af23504bb09bf6cc11c4fb0a1894e7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 16 May 2024 22:30:31 +0200 Subject: [PATCH 275/526] chore(main): release 11.0.1 (#3180) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b773b41..f6032f49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [11.0.1](https://github.com/LazyVim/LazyVim/compare/v11.0.0...v11.0.1) (2024-05-16) + + +### Bug Fixes + +* **news.md:** correct phrase to disable `inlay_hints` ([58cf6f9](https://github.com/LazyVim/LazyVim/commit/58cf6f971b78170aef5f26ccb79149213f4a692d)) +* **treesitter-rewrite:** show error in Extras only when enabled ([#3178](https://github.com/LazyVim/LazyVim/issues/3178)) ([639dfce](https://github.com/LazyVim/LazyVim/commit/639dfce0101cc6c0174e116872df91ccb30cb597)) +* **util:** get opts from parsing specs instead of plugins ([14872fa](https://github.com/LazyVim/LazyVim/commit/14872fa816fd770eba0f2b5efc69d5b29d4073fb)) + ## [11.0.0](https://github.com/LazyVim/LazyVim/compare/v10.25.0...v11.0.0) (2024-05-16) From ec673a83ff387e29ca42367b3aab3c311950a024 Mon Sep 17 00:00:00 2001 From: Johnson Hu Date: Fri, 17 May 2024 01:52:25 -0500 Subject: [PATCH 276/526] fix(treesitter-rewrite): add missed local Config (#3188) --- lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua b/lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua index 8459c06e..ef179d57 100644 --- a/lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua +++ b/lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua @@ -1,3 +1,5 @@ +local Config = require("lazyvim.config") + -- backwards compatibility with the old treesitter config for adding custom parsers local function patch() local parsers = require("nvim-treesitter.parsers") From 03653dbe35b12eabc92cf532dbac04c8de6d674b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 17 May 2024 06:52:57 +0000 Subject: [PATCH 277/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 6df78613..568a4638 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 16 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 17 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 960ec8079bb5960a510595dff21725ff403b2753 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 17 May 2024 09:07:01 +0200 Subject: [PATCH 278/526] fix: deprecation warning on diagnostic.is_disabled --- lua/lazyvim/util/toggle.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index a377064e..9c224059 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -43,7 +43,9 @@ local enabled = true function M.diagnostics() -- if this Neovim version supports checking if diagnostics are enabled -- then use that for the current state - if vim.diagnostic.is_disabled then + if vim.diagnostic.is_enabled then + enabled = vim.diagnostic.is_enabled() + elseif vim.diagnostic.is_disabled then enabled = not vim.diagnostic.is_disabled() end enabled = not enabled From cc99b219ded16ec60120698d6e8f453c2f37132c Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 17 May 2024 09:12:45 +0200 Subject: [PATCH 279/526] feat(lsp): document highlights now use native lsp. `vim-illuminate` is available as an extra --- NEWS.md | 1 + lua/lazyvim/plugins/editor.lua | 40 ---------- .../plugins/extras/editor/illuminate.lua | 45 +++++++++++ lua/lazyvim/plugins/lsp/init.lua | 6 ++ lua/lazyvim/util/lsp.lua | 74 ++++++++++++++++++- 5 files changed, 125 insertions(+), 41 deletions(-) create mode 100644 lua/lazyvim/plugins/extras/editor/illuminate.lua diff --git a/NEWS.md b/NEWS.md index 34edd6d6..adeab6ea 100644 --- a/NEWS.md +++ b/NEWS.md @@ -32,6 +32,7 @@ Additionally, some core plugins have been moved to extras. - `mini.surround` - `mini.indentscope` scopes are now also highlighted with `indent-blankline` - `nvim-treesitter-context` + - `vim-illuminate`: document highlights now use native lsp functionality by default - There's a new extra for the `nvim-treesitter` **rewrite**. Since the rewrite is not backward compatible, some plugins will be disabled diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 61f9cd86..7bcf9973 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -409,46 +409,6 @@ return { }, }, - -- Automatically highlights other instances of the word under your cursor. - -- This works with LSP, Treesitter, and regexp matching to find the other - -- instances. - { - "RRethy/vim-illuminate", - event = "LazyFile", - opts = { - delay = 200, - large_file_cutoff = 2000, - large_file_overrides = { - providers = { "lsp" }, - }, - }, - config = function(_, opts) - require("illuminate").configure(opts) - - local function map(key, dir, buffer) - vim.keymap.set("n", key, function() - require("illuminate")["goto_" .. dir .. "_reference"](false) - end, { desc = dir:sub(1, 1):upper() .. dir:sub(2) .. " Reference", buffer = buffer }) - end - - map("]]", "next") - map("[[", "prev") - - -- also set it after loading ftplugins, since a lot overwrite [[ and ]] - vim.api.nvim_create_autocmd("FileType", { - callback = function() - local buffer = vim.api.nvim_get_current_buf() - map("]]", "next", buffer) - map("[[", "prev", buffer) - end, - }) - end, - keys = { - { "]]", desc = "Next Reference" }, - { "[[", desc = "Prev Reference" }, - }, - }, - -- buffer remove { "echasnovski/mini.bufremove", diff --git a/lua/lazyvim/plugins/extras/editor/illuminate.lua b/lua/lazyvim/plugins/extras/editor/illuminate.lua new file mode 100644 index 00000000..6fef79b4 --- /dev/null +++ b/lua/lazyvim/plugins/extras/editor/illuminate.lua @@ -0,0 +1,45 @@ +-- Automatically highlights other instances of the word under your cursor. +-- This works with LSP, Treesitter, and regexp matching to find the other +-- instances. +return { + { + "RRethy/vim-illuminate", + event = "LazyFile", + opts = { + delay = 200, + large_file_cutoff = 2000, + large_file_overrides = { + providers = { "lsp" }, + }, + }, + config = function(_, opts) + require("illuminate").configure(opts) + + local function map(key, dir, buffer) + vim.keymap.set("n", key, function() + require("illuminate")["goto_" .. dir .. "_reference"](false) + end, { desc = dir:sub(1, 1):upper() .. dir:sub(2) .. " Reference", buffer = buffer }) + end + + map("]]", "next") + map("[[", "prev") + + -- also set it after loading ftplugins, since a lot overwrite [[ and ]] + vim.api.nvim_create_autocmd("FileType", { + callback = function() + local buffer = vim.api.nvim_get_current_buf() + map("]]", "next", buffer) + map("[[", "prev", buffer) + end, + }) + end, + keys = { + { "]]", desc = "Next Reference" }, + { "[[", desc = "Prev Reference" }, + }, + }, + { + "neovim/nvim-lspconfig", + opts = { document_highlight = { enabed = false } }, + }, +} diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index f66b21a6..3a6ae964 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -46,6 +46,10 @@ return { codelens = { enabled = false, }, + -- Enable lsp cursor word highlighting + document_highlight = { + enabled = true, + }, -- add any global capabilities here capabilities = {}, -- options for vim.lsp.buf.format @@ -128,6 +132,8 @@ return { return ret end + LazyVim.lsp.words.setup(opts.document_highlight) + -- diagnostics signs if vim.fn.has("nvim-0.10.0") == 0 then if type(opts.diagnostics.signs) ~= "boolean" then diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index e712120a..c3a72ff6 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -21,7 +21,7 @@ function M.get_clients(opts) return opts and opts.filter and vim.tbl_filter(opts.filter, ret) or ret end ----@param on_attach fun(client, buffer) +---@param on_attach fun(client:lsp.Client, buffer) function M.on_attach(on_attach) vim.api.nvim_create_autocmd("LspAttach", { callback = function(args) @@ -125,4 +125,76 @@ function M.format(opts) end end +---@alias LspWord {from:{[1]:number, [2]:number}, to:{[1]:number, [2]:number}, current?:boolean} 1-0 indexed +M.words = {} +M.words.ns = vim.api.nvim_create_namespace("vim_lsp_references") + +---@param opts? {enabled?: boolean} +function M.words.setup(opts) + opts = opts or {} + if not opts.enabled then + return + end + M.on_attach(function(client, buf) + if client.supports_method("textDocument/documentHighlight") then + vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI", "CursorMoved", "CursorMovedI" }, { + group = vim.api.nvim_create_augroup("lsp_word_" .. buf, { clear = true }), + buffer = buf, + callback = function(ev) + if not M.words.at() then + if ev.event:find("CursorMoved") then + vim.lsp.buf.clear_references() + else + vim.lsp.buf.document_highlight() + end + end + end, + }) + vim.keymap.set("n", "]]", function() + M.words.jump(vim.v.count1) + end, { buffer = buf }) + vim.keymap.set("n", "[[", function() + M.words.jump(-vim.v.count1) + end, { buffer = buf }) + end + end) +end + +---@return LspWord[] +function M.words.get() + local cursor = vim.api.nvim_win_get_cursor(0) + return vim.tbl_map(function(extmark) + local ret = { + from = { extmark[2] + 1, extmark[3] }, + to = { extmark[4].end_row + 1, extmark[4].end_col }, + } + if cursor[1] >= ret.from[1] and cursor[1] <= ret.to[1] and cursor[2] >= ret.from[2] and cursor[2] <= ret.to[2] then + ret.current = true + end + return ret + end, vim.api.nvim_buf_get_extmarks(0, M.words.ns, 0, -1, { details = true })) +end + +---@param words? LspWord[] +---@return LspWord?, number? +function M.words.at(words) + for idx, word in ipairs(words or M.words.get()) do + if word.current then + return word, idx + end + end +end + +function M.words.jump(count) + local words = M.words.get() + local _, idx = M.words.at(words) + if not idx then + return + end + local target = words[idx + count] + if target then + vim.api.nvim_win_set_cursor(0, target.from) + end +end + return M From f8de965d3ec5712444a643b507bc9ddc7cb19d01 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 17 May 2024 09:19:22 +0200 Subject: [PATCH 280/526] feat(options): new option to disable deprecation warnings. warnings will be hidden bydefault --- lua/lazyvim/config/init.lua | 4 ++++ lua/lazyvim/config/options.lua | 3 +++ 2 files changed, 7 insertions(+) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index cea25f8b..de200eda 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -275,6 +275,10 @@ function M.init() -- after installing missing plugins M.load("options") + if vim.g.deprecation_warnings == false then + vim.deprecate = function() end + end + LazyVim.plugin.setup() M.json.load() end diff --git a/lua/lazyvim/config/options.lua b/lua/lazyvim/config/options.lua index 80223ad1..a1150151 100644 --- a/lua/lazyvim/config/options.lua +++ b/lua/lazyvim/config/options.lua @@ -25,6 +25,9 @@ vim.g.lazygit_config = true -- * powershell -- LazyVim.terminal.setup("pwsh") +-- Hide deprecation warnings +vim.g.deprecation_warnings = false + local opt = vim.opt opt.autowrite = true -- Enable auto write From 47c90209f34544b0b83fb16870d24b9f1d04bc33 Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Fri, 17 May 2024 17:23:11 +1000 Subject: [PATCH 281/526] docs(news.md): fix typo in native snippets announcement (#3186) --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index adeab6ea..60e07692 100644 --- a/NEWS.md +++ b/NEWS.md @@ -7,7 +7,7 @@ that is fully compatible with all the latest Neovim features. Additionally, some core plugins have been moved to extras. -- `native snippets` are not the default on Neovim 0.10 +- `native snippets` are now the default on Neovim 0.10 Older versions of Neovim will use the new `luasnip` extra. - `native comments` are now the default on Neovim 0.10 From 87493af2378fac7b518fd2c4db903cd3a2c27095 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 17 May 2024 10:07:49 +0200 Subject: [PATCH 282/526] fix(lsp): dont try to highlight refs for deleted buffers --- lua/lazyvim/util/lsp.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index c3a72ff6..4df758a4 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -135,6 +135,14 @@ function M.words.setup(opts) if not opts.enabled then return end + local handler = vim.lsp.handlers["textDocument/documentHighlight"] + vim.lsp.handlers["textDocument/documentHighlight"] = function(err, result, ctx, config) + if not vim.api.nvim_buf_is_loaded(ctx.bufnr) then + return + end + return handler(err, result, ctx, config) + end + M.on_attach(function(client, buf) if client.supports_method("textDocument/documentHighlight") then vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI", "CursorMoved", "CursorMovedI" }, { From 779de263f173f7e6f181d1e8faa475be8b05167d Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 17 May 2024 10:10:28 +0200 Subject: [PATCH 283/526] feat(util): `mini.bufremove` is no longer needed --- NEWS.md | 7 +++++- lua/lazyvim/config/keymaps.lua | 2 ++ lua/lazyvim/plugins/editor.lua | 27 ----------------------- lua/lazyvim/util/ui.lua | 39 ++++++++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 28 deletions(-) diff --git a/NEWS.md b/NEWS.md index 60e07692..562e9fe8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,12 @@ ## 11.x +- new option `vim.g.deprecation_warnings` to disable deprecation warnings + Defaults to `false`. To disable, set it to `true` in your `options.lua` + +- `vim-illuminate` move to extras + Document highlights now use native lsp functionality by default + Since Neovim 0.10 has been released, I've been working on a new version of **LazyVim** that is fully compatible with all the latest Neovim features. @@ -32,7 +38,6 @@ Additionally, some core plugins have been moved to extras. - `mini.surround` - `mini.indentscope` scopes are now also highlighted with `indent-blankline` - `nvim-treesitter-context` - - `vim-illuminate`: document highlights now use native lsp functionality by default - There's a new extra for the `nvim-treesitter` **rewrite**. Since the rewrite is not backward compatible, some plugins will be disabled diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 089448d1..7464f33e 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -37,6 +37,8 @@ map("n", "[b", "bprevious", { desc = "Prev Buffer" }) map("n", "]b", "bnext", { desc = "Next Buffer" }) map("n", "bb", "e #", { desc = "Switch to Other Buffer" }) map("n", "`", "e #", { desc = "Switch to Other Buffer" }) +map("n", "bd", LazyVim.ui.bufremove, { desc = "Delete Buffer" }) +map("n", "bD", ":bd", { desc = "Delete Buffer and Window" }) -- Clear search with map({ "i", "n" }, "", "noh", { desc = "Escape and Clear hlsearch" }) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 7bcf9973..b09d4f02 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -409,33 +409,6 @@ return { }, }, - -- buffer remove - { - "echasnovski/mini.bufremove", - keys = { - { - "bd", - function() - local bd = require("mini.bufremove").delete - if vim.bo.modified then - local choice = vim.fn.confirm(("Save changes to %q?"):format(vim.fn.bufname()), "&Yes\n&No\n&Cancel") - if choice == 1 then -- Yes - vim.cmd.write() - bd(0) - elseif choice == 2 then -- No - bd(0, true) - end - else - bd(0) - end - end, - desc = "Delete Buffer", - }, - -- stylua: ignore - { "bD", function() require("mini.bufremove").delete(0, true) end, desc = "Delete Buffer (Force)" }, - }, - }, - -- better diagnostics list and others { "folke/trouble.nvim", diff --git a/lua/lazyvim/util/ui.lua b/lua/lazyvim/util/ui.lua index 91339ca7..5e18a25a 100644 --- a/lua/lazyvim/util/ui.lua +++ b/lua/lazyvim/util/ui.lua @@ -208,4 +208,43 @@ function M.foldexpr() return "0" end +function M.bufremove() + local buf = vim.api.nvim_get_current_buf() + + if vim.bo.modified then + local choice = vim.fn.confirm(("Save changes to %q?"):format(vim.fn.bufname()), "&Yes\n&No\n&Cancel") + if choice == 0 then -- Cancel + return + end + if choice == 1 then -- Yes + vim.cmd.write() + end + end + + for _, win in ipairs(vim.fn.win_findbuf(buf)) do + vim.api.nvim_win_call(win, function() + if not vim.api.nvim_win_is_valid(win) or vim.api.nvim_win_get_buf(win) ~= buf then + return + end + -- Try using alternate buffer + local alt = vim.fn.bufnr("#") + if alt ~= buf and vim.fn.buflisted(alt) == 1 then + vim.api.nvim_win_set_buf(win, alt) + return + end + + -- Try using previous buffer + local has_previous = pcall(vim.cmd, "bprevious") + if has_previous and buf ~= vim.api.nvim_win_get_buf(win) then + return + end + + -- Create new listed buffer + local new_buf = vim.api.nvim_create_buf(true, false) + vim.api.nvim_win_set_buf(win, new_buf) + end) + end + vim.api.nvim_buf_delete(buf, { force = true }) +end + return M From b1ea356e6c676571907ce654ec3878c530c636ad Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Fri, 17 May 2024 12:19:34 +0300 Subject: [PATCH 284/526] fix(util.lsp): add `desc` for keymaps reference (#3193) --- lua/lazyvim/util/lsp.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index 4df758a4..a4acdc19 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -160,10 +160,10 @@ function M.words.setup(opts) }) vim.keymap.set("n", "]]", function() M.words.jump(vim.v.count1) - end, { buffer = buf }) + end, { buffer = buf, desc = "Next reference" }) vim.keymap.set("n", "[[", function() M.words.jump(-vim.v.count1) - end, { buffer = buf }) + end, { buffer = buf, desc = "Previous reference" }) end end) end From 6aef1989bd1c08a828eecb7e9044bf8cc1d93700 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 17 May 2024 13:15:12 +0200 Subject: [PATCH 285/526] chore(main): release 11.1.0 (#3190) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6032f49..fe7d5557 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [11.1.0](https://github.com/LazyVim/LazyVim/compare/v11.0.1...v11.1.0) (2024-05-17) + + +### Features + +* **lsp:** document highlights now use native lsp. `vim-illuminate` is available as an extra ([cc99b21](https://github.com/LazyVim/LazyVim/commit/cc99b219ded16ec60120698d6e8f453c2f37132c)) +* **options:** new option to disable deprecation warnings. warnings will be hidden bydefault ([f8de965](https://github.com/LazyVim/LazyVim/commit/f8de965d3ec5712444a643b507bc9ddc7cb19d01)) +* **util:** `mini.bufremove` is no longer needed ([779de26](https://github.com/LazyVim/LazyVim/commit/779de263f173f7e6f181d1e8faa475be8b05167d)) + + +### Bug Fixes + +* deprecation warning on diagnostic.is_disabled ([960ec80](https://github.com/LazyVim/LazyVim/commit/960ec8079bb5960a510595dff21725ff403b2753)) +* **lsp:** dont try to highlight refs for deleted buffers ([87493af](https://github.com/LazyVim/LazyVim/commit/87493af2378fac7b518fd2c4db903cd3a2c27095)) +* **treesitter-rewrite:** add missed local Config ([#3188](https://github.com/LazyVim/LazyVim/issues/3188)) ([ec673a8](https://github.com/LazyVim/LazyVim/commit/ec673a83ff387e29ca42367b3aab3c311950a024)) +* **util.lsp:** add `desc` for keymaps reference ([#3193](https://github.com/LazyVim/LazyVim/issues/3193)) ([b1ea356](https://github.com/LazyVim/LazyVim/commit/b1ea356e6c676571907ce654ec3878c530c636ad)) + ## [11.0.1](https://github.com/LazyVim/LazyVim/compare/v11.0.0...v11.0.1) (2024-05-16) From 289c2f81c43d39b31a8b46a4a84ab9feb61bb235 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 17 May 2024 14:26:25 +0200 Subject: [PATCH 286/526] perf(coding): dont load `vim.snippet` early --- lua/lazyvim/plugins/coding.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index a2a36581..3d2e910a 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -96,7 +96,7 @@ return { }, -- snippets - vim.snippet + vim.fn.has("nvim-0.10") == 1 and { "nvim-cmp", dependencies = { From 2e1c945f61821eec818a1512bc05b45366c0dfeb Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 17 May 2024 14:26:57 +0200 Subject: [PATCH 287/526] fix(bufferline): correctly configure bufferline to use the new bufremove util --- lua/lazyvim/plugins/ui.lua | 4 ++-- lua/lazyvim/util/ui.lua | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index c24b6e44..fdbe201f 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -71,9 +71,9 @@ return { opts = { options = { -- stylua: ignore - close_command = function(n) require("mini.bufremove").delete(n, false) end, + close_command = function(n) LazyVim.ui.bufremove(n) end, -- stylua: ignore - right_mouse_command = function(n) require("mini.bufremove").delete(n, false) end, + right_mouse_command = function(n) LazyVim.ui.bufremove(n) end, diagnostics = "nvim_lsp", always_show_bufferline = false, diagnostics_indicator = function(_, _, diag) diff --git a/lua/lazyvim/util/ui.lua b/lua/lazyvim/util/ui.lua index 5e18a25a..4f454b41 100644 --- a/lua/lazyvim/util/ui.lua +++ b/lua/lazyvim/util/ui.lua @@ -208,8 +208,10 @@ function M.foldexpr() return "0" end -function M.bufremove() - local buf = vim.api.nvim_get_current_buf() +---@param buf number? +function M.bufremove(buf) + buf = buf or 0 + buf = buf == 0 and vim.api.nvim_get_current_buf() or buf if vim.bo.modified then local choice = vim.fn.confirm(("Save changes to %q?"):format(vim.fn.bufname()), "&Yes\n&No\n&Cancel") From c8b7912eb9efe3fd130e41c2c833c7662e53be1c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 17 May 2024 14:35:42 +0200 Subject: [PATCH 288/526] chore(main): release 11.1.1 (#3196) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe7d5557..8e0593af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [11.1.1](https://github.com/LazyVim/LazyVim/compare/v11.1.0...v11.1.1) (2024-05-17) + + +### Bug Fixes + +* **bufferline:** correctly configure bufferline to use the new bufremove util ([2e1c945](https://github.com/LazyVim/LazyVim/commit/2e1c945f61821eec818a1512bc05b45366c0dfeb)) + + +### Performance Improvements + +* **coding:** dont load `vim.snippet` early ([289c2f8](https://github.com/LazyVim/LazyVim/commit/289c2f81c43d39b31a8b46a4a84ab9feb61bb235)) + ## [11.1.0](https://github.com/LazyVim/LazyVim/compare/v11.0.1...v11.1.0) (2024-05-17) From 19674e804787e205c587d153e8e9c4a3988e7f6c Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 17 May 2024 15:49:48 +0200 Subject: [PATCH 289/526] fix(util): use `bdelete` for buf remove --- lua/lazyvim/util/ui.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/util/ui.lua b/lua/lazyvim/util/ui.lua index 4f454b41..a7bdc700 100644 --- a/lua/lazyvim/util/ui.lua +++ b/lua/lazyvim/util/ui.lua @@ -246,7 +246,9 @@ function M.bufremove(buf) vim.api.nvim_win_set_buf(win, new_buf) end) end - vim.api.nvim_buf_delete(buf, { force = true }) + if vim.api.nvim_buf_is_valid(buf) then + pcall(vim.cmd, "bdelete! " .. buf) + end end return M From 735f5905f85fec0dd5210f2c835597caa5a409fb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 17 May 2024 15:53:23 +0200 Subject: [PATCH 290/526] chore(main): release 11.1.2 (#3198) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e0593af..a27abe47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [11.1.2](https://github.com/LazyVim/LazyVim/compare/v11.1.1...v11.1.2) (2024-05-17) + + +### Bug Fixes + +* **util:** use `bdelete` for buf remove ([19674e8](https://github.com/LazyVim/LazyVim/commit/19674e804787e205c587d153e8e9c4a3988e7f6c)) + ## [11.1.1](https://github.com/LazyVim/LazyVim/compare/v11.1.0...v11.1.1) (2024-05-17) From 23374f160a5b1b947681d55add56ab6ab15e219e Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Fri, 17 May 2024 21:06:17 +0300 Subject: [PATCH 291/526] fix(util.toggle): correctly toggle `inlay_hints` (#3202) `is_enabled` also accepts a `filter` and when we initially toggle `inlay_hints` on [here](https://github.com/LazyVim/LazyVim/blob/735f5905f85fec0dd5210f2c835597caa5a409fb/lua/lazyvim/plugins/lsp/init.lua#L153), we pass a `bufnr` which sets the `inlay_hints` in the `bufstate` (see [here](https://github.com/neovim/neovim/blob/42aa69b076cb338e20b5b4656771f1873e8930d8/runtime/lua/vim/lsp/inlay_hint.lua#L407-L432)), but when we call `is_enabled` without a filter table the returned result if from the `globalstate` (see [here](https://github.com/neovim/neovim/blob/42aa69b076cb338e20b5b4656771f1873e8930d8/runtime/lua/vim/lsp/inlay_hint.lua#L376-L388)). --- lua/lazyvim/util/toggle.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index 9c224059..543d4c13 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -67,7 +67,7 @@ function M.inlay_hints(buf, value) ih(buf, value) elseif type(ih) == "table" and ih.enable then if value == nil then - value = not ih.is_enabled(buf) + value = not ih.is_enabled({ bufnr = buf or 0 }) end ih.enable(value, { bufnr = buf }) end From 39bec71ce9489eee288544dca22015147636ae4d Mon Sep 17 00:00:00 2001 From: EJ Date: Fri, 17 May 2024 14:08:28 -0400 Subject: [PATCH 292/526] fix(refactoring): add label to refactoring key group (#3201) --- lua/lazyvim/plugins/extras/editor/refactoring.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/refactoring.lua b/lua/lazyvim/plugins/extras/editor/refactoring.lua index e5852a3c..cf6988a9 100644 --- a/lua/lazyvim/plugins/extras/editor/refactoring.lua +++ b/lua/lazyvim/plugins/extras/editor/refactoring.lua @@ -122,4 +122,15 @@ return { end end, }, + + -- which key integration + { + "folke/which-key.nvim", + optional = true, + opts = { + defaults = { + ["r"] = { name = "+refactor" }, + }, + }, + }, } From 87bb76612318f0c0b4fca675500e3afd0a9c6771 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 17 May 2024 22:38:45 +0200 Subject: [PATCH 293/526] fix(treesitter): disable treesitter-rewrite extra for now. not ready yet --- lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua | 1 + lua/lazyvim/util/plugin.lua | 1 + 2 files changed, 2 insertions(+) diff --git a/lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua b/lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua index ef179d57..9a8bab95 100644 --- a/lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua +++ b/lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua @@ -101,6 +101,7 @@ return { }, { "RRethy/vim-illuminate", + optional = true, enabled = false, }, } diff --git a/lua/lazyvim/util/plugin.lua b/lua/lazyvim/util/plugin.lua index ad13247a..0789b09f 100644 --- a/lua/lazyvim/util/plugin.lua +++ b/lua/lazyvim/util/plugin.lua @@ -11,6 +11,7 @@ M.deprecated_extras = { ["lazyvim.plugins.extras.linting.nvim-lint"] = "`nvim-lint` is now the default **LazyVim** linter.", ["lazyvim.plugins.extras.ui.dashboard"] = "`dashboard.nvim` is now the default **LazyVim** starter.", ["lazyvim.plugins.extras.coding.native_snippets"] = "Native snippets are now the default for **Neovim >= 0.10**", + ["lazyvim.plugins.extras.ui.treesitter-rewrite"] = "Disabled `treesitter-rewrite` extra for now. Not ready yet.", } M.deprecated_modules = { From 9176a6bc2214e2a1e3e6ed274b4e0cbd9789e03e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 17 May 2024 22:45:20 +0200 Subject: [PATCH 294/526] docs: remove mention of treesitter-rewrite from `NEWS.md` --- NEWS.md | 5 ----- lua/lazyvim/plugins/extras/coding/mini-ai.lua | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index 562e9fe8..26929abc 100644 --- a/NEWS.md +++ b/NEWS.md @@ -39,11 +39,6 @@ Additionally, some core plugins have been moved to extras. - `mini.indentscope` scopes are now also highlighted with `indent-blankline` - `nvim-treesitter-context` -- There's a new extra for the `nvim-treesitter` **rewrite**. - Since the rewrite is not backward compatible, some plugins will be disabled - when you enable this extra: `vim-illuminate`, `nvim-ts-autotag`, and `nvim-ts-autotag`. - I would **NOT** recommend enabling this extra for now. - ## 10.x - added new extra for [mini.diff](https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-diff.md) diff --git a/lua/lazyvim/plugins/extras/coding/mini-ai.lua b/lua/lazyvim/plugins/extras/coding/mini-ai.lua index b97c248e..1408b841 100644 --- a/lua/lazyvim/plugins/extras/coding/mini-ai.lua +++ b/lua/lazyvim/plugins/extras/coding/mini-ai.lua @@ -1,6 +1,7 @@ -- Better text-objects return { "echasnovski/mini.ai", + desc = "Enhanced text objects", -- keys = { -- { "a", mode = { "x", "o" } }, -- { "i", mode = { "x", "o" } }, From dc66887b57ecdee8d33b5e07ca031288260e2971 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Sat, 18 May 2024 11:07:33 +0300 Subject: [PATCH 295/526] =?UTF-8?q?fix(mini.starter):=20buf=5Fid=20in=20re?= =?UTF-8?q?fresh()=20is=20not=20an=20identifier=20of=20valid=20=E2=80=A6?= =?UTF-8?q?=20(#3209)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(mini.starter): buf_id in refresh() is not an identifier of valid Starter buffer Fixes #3207. * fix(mini.starter): just do `do VimResized` for simpler approach --- lua/lazyvim/plugins/extras/ui/mini-starter.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/ui/mini-starter.lua b/lua/lazyvim/plugins/extras/ui/mini-starter.lua index 5f5ec9c5..ae5b3720 100644 --- a/lua/lazyvim/plugins/extras/ui/mini-starter.lua +++ b/lua/lazyvim/plugins/extras/ui/mini-starter.lua @@ -68,7 +68,9 @@ return { local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) local pad_footer = string.rep(" ", 8) starter.config.footer = pad_footer .. "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms" - pcall(starter.refresh) + -- INFO: Use `VimResized` to avoid the `buf_id in refresh() is not an identifier of valid Starter buffer`, + -- since `starter.refresh` executes on every `VimResized` see https://github.com/echasnovski/mini.starter/blob/f0c491032dcda485ee740716217cd4d5c25b6014/lua/mini/starter.lua#L352-L353 + vim.cmd([[do VimResized]]) end, }) end, From cf328429b14578ec7c254cc72ea40b7c56b17ea2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 18 May 2024 08:08:21 +0000 Subject: [PATCH 296/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 568a4638..b4aa3516 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 17 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 18 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 9c212d655a05c42331443f5d0d6dcc982108ed0e Mon Sep 17 00:00:00 2001 From: Stefan Boca <45266795+stefanboca@users.noreply.github.com> Date: Sat, 18 May 2024 01:11:05 -0700 Subject: [PATCH 297/526] fix(leap): add label to renamed surround mappings key group (#3211) --- lua/lazyvim/plugins/extras/editor/leap.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/leap.lua b/lua/lazyvim/plugins/extras/editor/leap.lua index afcdc4b7..6145d641 100644 --- a/lua/lazyvim/plugins/extras/editor/leap.lua +++ b/lua/lazyvim/plugins/extras/editor/leap.lua @@ -51,6 +51,15 @@ return { }, }, }, + { + "folke/which-key.nvim", + optional = true, + opts = { + defaults = { + ["gz"] = { name = "+surround" }, + }, + }, + }, -- makes some plugins dot-repeatable like leap { "tpope/vim-repeat", event = "VeryLazy" }, From 08925421e840ac21f3feac28ee8b57319f0a4e59 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 18 May 2024 11:27:41 +0200 Subject: [PATCH 298/526] fix(trouble-v3): add neovim version check --- lua/lazyvim/plugins/extras/editor/trouble-v3.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/trouble-v3.lua b/lua/lazyvim/plugins/extras/editor/trouble-v3.lua index 41a773d1..7995de8d 100644 --- a/lua/lazyvim/plugins/extras/editor/trouble-v3.lua +++ b/lua/lazyvim/plugins/extras/editor/trouble-v3.lua @@ -12,6 +12,13 @@ if vim.tbl_contains(Config.json.data.extras, "lazyvim.plugins.extras.editor.trou }) end end + if vim.fn.has("nvim-0.9.2") == 0 then + LazyVim.error({ + "Trouble v3 requires Neovim >= 0.9.2", + "Please update your Neovim version.", + }) + return {} + end end return { From 3a193d3aa89c8ff0327abb3e60600eab154af93a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 18 May 2024 11:28:03 +0200 Subject: [PATCH 299/526] fix(indent-blankline): temp fix for `tbl_flatten` on `0.9.x` --- lua/lazyvim/plugins/ui.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index fdbe201f..55db2e6d 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -237,6 +237,13 @@ return { }, }, main = "ibl", + config = function(_, opts) + if vim.fn.has("nvim-0.10.0") == 0 then + local utils = require("ibl.utils") + utils.tbl_join = vim.tbl_flatten + end + require("ibl").setup(opts) + end, }, -- Displays a popup with possible key bindings of the command you started typing From 72abb893acc866ce574c66af7d9de861440a3a1f Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 18 May 2024 11:32:50 +0200 Subject: [PATCH 300/526] fix(bufferline): force update bufferline after `BufDelete`. Closes #3197 --- lua/lazyvim/plugins/ui.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 55db2e6d..1846ba0a 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -95,7 +95,7 @@ return { config = function(_, opts) require("bufferline").setup(opts) -- Fix bufferline when restoring a session - vim.api.nvim_create_autocmd("BufAdd", { + vim.api.nvim_create_autocmd({ "BufAdd", "BufDelete" }, { callback = function() vim.schedule(function() pcall(nvim_bufferline) From 1d23c98da138494fafdad6735d70c3d3375bb7b2 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 18 May 2024 12:05:19 +0200 Subject: [PATCH 301/526] fix(comments): better way of using ts-context-commentstring with native comments --- lua/lazyvim/plugins/coding.lua | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 3d2e910a..74caa45d 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -188,24 +188,18 @@ return { opts = { enable_autocmd = false, }, - }, - { - import = "lazyvim.plugins.extras.coding.mini-comment", - enabled = function() + init = function() if vim.fn.has("nvim-0.10") == 1 then - -- Majestically override the native `get_commentstring` function. - vim.schedule(function() - LazyVim.inject.set_upvalue( - LazyVim.inject.get_upvalue(require("vim._comment").textobject, "get_comment_parts"), - "get_commentstring", - function() - return require("ts_context_commentstring.internal").calculate_commentstring() or vim.bo.commentstring - end - ) - end) - else - return true + local get_option = vim.filetype.get_option + vim.filetype.get_option = function(filetype, option) + return option == "commentstring" and require("ts_context_commentstring.internal").calculate_commentstring() + or get_option(filetype, option) + end end end, }, + { + import = "lazyvim.plugins.extras.coding.mini-comment", + enabled = vim.fn.has("nvim-0.10") == 0, + }, } From c653c4a9a5c0a3cd5101ce86a3640ee12067ffcd Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 18 May 2024 12:09:07 +0200 Subject: [PATCH 302/526] perf(comments): `vim.schedule` ts-context-commentstring integration --- lua/lazyvim/plugins/coding.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 74caa45d..0cbdd7b6 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -190,11 +190,13 @@ return { }, init = function() if vim.fn.has("nvim-0.10") == 1 then - local get_option = vim.filetype.get_option - vim.filetype.get_option = function(filetype, option) - return option == "commentstring" and require("ts_context_commentstring.internal").calculate_commentstring() - or get_option(filetype, option) - end + vim.schedule(function() + local get_option = vim.filetype.get_option + vim.filetype.get_option = function(filetype, option) + return option == "commentstring" and require("ts_context_commentstring.internal").calculate_commentstring() + or get_option(filetype, option) + end + end) end end, }, From 180d9516fd68ca8b881cf1028eeb65aa9c2e25b7 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 18 May 2024 12:10:32 +0200 Subject: [PATCH 303/526] fix(extras): remove treesitter-rewrite extra for now --- .../plugins/extras/ui/treesitter-rewrite.lua | 107 ------------------ 1 file changed, 107 deletions(-) delete mode 100644 lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua diff --git a/lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua b/lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua deleted file mode 100644 index 9a8bab95..00000000 --- a/lua/lazyvim/plugins/extras/ui/treesitter-rewrite.lua +++ /dev/null @@ -1,107 +0,0 @@ -local Config = require("lazyvim.config") - --- backwards compatibility with the old treesitter config for adding custom parsers -local function patch() - local parsers = require("nvim-treesitter.parsers") - parsers.get_parser_configs = setmetatable({}, { - __call = function() - return parsers - end, - }) -end - -if vim.tbl_contains(Config.json.data.extras, "lazyvim.plugins.extras.ui.treesitter-rewrite") then - if vim.fn.executable("tree-sitter") == 0 then - LazyVim.error("**treesitter-rewrite** requires the `tree-sitter` executable to be installed") - return {} - end - - if vim.fn.has("nvim-0.10") == 0 then - LazyVim.error("**treesitter-rewrite** requires Neovim >= 0.10") - return {} - end -end - -return { - { - "nvim-treesitter/nvim-treesitter", - version = false, -- last release is way too old and doesn't work on Windows - branch = "main", - build = ":TSUpdate", - lazy = false, - cmd = {}, - opts = function() - patch() - return { - highlight = { enable = true }, - indent = { enable = true }, - ensure_install = { - "bash", - "c", - "diff", - "html", - "javascript", - "jsdoc", - "json", - "jsonc", - "lua", - "luadoc", - "luap", - "markdown", - "markdown_inline", - "python", - "query", - "regex", - "toml", - "tsx", - "typescript", - "vim", - "vimdoc", - "xml", - "yaml", - }, - } - end, - init = function() end, - ---@param opts TSConfig - config = function(_, opts) - ---@return string[] - local function norm(ensure) - return ensure == nil and {} or type(ensure) == "string" and { ensure } or ensure - end - - -- ensure_installed is deprecated, but still supported - opts.ensure_install = LazyVim.dedup(vim.list_extend(norm(opts.ensure_install), norm(opts.ensure_installed))) - - require("nvim-treesitter").setup(opts) - patch() - - -- backwards compatibility with the old treesitter config for indent - if vim.tbl_get(opts, "indent", "enable") then - vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" - end - - -- backwards compatibility with the old treesitter config for highlight - if vim.tbl_get(opts, "highlight", "enable") then - vim.api.nvim_create_autocmd("FileType", { - callback = function() - pcall(vim.treesitter.start) - end, - }) - end - end, - }, - { - "nvim-treesitter/nvim-treesitter-textobjects", - enabled = false, - }, - { - "windwp/nvim-ts-autotag", - enabled = false, - }, - { - "RRethy/vim-illuminate", - optional = true, - enabled = false, - }, -} From 434883632cd6bc884f36da0282073307d585d6a1 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 18 May 2024 12:46:03 +0200 Subject: [PATCH 304/526] perf(yanky): switch to shada backend. It seems much faster than sqlite --- lua/lazyvim/plugins/extras/coding/yanky.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/coding/yanky.lua b/lua/lazyvim/plugins/extras/coding/yanky.lua index 3e3a3bbc..154951a0 100644 --- a/lua/lazyvim/plugins/extras/coding/yanky.lua +++ b/lua/lazyvim/plugins/extras/coding/yanky.lua @@ -2,10 +2,8 @@ return { -- better yank/paste { "gbprod/yanky.nvim", - dependencies = not LazyVim.is_win() and { "kkharji/sqlite.lua" } or {}, opts = { highlight = { timer = 150 }, - ring = { storage = LazyVim.is_win() and "shada" or "sqlite" }, }, keys = { -- stylua: ignore From 16eb3d947321992ebcddff6b997d403b41bd7411 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 18 May 2024 14:11:50 +0200 Subject: [PATCH 305/526] feat(extras): added a recommended plugin/language section to `:LazyExtras` --- lua/lazyvim/util/extras.lua | 52 ++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/lua/lazyvim/util/extras.lua b/lua/lazyvim/util/extras.lua index 74ab4b4c..410466d9 100644 --- a/lua/lazyvim/util/extras.lua +++ b/lua/lazyvim/util/extras.lua @@ -16,12 +16,15 @@ local Text = require("lazy.view.text") ---@field desc? string ---@field enabled boolean ---@field managed boolean +---@field recommended? boolean ---@field row? number +---@field section? string ---@field plugins string[] ---@field optional string[] ---@class lazyvim.util.extras local M = {} +M.buf = 0 ---@type LazyExtraSource[] M.sources = { @@ -33,6 +36,24 @@ M.ns = vim.api.nvim_create_namespace("lazyvim.extras") ---@type string[] M.state = nil +---@param opts {ft?: string|string[], root?: string|string[]} +---@return boolean +function M.wants(opts) + if opts.ft then + opts.ft = type(opts.ft) == "string" and { opts.ft } or opts.ft + for _, f in ipairs(opts.ft) do + if vim.bo[M.buf].filetype == f then + return true + end + end + end + if opts.root then + opts.root = type(opts.root) == "string" and { opts.root } or opts.root + return #LazyVim.root.detectors.pattern(M.buf, opts.root) > 0 + end + return false +end + ---@return LazyExtra[] function M.get() M.state = M.state or LazyConfig.spec.modules @@ -74,6 +95,12 @@ function M.get_extra(source, modname) table.sort(plugins) table.sort(optional) + ---@type boolean|(fun():boolean?)|nil + local recommended = require(modname).recommended or false + if type(recommended) == "function" then + recommended = recommended() or false + end + ---@type LazyExtra return { source = source, @@ -81,6 +108,7 @@ function M.get_extra(source, modname) module = modname, enabled = enabled, desc = require(modname).desc, + recommended = recommended, managed = vim.tbl_contains(Config.json.data.extras, modname) or not enabled, plugins = plugins, optional = optional, @@ -97,6 +125,7 @@ local X = {} ---@return LazyExtraView function X.new() local self = setmetatable({}, { __index = X }) + M.buf = vim.api.nvim_get_current_buf() self.float = Float.new({ title = "LazyVim Extras" }) self.float:on_key("x", function() self:toggle() @@ -186,8 +215,14 @@ function X:render() :append("", "LazySpecial") :append(" key", "LazyComment") :nl() + for _, extra in ipairs(self.extras) do + extra.section = nil + end self:section({ enabled = true, title = "Enabled" }) - self:section({ enabled = false, title = "Disabled" }) + self:section({ recommended = true, filter = "^lang%.", title = "Recommended Languages", empty = false }) + self:section({ recommended = true, title = "Recommended Plugins", empty = false }) + self:section({ title = "Languages", filter = "^lang%." }) + self:section({ title = "Plugins" }) end ---@param extra LazyExtra @@ -206,6 +241,9 @@ function X:extra(extra) self.text:append(" " .. LazyConfig.options.ui.icons.not_loaded .. " ", hl) end self.text:append(extra.name) + if extra.recommended then + self.text:append(" "):append(LazyConfig.options.ui.icons.favorite or " ", "LazyCommit") + end if extra.source.name ~= "LazyVim" then self.text:append(" "):append(LazyConfig.options.ui.icons.event .. " " .. extra.source.name, "LazyReasonEvent") end @@ -221,16 +259,24 @@ function X:extra(extra) self.text:nl() end ----@param opts {enabled?:boolean, title?:string} +---@param opts {enabled?:boolean, title:string, recommended?:boolean, filter?:string, empty?:boolean} function X:section(opts) opts = opts or {} ---@type LazyExtra[] local extras = vim.tbl_filter(function(extra) - return opts.enabled == nil or extra.enabled == opts.enabled + return extra.section == nil + and (opts.enabled == nil or extra.enabled == opts.enabled) + and (opts.recommended == nil or extra.recommended == opts.recommended) + and (opts.filter == nil or extra.name:find(opts.filter)) end, self.extras) + if opts.empty == false and #extras == 0 then + return + end + self.text:nl():append(opts.title .. ":", "LazyH2"):append(" (" .. #extras .. ")", "LazyComment"):nl() for _, extra in ipairs(extras) do + extra.section = opts.title self:extra(extra) end end From ef3bd3bd027209812c41b1d772e766c0ef18c503 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 18 May 2024 14:12:21 +0200 Subject: [PATCH 306/526] feat(extras): tags some extras as recommended --- lua/lazyvim/plugins/extras/coding/copilot.lua | 2 +- lua/lazyvim/plugins/extras/coding/mini-ai.lua | 1 + .../plugins/extras/coding/mini-surround.lua | 1 + lua/lazyvim/plugins/extras/coding/yanky.lua | 50 +++++++------- lua/lazyvim/plugins/extras/dap/core.lua | 2 + lua/lazyvim/plugins/extras/editor/dial.lua | 2 + lua/lazyvim/plugins/extras/lang/python.lua | 13 ++++ .../plugins/extras/lang/typescript.lua | 13 ++++ lua/lazyvim/plugins/extras/test/core.lua | 2 + .../plugins/extras/ui/mini-animate.lua | 67 +++++++++---------- 10 files changed, 93 insertions(+), 60 deletions(-) diff --git a/lua/lazyvim/plugins/extras/coding/copilot.lua b/lua/lazyvim/plugins/extras/coding/copilot.lua index 86c54a6e..afe14f61 100644 --- a/lua/lazyvim/plugins/extras/coding/copilot.lua +++ b/lua/lazyvim/plugins/extras/coding/copilot.lua @@ -1,5 +1,5 @@ return { - + recommended = true, -- copilot { "zbirenbaum/copilot.lua", diff --git a/lua/lazyvim/plugins/extras/coding/mini-ai.lua b/lua/lazyvim/plugins/extras/coding/mini-ai.lua index 1408b841..7c4fdf70 100644 --- a/lua/lazyvim/plugins/extras/coding/mini-ai.lua +++ b/lua/lazyvim/plugins/extras/coding/mini-ai.lua @@ -2,6 +2,7 @@ return { "echasnovski/mini.ai", desc = "Enhanced text objects", + recommended = true, -- keys = { -- { "a", mode = { "x", "o" } }, -- { "i", mode = { "x", "o" } }, diff --git a/lua/lazyvim/plugins/extras/coding/mini-surround.lua b/lua/lazyvim/plugins/extras/coding/mini-surround.lua index d8ff25c5..56d16a60 100644 --- a/lua/lazyvim/plugins/extras/coding/mini-surround.lua +++ b/lua/lazyvim/plugins/extras/coding/mini-surround.lua @@ -4,6 +4,7 @@ -- and more. return { "echasnovski/mini.surround", + recommended = true, keys = function(_, keys) -- Populate the keys based on the user's options local opts = LazyVim.opts("mini.surround") diff --git a/lua/lazyvim/plugins/extras/coding/yanky.lua b/lua/lazyvim/plugins/extras/coding/yanky.lua index 154951a0..b915bc7b 100644 --- a/lua/lazyvim/plugins/extras/coding/yanky.lua +++ b/lua/lazyvim/plugins/extras/coding/yanky.lua @@ -1,30 +1,30 @@ +-- better yank/paste return { - -- better yank/paste - { - "gbprod/yanky.nvim", - opts = { - highlight = { timer = 150 }, - }, - keys = { + "gbprod/yanky.nvim", + recommended = true, + desc = "Better Yank/Paste", + opts = { + highlight = { timer = 150 }, + }, + keys = { -- stylua: ignore { "p", function() require("telescope").extensions.yank_history.yank_history({ }) end, desc = "Open Yank History" }, - { "y", "(YankyYank)", mode = { "n", "x" }, desc = "Yank Text" }, - { "p", "(YankyPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Cursor" }, - { "P", "(YankyPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Cursor" }, - { "gp", "(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Selection" }, - { "gP", "(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Selection" }, - { "[y", "(YankyCycleForward)", desc = "Cycle Forward Through Yank History" }, - { "]y", "(YankyCycleBackward)", desc = "Cycle Backward Through Yank History" }, - { "]p", "(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" }, - { "[p", "(YankyPutIndentBeforeLinewise)", desc = "Put Indented Before Cursor (Linewise)" }, - { "]P", "(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" }, - { "[P", "(YankyPutIndentBeforeLinewise)", desc = "Put Indented Before Cursor (Linewise)" }, - { ">p", "(YankyPutIndentAfterShiftRight)", desc = "Put and Indent Right" }, - { "(YankyPutIndentAfterShiftLeft)", desc = "Put and Indent Left" }, - { ">P", "(YankyPutIndentBeforeShiftRight)", desc = "Put Before and Indent Right" }, - { "(YankyPutIndentBeforeShiftLeft)", desc = "Put Before and Indent Left" }, - { "=p", "(YankyPutAfterFilter)", desc = "Put After Applying a Filter" }, - { "=P", "(YankyPutBeforeFilter)", desc = "Put Before Applying a Filter" }, - }, + { "y", "(YankyYank)", mode = { "n", "x" }, desc = "Yank Text" }, + { "p", "(YankyPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Cursor" }, + { "P", "(YankyPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Cursor" }, + { "gp", "(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Selection" }, + { "gP", "(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Selection" }, + { "[y", "(YankyCycleForward)", desc = "Cycle Forward Through Yank History" }, + { "]y", "(YankyCycleBackward)", desc = "Cycle Backward Through Yank History" }, + { "]p", "(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" }, + { "[p", "(YankyPutIndentBeforeLinewise)", desc = "Put Indented Before Cursor (Linewise)" }, + { "]P", "(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" }, + { "[P", "(YankyPutIndentBeforeLinewise)", desc = "Put Indented Before Cursor (Linewise)" }, + { ">p", "(YankyPutIndentAfterShiftRight)", desc = "Put and Indent Right" }, + { "(YankyPutIndentAfterShiftLeft)", desc = "Put and Indent Left" }, + { ">P", "(YankyPutIndentBeforeShiftRight)", desc = "Put Before and Indent Right" }, + { "(YankyPutIndentBeforeShiftLeft)", desc = "Put Before and Indent Left" }, + { "=p", "(YankyPutAfterFilter)", desc = "Put After Applying a Filter" }, + { "=P", "(YankyPutBeforeFilter)", desc = "Put Before Applying a Filter" }, }, } diff --git a/lua/lazyvim/plugins/extras/dap/core.lua b/lua/lazyvim/plugins/extras/dap/core.lua index fa6724b3..77864460 100644 --- a/lua/lazyvim/plugins/extras/dap/core.lua +++ b/lua/lazyvim/plugins/extras/dap/core.lua @@ -12,6 +12,8 @@ end return { "mfussenegger/nvim-dap", + recommended = true, + desc = "Debugging support. Requires language specific adapters to be configured. (see lang extras)", dependencies = { diff --git a/lua/lazyvim/plugins/extras/editor/dial.lua b/lua/lazyvim/plugins/extras/editor/dial.lua index 72ecc926..cc262a33 100644 --- a/lua/lazyvim/plugins/extras/editor/dial.lua +++ b/lua/lazyvim/plugins/extras/editor/dial.lua @@ -15,6 +15,8 @@ end return { "monaqa/dial.nvim", + recommended = true, + desc = "Increment and decrement numbers, dates, and more", -- stylua: ignore keys = { { "", function() return M.dial(true) end, expr = true, desc = "Increment", mode = {"n", "v"} }, diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index 3e7f5d59..f1e70548 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -9,6 +9,19 @@ local lsp = vim.g.lazyvim_python_lsp or "pyright" local ruff = vim.g.lazyvim_python_ruff or "ruff_lsp" return { + recommended = function() + return LazyVim.extras.wants({ + ft = "python", + root = { + "pyproject.toml", + "setup.py", + "setup.cfg", + "requirements.txt", + "Pipfile", + "pyrightconfig.json", + }, + }) + end, { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua index a1c6aba1..373775ce 100644 --- a/lua/lazyvim/plugins/extras/lang/typescript.lua +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -10,6 +10,19 @@ local inlay_hints_settings = { } return { + recommended = function() + return LazyVim.extras.wants({ + ft = { + "javascript", + "javascriptreact", + "javascript.jsx", + "typescript", + "typescriptreact", + "typescript.tsx", + }, + root = { "tsconfig.json", "package.json", "jsconfig.json" }, + }) + end, -- add typescript to treesitter { diff --git a/lua/lazyvim/plugins/extras/test/core.lua b/lua/lazyvim/plugins/extras/test/core.lua index e7dbd792..9a91ccc3 100644 --- a/lua/lazyvim/plugins/extras/test/core.lua +++ b/lua/lazyvim/plugins/extras/test/core.lua @@ -1,4 +1,6 @@ return { + recommended = true, + desc = "Neotest support. Requires language specific adapters to be configured. (see lang extras)", { "folke/which-key.nvim", optional = true, diff --git a/lua/lazyvim/plugins/extras/ui/mini-animate.lua b/lua/lazyvim/plugins/extras/ui/mini-animate.lua index dd2f8cd7..cca34135 100644 --- a/lua/lazyvim/plugins/extras/ui/mini-animate.lua +++ b/lua/lazyvim/plugins/extras/ui/mini-animate.lua @@ -1,37 +1,36 @@ +-- animations return { - -- animations - { - "echasnovski/mini.animate", - event = "VeryLazy", - opts = function() - -- don't use animate when scrolling with the mouse - local mouse_scrolled = false - for _, scroll in ipairs({ "Up", "Down" }) do - local key = "" - vim.keymap.set({ "", "i" }, key, function() - mouse_scrolled = true - return key - end, { expr = true }) - end + "echasnovski/mini.animate", + recommended = true, + event = "VeryLazy", + opts = function() + -- don't use animate when scrolling with the mouse + local mouse_scrolled = false + for _, scroll in ipairs({ "Up", "Down" }) do + local key = "" + vim.keymap.set({ "", "i" }, key, function() + mouse_scrolled = true + return key + end, { expr = true }) + end - local animate = require("mini.animate") - return { - resize = { - timing = animate.gen_timing.linear({ duration = 100, unit = "total" }), - }, - scroll = { - timing = animate.gen_timing.linear({ duration = 150, unit = "total" }), - subscroll = animate.gen_subscroll.equal({ - predicate = function(total_scroll) - if mouse_scrolled then - mouse_scrolled = false - return false - end - return total_scroll > 1 - end, - }), - }, - } - end, - }, + local animate = require("mini.animate") + return { + resize = { + timing = animate.gen_timing.linear({ duration = 100, unit = "total" }), + }, + scroll = { + timing = animate.gen_timing.linear({ duration = 150, unit = "total" }), + subscroll = animate.gen_subscroll.equal({ + predicate = function(total_scroll) + if mouse_scrolled then + mouse_scrolled = false + return false + end + return total_scroll > 1 + end, + }), + }, + } + end, } From 03ea7f6f98a874e26d258dbfe5b196c2d7c6971f Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 18 May 2024 14:38:53 +0200 Subject: [PATCH 307/526] feat(root): added support for `*.xxx` root patterns --- lua/lazyvim/util/root.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/util/root.lua b/lua/lazyvim/util/root.lua index c8de430d..f1167337 100644 --- a/lua/lazyvim/util/root.lua +++ b/lua/lazyvim/util/root.lua @@ -47,7 +47,17 @@ end function M.detectors.pattern(buf, patterns) patterns = type(patterns) == "string" and { patterns } or patterns local path = M.bufpath(buf) or vim.uv.cwd() - local pattern = vim.fs.find(patterns, { path = path, upward = true })[1] + local pattern = vim.fs.find(function(name) + for _, p in ipairs(patterns) do + if name == p then + return true + end + if p:sub(1, 1) == "*" and name:find(p:sub(2) .. "$") then + return true + end + end + return false + end, { path = path, upward = true })[1] return pattern and { vim.fs.dirname(pattern) } or {} end From c29213416b5e29fc56c465234dfd717f78a9e09f Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 18 May 2024 14:39:20 +0200 Subject: [PATCH 308/526] feat(extras): added recommended detectors for all languages --- lua/lazyvim/plugins/extras/lang/ansible.lua | 6 ++++++ lua/lazyvim/plugins/extras/lang/clangd.lua | 13 +++++++++++++ lua/lazyvim/plugins/extras/lang/cmake.lua | 6 ++++++ lua/lazyvim/plugins/extras/lang/docker.lua | 6 ++++++ lua/lazyvim/plugins/extras/lang/elixir.lua | 6 ++++++ lua/lazyvim/plugins/extras/lang/go.lua | 6 ++++++ lua/lazyvim/plugins/extras/lang/java.lua | 14 ++++++++++++++ lua/lazyvim/plugins/extras/lang/json.lua | 5 +++++ lua/lazyvim/plugins/extras/lang/markdown.lua | 6 ++++++ lua/lazyvim/plugins/extras/lang/omnisharp.lua | 7 +++++++ lua/lazyvim/plugins/extras/lang/ruby.lua | 6 ++++++ lua/lazyvim/plugins/extras/lang/rust.lua | 6 ++++++ lua/lazyvim/plugins/extras/lang/scala.lua | 6 ++++++ lua/lazyvim/plugins/extras/lang/tailwind.lua | 14 ++++++++++++++ lua/lazyvim/plugins/extras/lang/terraform.lua | 7 +++++++ lua/lazyvim/plugins/extras/lang/tex.lua | 6 ++++++ lua/lazyvim/plugins/extras/lang/vue.lua | 7 +++++++ lua/lazyvim/plugins/extras/lang/yaml.lua | 5 +++++ 18 files changed, 132 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/ansible.lua b/lua/lazyvim/plugins/extras/lang/ansible.lua index d1112115..5f080395 100644 --- a/lua/lazyvim/plugins/extras/lang/ansible.lua +++ b/lua/lazyvim/plugins/extras/lang/ansible.lua @@ -1,4 +1,10 @@ return { + recommended = function() + return LazyVim.extras.wants({ + ft = "yaml.ansible", + root = { "ansible.cfg", ".ansible-lint" }, + }) + end, { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) diff --git a/lua/lazyvim/plugins/extras/lang/clangd.lua b/lua/lazyvim/plugins/extras/lang/clangd.lua index b5d707d7..44e2f64c 100644 --- a/lua/lazyvim/plugins/extras/lang/clangd.lua +++ b/lua/lazyvim/plugins/extras/lang/clangd.lua @@ -1,4 +1,17 @@ return { + recommended = function() + return LazyVim.extras.wants({ + ft = { "c", "cpp", "objc", "objcpp", "cuda", "proto" }, + root = { + ".clangd", + ".clang-tidy", + ".clang-format", + "compile_commands.json", + "compile_flags.txt", + "configure.ac", -- AutoTools + }, + }) + end, -- Add C/C++ to treesitter { diff --git a/lua/lazyvim/plugins/extras/lang/cmake.lua b/lua/lazyvim/plugins/extras/lang/cmake.lua index 401669a3..a5bc804c 100644 --- a/lua/lazyvim/plugins/extras/lang/cmake.lua +++ b/lua/lazyvim/plugins/extras/lang/cmake.lua @@ -1,4 +1,10 @@ return { + recommended = function() + return LazyVim.extras.wants({ + ft = "cmake", + root = { "CMakePresets.json", "CTestConfig.cmake", "cmake" }, + }) + end, { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) diff --git a/lua/lazyvim/plugins/extras/lang/docker.lua b/lua/lazyvim/plugins/extras/lang/docker.lua index da9605ec..98a9be44 100644 --- a/lua/lazyvim/plugins/extras/lang/docker.lua +++ b/lua/lazyvim/plugins/extras/lang/docker.lua @@ -1,4 +1,10 @@ return { + recommended = function() + return LazyVim.extras.wants({ + ft = "dockerfile", + root = { "Dockerfile", "docker-compose.yml", "compose.yml", "docker-compose.yaml", "compose.yaml" }, + }) + end, { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) diff --git a/lua/lazyvim/plugins/extras/lang/elixir.lua b/lua/lazyvim/plugins/extras/lang/elixir.lua index f60dc18e..a6b9c260 100644 --- a/lua/lazyvim/plugins/extras/lang/elixir.lua +++ b/lua/lazyvim/plugins/extras/lang/elixir.lua @@ -1,4 +1,10 @@ return { + recommended = function() + return LazyVim.extras.wants({ + ft = { "elixir", "eelixir", "heex", "surface" }, + root = "mix.exs", + }) + end, { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) diff --git a/lua/lazyvim/plugins/extras/lang/go.lua b/lua/lazyvim/plugins/extras/lang/go.lua index 036eab6f..2ec43e22 100644 --- a/lua/lazyvim/plugins/extras/lang/go.lua +++ b/lua/lazyvim/plugins/extras/lang/go.lua @@ -1,4 +1,10 @@ return { + recommended = function() + return LazyVim.extras.wants({ + ft = { "go", "gomod", "gowork", "gotmpl" }, + root = { "go.work", "go.mod" }, + }) + end, { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) diff --git a/lua/lazyvim/plugins/extras/lang/java.lua b/lua/lazyvim/plugins/extras/lang/java.lua index 75b0805b..2d99a6cd 100644 --- a/lua/lazyvim/plugins/extras/lang/java.lua +++ b/lua/lazyvim/plugins/extras/lang/java.lua @@ -16,6 +16,20 @@ local function extend_or_override(config, custom, ...) end return { + recommended = function() + return LazyVim.extras.wants({ + ft = "java", + root = { + "build.gradle", + "build.gradle.kts", + "build.xml", -- Ant + "pom.xml", -- Maven + "settings.gradle", -- Gradle + "settings.gradle.kts", -- Gradle + }, + }) + end, + -- Add java to treesitter. { "nvim-treesitter/nvim-treesitter", diff --git a/lua/lazyvim/plugins/extras/lang/json.lua b/lua/lazyvim/plugins/extras/lang/json.lua index ff41ba4f..5f94caf7 100644 --- a/lua/lazyvim/plugins/extras/lang/json.lua +++ b/lua/lazyvim/plugins/extras/lang/json.lua @@ -1,4 +1,9 @@ return { + recommended = function() + return LazyVim.extras.wants({ + ft = { "json", "jsonc", "json5" }, + }) + end, -- add json to treesitter { diff --git a/lua/lazyvim/plugins/extras/lang/markdown.lua b/lua/lazyvim/plugins/extras/lang/markdown.lua index e56e6de2..e290f174 100644 --- a/lua/lazyvim/plugins/extras/lang/markdown.lua +++ b/lua/lazyvim/plugins/extras/lang/markdown.lua @@ -1,4 +1,10 @@ return { + recommended = function() + return LazyVim.extras.wants({ + ft = "markdown", + root = "README.md", + }) + end, { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) diff --git a/lua/lazyvim/plugins/extras/lang/omnisharp.lua b/lua/lazyvim/plugins/extras/lang/omnisharp.lua index 3885dd08..74fd2bd2 100644 --- a/lua/lazyvim/plugins/extras/lang/omnisharp.lua +++ b/lua/lazyvim/plugins/extras/lang/omnisharp.lua @@ -1,4 +1,11 @@ return { + recommended = function() + return LazyVim.extras.wants({ + ft = { "cs", "vb" }, + root = { "*.sln", "*.csproj", "omnisharp.json", "function.json" }, + }) + end, + { "Hoffs/omnisharp-extended-lsp.nvim", lazy = true }, { "nvim-treesitter/nvim-treesitter", diff --git a/lua/lazyvim/plugins/extras/lang/ruby.lua b/lua/lazyvim/plugins/extras/lang/ruby.lua index a7894692..40ff8005 100644 --- a/lua/lazyvim/plugins/extras/lang/ruby.lua +++ b/lua/lazyvim/plugins/extras/lang/ruby.lua @@ -1,4 +1,10 @@ return { + recommended = function() + return LazyVim.extras.wants({ + ft = "ruby", + root = "Gemfile", + }) + end, { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) diff --git a/lua/lazyvim/plugins/extras/lang/rust.lua b/lua/lazyvim/plugins/extras/lang/rust.lua index 6fe9e88e..98a166f5 100644 --- a/lua/lazyvim/plugins/extras/lang/rust.lua +++ b/lua/lazyvim/plugins/extras/lang/rust.lua @@ -1,4 +1,10 @@ return { + recommended = function() + return LazyVim.extras.wants({ + ft = "rust", + root = { "Cargo.toml", "rust-project.json" }, + }) + end, -- Extend auto completion { diff --git a/lua/lazyvim/plugins/extras/lang/scala.lua b/lua/lazyvim/plugins/extras/lang/scala.lua index eca2db45..47c87b87 100644 --- a/lua/lazyvim/plugins/extras/lang/scala.lua +++ b/lua/lazyvim/plugins/extras/lang/scala.lua @@ -3,6 +3,12 @@ -- If you like you can setup your own key bindings. -- For minimalistic setup have a look at https://github.com/scalameta/nvim-metals/discussions/39 return { + recommended = function() + return LazyVim.extras.wants({ + ft = "scala", + root = { "build.sbt", "build.sc", "build.gradle", "pom.xml" }, + }) + end, { "hrsh7th/nvim-cmp", requires = { diff --git a/lua/lazyvim/plugins/extras/lang/tailwind.lua b/lua/lazyvim/plugins/extras/lang/tailwind.lua index 795449ee..17ed92ef 100644 --- a/lua/lazyvim/plugins/extras/lang/tailwind.lua +++ b/lua/lazyvim/plugins/extras/lang/tailwind.lua @@ -1,4 +1,18 @@ return { + recommended = function() + return LazyVim.extras.wants({ + root = { + "tailwind.config.js", + "tailwind.config.cjs", + "tailwind.config.mjs", + "tailwind.config.ts", + "postcss.config.js", + "postcss.config.cjs", + "postcss.config.mjs", + "postcss.config.ts", + }, + }) + end, { "neovim/nvim-lspconfig", opts = { diff --git a/lua/lazyvim/plugins/extras/lang/terraform.lua b/lua/lazyvim/plugins/extras/lang/terraform.lua index 02c05793..e75a0eca 100644 --- a/lua/lazyvim/plugins/extras/lang/terraform.lua +++ b/lua/lazyvim/plugins/extras/lang/terraform.lua @@ -1,4 +1,11 @@ return { + recommended = function() + return LazyVim.extras.wants({ + ft = { "terraform", "hcl" }, + root = ".terraform", + }) + end, + { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) diff --git a/lua/lazyvim/plugins/extras/lang/tex.lua b/lua/lazyvim/plugins/extras/lang/tex.lua index f8dacfb4..2d1bca56 100644 --- a/lua/lazyvim/plugins/extras/lang/tex.lua +++ b/lua/lazyvim/plugins/extras/lang/tex.lua @@ -1,4 +1,10 @@ return { + recommended = function() + return LazyVim.extras.wants({ + ft = { "tex", "plaintex", "bib" }, + root = { ".latexmkrc", ".texlabroot", "texlabroot", "Tectonic.toml" }, + }) + end, { "folke/which-key.nvim", optional = true, diff --git a/lua/lazyvim/plugins/extras/lang/vue.lua b/lua/lazyvim/plugins/extras/lang/vue.lua index a943874b..2ce87c03 100644 --- a/lua/lazyvim/plugins/extras/lang/vue.lua +++ b/lua/lazyvim/plugins/extras/lang/vue.lua @@ -1,4 +1,11 @@ return { + recommended = function() + return LazyVim.extras.wants({ + ft = "vue", + root = { "vue.config.js" }, + }) + end, + { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) diff --git a/lua/lazyvim/plugins/extras/lang/yaml.lua b/lua/lazyvim/plugins/extras/lang/yaml.lua index 9fd88a3b..0aa23a2b 100644 --- a/lua/lazyvim/plugins/extras/lang/yaml.lua +++ b/lua/lazyvim/plugins/extras/lang/yaml.lua @@ -1,4 +1,9 @@ return { + recommended = function() + return LazyVim.extras.wants({ + ft = "yaml", + }) + end, -- add yaml specific modules to treesitter { From d514e2fa93a449329c2de64d569846102f24de0e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 18 May 2024 14:47:31 +0200 Subject: [PATCH 309/526] feat(extras): added trouble-v3 and mini-hipatterns to recommended --- lua/lazyvim/plugins/extras/editor/trouble-v3.lua | 2 ++ lua/lazyvim/plugins/extras/util/mini-hipatterns.lua | 2 ++ lua/lazyvim/util/extras.lua | 11 ++++++----- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/trouble-v3.lua b/lua/lazyvim/plugins/extras/editor/trouble-v3.lua index 7995de8d..9b6b8528 100644 --- a/lua/lazyvim/plugins/extras/editor/trouble-v3.lua +++ b/lua/lazyvim/plugins/extras/editor/trouble-v3.lua @@ -22,6 +22,8 @@ if vim.tbl_contains(Config.json.data.extras, "lazyvim.plugins.extras.editor.trou end return { + desc = "Trouble rewrite including document symbols and a lualine component", + recommended = true, { "folke/trouble.nvim", branch = "dev", diff --git a/lua/lazyvim/plugins/extras/util/mini-hipatterns.lua b/lua/lazyvim/plugins/extras/util/mini-hipatterns.lua index 66e34c30..7c887088 100644 --- a/lua/lazyvim/plugins/extras/util/mini-hipatterns.lua +++ b/lua/lazyvim/plugins/extras/util/mini-hipatterns.lua @@ -5,6 +5,8 @@ M.hl = {} M.plugin = { "echasnovski/mini.hipatterns", + recommended = true, + desc = "Highlight colors in your code. Also includes Tailwind CSS support.", event = "LazyFile", opts = function() local hi = require("mini.hipatterns") diff --git a/lua/lazyvim/util/extras.lua b/lua/lazyvim/util/extras.lua index 410466d9..773f6b9e 100644 --- a/lua/lazyvim/util/extras.lua +++ b/lua/lazyvim/util/extras.lua @@ -219,10 +219,10 @@ function X:render() extra.section = nil end self:section({ enabled = true, title = "Enabled" }) - self:section({ recommended = true, filter = "^lang%.", title = "Recommended Languages", empty = false }) + self:section({ recommended = true, include = "^lang%.", title = "Recommended Languages", empty = false }) self:section({ recommended = true, title = "Recommended Plugins", empty = false }) - self:section({ title = "Languages", filter = "^lang%." }) - self:section({ title = "Plugins" }) + self:section({ title = "Plugins", exclude = "^lang%." }) + self:section({ title = "Languages" }) end ---@param extra LazyExtra @@ -259,7 +259,7 @@ function X:extra(extra) self.text:nl() end ----@param opts {enabled?:boolean, title:string, recommended?:boolean, filter?:string, empty?:boolean} +---@param opts {enabled?:boolean, title:string, recommended?:boolean, include?:string, exclude?:string, empty?:boolean} function X:section(opts) opts = opts or {} ---@type LazyExtra[] @@ -267,7 +267,8 @@ function X:section(opts) return extra.section == nil and (opts.enabled == nil or extra.enabled == opts.enabled) and (opts.recommended == nil or extra.recommended == opts.recommended) - and (opts.filter == nil or extra.name:find(opts.filter)) + and (opts.include == nil or extra.name:find(opts.include)) + and (opts.exclude == nil or not extra.name:find(opts.exclude)) end, self.extras) if opts.empty == false and #extras == 0 then From 30b8169cb2e4836422b128d527d88550e04521d0 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 18 May 2024 14:53:20 +0200 Subject: [PATCH 310/526] docs: updated news on new recommended extras --- NEWS.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/NEWS.md b/NEWS.md index 26929abc..65503bc8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,14 @@ ## 11.x +- `:LazyExtras` now has multiple new sections: + + - **Enabled**: extras that are currently enabled + - **Recommended Languages**: language extras recommended for the current buffer / directory + - **Recommended Plugins**: extras that are recommended for most users + - **Plugins**: other plugin extras + - **Languages**: other language extras + - new option `vim.g.deprecation_warnings` to disable deprecation warnings Defaults to `false`. To disable, set it to `true` in your `options.lua` From 90809599810a46fb7b7e6e9eb8c2591f317aeacd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 18 May 2024 15:07:54 +0200 Subject: [PATCH 311/526] chore(main): release 11.2.0 (#3206) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a27abe47..dd192b07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,36 @@ # Changelog +## [11.2.0](https://github.com/LazyVim/LazyVim/compare/v11.1.2...v11.2.0) (2024-05-18) + + +### Features + +* **extras:** added a recommended plugin/language section to `:LazyExtras` ([16eb3d9](https://github.com/LazyVim/LazyVim/commit/16eb3d947321992ebcddff6b997d403b41bd7411)) +* **extras:** added recommended detectors for all languages ([c292134](https://github.com/LazyVim/LazyVim/commit/c29213416b5e29fc56c465234dfd717f78a9e09f)) +* **extras:** added trouble-v3 and mini-hipatterns to recommended ([d514e2f](https://github.com/LazyVim/LazyVim/commit/d514e2fa93a449329c2de64d569846102f24de0e)) +* **extras:** tags some extras as recommended ([ef3bd3b](https://github.com/LazyVim/LazyVim/commit/ef3bd3bd027209812c41b1d772e766c0ef18c503)) +* **root:** added support for `*.xxx` root patterns ([03ea7f6](https://github.com/LazyVim/LazyVim/commit/03ea7f6f98a874e26d258dbfe5b196c2d7c6971f)) + + +### Bug Fixes + +* **bufferline:** force update bufferline after `BufDelete`. Closes [#3197](https://github.com/LazyVim/LazyVim/issues/3197) ([72abb89](https://github.com/LazyVim/LazyVim/commit/72abb893acc866ce574c66af7d9de861440a3a1f)) +* **comments:** better way of using ts-context-commentstring with native comments ([1d23c98](https://github.com/LazyVim/LazyVim/commit/1d23c98da138494fafdad6735d70c3d3375bb7b2)) +* **extras:** remove treesitter-rewrite extra for now ([180d951](https://github.com/LazyVim/LazyVim/commit/180d9516fd68ca8b881cf1028eeb65aa9c2e25b7)) +* **indent-blankline:** temp fix for `tbl_flatten` on `0.9.x` ([3a193d3](https://github.com/LazyVim/LazyVim/commit/3a193d3aa89c8ff0327abb3e60600eab154af93a)) +* **leap:** add label to renamed surround mappings key group ([#3211](https://github.com/LazyVim/LazyVim/issues/3211)) ([9c212d6](https://github.com/LazyVim/LazyVim/commit/9c212d655a05c42331443f5d0d6dcc982108ed0e)) +* **mini.starter:** buf_id in refresh() is not an identifier of valid … ([#3209](https://github.com/LazyVim/LazyVim/issues/3209)) ([dc66887](https://github.com/LazyVim/LazyVim/commit/dc66887b57ecdee8d33b5e07ca031288260e2971)) +* **refactoring:** add label to refactoring key group ([#3201](https://github.com/LazyVim/LazyVim/issues/3201)) ([39bec71](https://github.com/LazyVim/LazyVim/commit/39bec71ce9489eee288544dca22015147636ae4d)) +* **treesitter:** disable treesitter-rewrite extra for now. not ready yet ([87bb766](https://github.com/LazyVim/LazyVim/commit/87bb76612318f0c0b4fca675500e3afd0a9c6771)) +* **trouble-v3:** add neovim version check ([0892542](https://github.com/LazyVim/LazyVim/commit/08925421e840ac21f3feac28ee8b57319f0a4e59)) +* **util.toggle:** correctly toggle `inlay_hints` ([#3202](https://github.com/LazyVim/LazyVim/issues/3202)) ([23374f1](https://github.com/LazyVim/LazyVim/commit/23374f160a5b1b947681d55add56ab6ab15e219e)) + + +### Performance Improvements + +* **comments:** `vim.schedule` ts-context-commentstring integration ([c653c4a](https://github.com/LazyVim/LazyVim/commit/c653c4a9a5c0a3cd5101ce86a3640ee12067ffcd)) +* **yanky:** switch to shada backend. It seems much faster than sqlite ([4348836](https://github.com/LazyVim/LazyVim/commit/434883632cd6bc884f36da0282073307d585d6a1)) + ## [11.1.2](https://github.com/LazyVim/LazyVim/compare/v11.1.1...v11.1.2) (2024-05-17) From a4d83524a7179274c17414ebeb0a4e4b8d9a8706 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 18 May 2024 15:46:28 +0200 Subject: [PATCH 312/526] fix(lsp): move next/prev reference keymaps to lsp keymaps. See #3220 --- lua/lazyvim/plugins/lsp/keymaps.lua | 4 +++- lua/lazyvim/util/lsp.lua | 6 ------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/lua/lazyvim/plugins/lsp/keymaps.lua b/lua/lazyvim/plugins/lsp/keymaps.lua index 0f5aecb7..14626afd 100644 --- a/lua/lazyvim/plugins/lsp/keymaps.lua +++ b/lua/lazyvim/plugins/lsp/keymaps.lua @@ -39,7 +39,9 @@ function M.get() end, desc = "Source Action", has = "codeAction", - } + }, + { "]]", function() LazyVim.lsp.words.jump(vim.v.count1) end, has = "documentHighlight", desc = "Next Reference" }, + { "[[", function() LazyVim.lsp.words.jump(-vim.v.count1) end, has = "documentHighlight", desc = "Next Reference" }, } if LazyVim.has("inc-rename.nvim") then M._keys[#M._keys + 1] = { diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index a4acdc19..e2eb82de 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -158,12 +158,6 @@ function M.words.setup(opts) end end, }) - vim.keymap.set("n", "]]", function() - M.words.jump(vim.v.count1) - end, { buffer = buf, desc = "Next reference" }) - vim.keymap.set("n", "[[", function() - M.words.jump(-vim.v.count1) - end, { buffer = buf, desc = "Previous reference" }) end end) end From eb6c9fb5784a8001c876203de174cd79e96bb637 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Sat, 18 May 2024 19:14:35 +0300 Subject: [PATCH 313/526] fix(mini.starter): changes based on echasnovski's recommendation (#3223) --- lua/lazyvim/plugins/extras/ui/mini-starter.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lua/lazyvim/plugins/extras/ui/mini-starter.lua b/lua/lazyvim/plugins/extras/ui/mini-starter.lua index ae5b3720..e6078d60 100644 --- a/lua/lazyvim/plugins/extras/ui/mini-starter.lua +++ b/lua/lazyvim/plugins/extras/ui/mini-starter.lua @@ -63,14 +63,15 @@ return { vim.api.nvim_create_autocmd("User", { pattern = "LazyVimStarted", - callback = function() + callback = function(ev) local stats = require("lazy").stats() local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) local pad_footer = string.rep(" ", 8) starter.config.footer = pad_footer .. "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms" - -- INFO: Use `VimResized` to avoid the `buf_id in refresh() is not an identifier of valid Starter buffer`, - -- since `starter.refresh` executes on every `VimResized` see https://github.com/echasnovski/mini.starter/blob/f0c491032dcda485ee740716217cd4d5c25b6014/lua/mini/starter.lua#L352-L353 - vim.cmd([[do VimResized]]) + -- INFO: based on @echasnovski's recommendation (thanks a lot!!!) + if vim.bo[ev.buf].filetype == "starter" then + pcall(starter.refresh) + end end, }) end, From 4bc9389bb5347bb6af119daa6dd16ee646436453 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 18 May 2024 21:32:53 +0200 Subject: [PATCH 314/526] refactor(snippets): refactored snippet code --- lua/lazyvim/plugins/coding.lua | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 0cbdd7b6..19c7785b 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -115,38 +115,16 @@ return { { "", function() - if vim.snippet.active({ direction = 1 }) then - vim.schedule(function() - vim.snippet.jump(1) - end) - return - end - return "" + return vim.snippet.active({ direction = 1 }) and "lua vim.snippet.jump(1)" or "" end, expr = true, silent = true, - mode = "i", - }, - { - "", - function() - vim.schedule(function() - vim.snippet.jump(1) - end) - end, - silent = true, - mode = "s", + mode = { "i", "s" }, }, { "", function() - if vim.snippet.active({ direction = -1 }) then - vim.schedule(function() - vim.snippet.jump(-1) - end) - return - end - return "" + return vim.snippet.active({ direction = -1 }) and "lua vim.snippet.jump(-1)" or "" end, expr = true, silent = true, From fe552853f5c065df2d79092c0cbac6745f8ea8fc Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 18 May 2024 21:37:25 +0200 Subject: [PATCH 315/526] fix(treesitter): refactored treesitter code and fixed nvim-treesitter-textobjects --- lua/lazyvim/plugins/treesitter.lua | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/lua/lazyvim/plugins/treesitter.lua b/lua/lazyvim/plugins/treesitter.lua index 19aef89b..7d3b5e89 100644 --- a/lua/lazyvim/plugins/treesitter.lua +++ b/lua/lazyvim/plugins/treesitter.lua @@ -74,27 +74,23 @@ return { ---@param opts TSConfig config = function(_, opts) if type(opts.ensure_installed) == "table" then - ---@type table - local added = {} - opts.ensure_installed = vim.tbl_filter(function(lang) - if added[lang] then - return false - end - added[lang] = true - return true - end, opts.ensure_installed) + opts.ensure_installed = LazyVim.dedup(opts.ensure_installed) end require("nvim-treesitter.configs").setup(opts) - vim.schedule(function() - require("lazy").load({ plugins = { "nvim-treesitter-textobjects" } }) - end) end, }, { "nvim-treesitter/nvim-treesitter-textobjects", - lazy = true, + event = "VeryLazy", + enabled = true, config = function() + -- If treesitter is already loaded, we need to run config again for textobjects + if LazyVim.is_loaded("nvim-treesitter") then + local opts = LazyVim.opts("nvim-treesitter") + require("nvim-treesitter.configs").setup({ textobjects = opts.textobjects }) + end + -- When in diff mode, we want to use the default -- vim text objects c & C instead of the treesitter ones. local move = require("nvim-treesitter.textobjects.move") ---@type table From 4105c0ad3a441da3a31cc7d8e53305a6117f6ee5 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 18 May 2024 21:37:42 +0200 Subject: [PATCH 316/526] feat(util): added Util.is_loaded --- lua/lazyvim/util/init.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index d6907a60..bc13b730 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -16,6 +16,7 @@ local LazyUtil = require("lazy.core.util") ---@field news lazyvim.util.news ---@field json lazyvim.util.json ---@field lualine lazyvim.util.lualine +---@field mini lazyvim.util.mini local M = {} ---@type table @@ -126,11 +127,15 @@ function M.lazy_notify() timer:start(500, 0, replay) end +function M.is_loaded(name) + local Config = require("lazy.core.config") + return Config.plugins[name] and Config.plugins[name]._.loaded +end + ---@param name string ---@param fn fun(name:string) function M.on_load(name, fn) - local Config = require("lazy.core.config") - if Config.plugins[name] and Config.plugins[name]._.loaded then + if M.is_loaded(name) then fn(name) else vim.api.nvim_create_autocmd("User", { From d8644c47158fd28b88f5e3a90af6e5e6a0df2eba Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 18 May 2024 21:52:16 +0200 Subject: [PATCH 317/526] feat(mini.ai): `mini.ai` is back in core with some improved features. Removing it was a mistake. --- NEWS.md | 4 +- lua/lazyvim/config/init.lua | 2 +- lua/lazyvim/plugins/coding.lua | 33 ++++++ lua/lazyvim/plugins/extras/coding/mini-ai.lua | 97 --------------- lua/lazyvim/plugins/xtras.lua | 10 +- lua/lazyvim/util/json.lua | 7 ++ lua/lazyvim/util/mini.lua | 112 ++++++++++++++++++ lua/lazyvim/util/plugin.lua | 1 + 8 files changed, 158 insertions(+), 108 deletions(-) delete mode 100644 lua/lazyvim/plugins/extras/coding/mini-ai.lua create mode 100644 lua/lazyvim/util/mini.lua diff --git a/NEWS.md b/NEWS.md index 65503bc8..754615b9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,9 @@ ## 11.x +- `mini.ai` is back as a default plugin! Removing it was a mistake. + It's a great plugin that enhances the native text objects. + - `:LazyExtras` now has multiple new sections: - **Enabled**: extras that are currently enabled @@ -42,7 +45,6 @@ Additionally, some core plugins have been moved to extras. - plugins moved to extras: - - `mini.ai` which I couldn't live without, but not everyone needs it - `mini.surround` - `mini.indentscope` scopes are now also highlighted with `indent-blankline` - `nvim-treesitter-context` diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index de200eda..d990f94d 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -132,7 +132,7 @@ local defaults = { } M.json = { - version = 3, + version = 4, data = { version = nil, ---@type string? news = {}, ---@type table diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 19c7785b..4c023141 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -182,4 +182,37 @@ return { import = "lazyvim.plugins.extras.coding.mini-comment", enabled = vim.fn.has("nvim-0.10") == 0, }, + + -- Better text-objects + { + "echasnovski/mini.ai", + event = "VeryLazy", + opts = function() + LazyVim.on_load("which-key.nvim", function() + vim.schedule(LazyVim.mini.ai_whichkey) + end) + local ai = require("mini.ai") + return { + n_lines = 500, + custom_textobjects = { + o = ai.gen_spec.treesitter({ -- code block + a = { "@block.outer", "@conditional.outer", "@loop.outer" }, + i = { "@block.inner", "@conditional.inner", "@loop.inner" }, + }), + f = ai.gen_spec.treesitter({ a = "@function.outer", i = "@function.inner" }), -- function + c = ai.gen_spec.treesitter({ a = "@class.outer", i = "@class.inner" }), -- class + t = { "<([%p%w]-)%f[^<%w][^<>]->.-", "^<.->().*()$" }, -- tags + d = { "%f[%d]%d+" }, -- digits + e = { -- Word with case + { "%u[%l%d]+%f[^%l%d]", "%f[%S][%l%d]+%f[^%l%d]", "%f[%P][%l%d]+%f[^%l%d]", "^[%l%d]+%f[^%l%d]" }, + "^().*()$", + }, + i = LazyVim.mini.ai_indent, -- indent + g = LazyVim.mini.ai_buffer, -- buffer + u = ai.gen_spec.function_call(), -- u for "Usage" + U = ai.gen_spec.function_call({ name_pattern = "[%w_]" }), -- without dot in function name + }, + } + end, + }, } diff --git a/lua/lazyvim/plugins/extras/coding/mini-ai.lua b/lua/lazyvim/plugins/extras/coding/mini-ai.lua deleted file mode 100644 index 7c4fdf70..00000000 --- a/lua/lazyvim/plugins/extras/coding/mini-ai.lua +++ /dev/null @@ -1,97 +0,0 @@ --- Better text-objects -return { - "echasnovski/mini.ai", - desc = "Enhanced text objects", - recommended = true, - -- keys = { - -- { "a", mode = { "x", "o" } }, - -- { "i", mode = { "x", "o" } }, - -- }, - event = "VeryLazy", - opts = function() - local ai = require("mini.ai") - return { - n_lines = 500, - custom_textobjects = { - o = ai.gen_spec.treesitter({ - a = { "@block.outer", "@conditional.outer", "@loop.outer" }, - i = { "@block.inner", "@conditional.inner", "@loop.inner" }, - }, {}), - f = ai.gen_spec.treesitter({ a = "@function.outer", i = "@function.inner" }, {}), - c = ai.gen_spec.treesitter({ a = "@class.outer", i = "@class.inner" }, {}), - t = { "<([%p%w]-)%f[^<%w][^<>]->.-", "^<.->().*()$" }, - d = { "%f[%d]%d+" }, -- digits - e = { -- Word with case - { - "%u[%l%d]+%f[^%l%d]", - "%f[%S][%l%d]+%f[^%l%d]", - "%f[%P][%l%d]+%f[^%l%d]", - "^[%l%d]+%f[^%l%d]", - }, - "^().*()$", - }, - g = function() -- Whole buffer, similar to `gg` and 'G' motion - local from = { line = 1, col = 1 } - local to = { - line = vim.fn.line("$"), - col = math.max(vim.fn.getline("$"):len(), 1), - } - return { from = from, to = to } - end, - u = ai.gen_spec.function_call(), -- u for "Usage" - U = ai.gen_spec.function_call({ name_pattern = "[%w_]" }), -- without dot in function name - }, - } - end, - config = function(_, opts) - require("mini.ai").setup(opts) - -- register all text objects with which-key - LazyVim.on_load("which-key.nvim", function() - ---@type table - local i = { - [" "] = "Whitespace", - ['"'] = 'Balanced "', - ["'"] = "Balanced '", - ["`"] = "Balanced `", - ["("] = "Balanced (", - [")"] = "Balanced ) including white-space", - [">"] = "Balanced > including white-space", - [""] = "Balanced <", - ["]"] = "Balanced ] including white-space", - ["["] = "Balanced [", - ["}"] = "Balanced } including white-space", - ["{"] = "Balanced {", - ["?"] = "User Prompt", - _ = "Underscore", - a = "Argument", - b = "Balanced ), ], }", - c = "Class", - d = "Digit(s)", - e = "Word in CamelCase & snake_case", - f = "Function", - g = "Entire file", - o = "Block, conditional, loop", - q = "Quote `, \", '", - t = "Tag", - u = "Use/call function & method", - U = "Use/call without dot in name", - } - local a = vim.deepcopy(i) - for k, v in pairs(a) do - a[k] = v:gsub(" including.*", "") - end - - local ic = vim.deepcopy(i) - local ac = vim.deepcopy(a) - for key, name in pairs({ n = "Next", l = "Last" }) do - i[key] = vim.tbl_extend("force", { name = "Inside " .. name .. " textobject" }, ic) - a[key] = vim.tbl_extend("force", { name = "Around " .. name .. " textobject" }, ac) - end - require("which-key").register({ - mode = { "o", "x" }, - i = i, - a = a, - }) - end) - end, -} diff --git a/lua/lazyvim/plugins/xtras.lua b/lua/lazyvim/plugins/xtras.lua index 39a561a1..6f50ec5b 100644 --- a/lua/lazyvim/plugins/xtras.lua +++ b/lua/lazyvim/plugins/xtras.lua @@ -9,16 +9,8 @@ local prios = { ["lazyvim.plugins.extras.dap.core"] = 1, } -local used = {} ---@type table - ---@type string[] -Config.json.data.extras = vim.tbl_filter(function(extra) - if used[extra] then - return false - end - used[extra] = true - return true -end, Config.json.data.extras) +Config.json.data.extras = LazyVim.dedup(Config.json.data.extras) table.sort(Config.json.data.extras, function(a, b) local pa = prios[a] or 10 diff --git a/lua/lazyvim/util/json.lua b/lua/lazyvim/util/json.lua index 3df7aecd..4196847e 100644 --- a/lua/lazyvim/util/json.lua +++ b/lua/lazyvim/util/json.lua @@ -78,6 +78,13 @@ function M.migrate() return extra == "lazyvim.plugins.extras.editor.symbols-outline" and "lazyvim.plugins.extras.editor.outline" or extra end, json.data.extras or {}) + elseif json.data.version == 3 then + json.data.extras = vim.tbl_filter(function(extra) + return not ( + extra == "lazyvim.plugins.extras.coding.mini-ai" + or extra == "lazyvim.plugins.extras.ui.treesitter-rewrite" + ) + end, json.data.extras or {}) end M.save() diff --git a/lua/lazyvim/util/mini.lua b/lua/lazyvim/util/mini.lua new file mode 100644 index 00000000..986a1887 --- /dev/null +++ b/lua/lazyvim/util/mini.lua @@ -0,0 +1,112 @@ +---@class lazyvim.util.mini +local M = {} + +---@alias Mini.ai.loc {line:number, col:number} +---@alias Mini.ai.region {from:Mini.ai.loc, to:Mini.ai.loc} + +-- Mini.ai indent text object +-- For "a", it will include the non-whitespace line surrounding the indent block. +-- "a" is line-wise, "i" is character-wise. +function M.ai_indent(ai_type) + local spaces = (" "):rep(vim.o.tabstop) + local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false) + local indents = {} ---@type {line: number, indent: number, text: string}[] + + for l, line in ipairs(lines) do + if not line:find("^%s*$") then + indents[#indents + 1] = { line = l, indent = #line:gsub("\t", spaces):match("^%s*"), text = line } + end + end + + local ret = {} ---@type (Mini.ai.region | {indent: number})[] + + for i = 1, #indents do + if i == 1 or indents[i - 1].indent < indents[i].indent then + local from, to = i, i + for j = i + 1, #indents do + if indents[j].indent < indents[i].indent then + break + end + to = j + end + from = ai_type == "a" and from > 1 and from - 1 or from + to = ai_type == "a" and to < #indents and to + 1 or to + ret[#ret + 1] = { + indent = indents[i].indent, + from = { line = indents[from].line, col = ai_type == "a" and 1 or indents[from].indent + 1 }, + to = { line = indents[to].line, col = #indents[to].text }, + } + end + end + + return ret +end + +-- taken from MiniExtra.gen_ai_spec.buffer +function M.ai_buffer(ai_type) + local start_line, end_line = 1, vim.fn.line("$") + if ai_type == "i" then + -- Skip first and last blank lines for `i` textobject + local first_nonblank, last_nonblank = vim.fn.nextnonblank(start_line), vim.fn.prevnonblank(end_line) + -- Do nothing for buffer with all blanks + if first_nonblank == 0 or last_nonblank == 0 then + return { from = { line = start_line, col = 1 } } + end + start_line, end_line = first_nonblank, last_nonblank + end + + local to_col = math.max(vim.fn.getline(end_line):len(), 1) + return { from = { line = start_line, col = 1 }, to = { line = end_line, col = to_col } } +end + +-- register all text objects with which-key +function M.ai_whichkey() + ---@type table + local i = { + [" "] = "Whitespace", + ['"'] = 'Balanced "', + ["'"] = "Balanced '", + ["`"] = "Balanced `", + ["("] = "Balanced (", + [")"] = "Balanced ) including white-space", + [">"] = "Balanced > including white-space", + [""] = "Balanced <", + ["]"] = "Balanced ] including white-space", + ["["] = "Balanced [", + ["}"] = "Balanced } including white-space", + ["{"] = "Balanced {", + ["?"] = "User Prompt", + _ = "Underscore", + a = "Argument", + b = "Balanced ), ], }", + c = "Class", + d = "Digit(s)", + e = "Word in CamelCase & snake_case", + f = "Function", + g = "Entire file", + i = "Indent", + o = "Block, conditional, loop", + q = "Quote `, \", '", + t = "Tag", + u = "Use/call function & method", + U = "Use/call without dot in name", + } + local a = vim.deepcopy(i) + for k, v in pairs(a) do + a[k] = v:gsub(" including.*", "") + end + + local ic = vim.deepcopy(i) + local ac = vim.deepcopy(a) + for key, name in pairs({ n = "Next", l = "Last" }) do + i[key] = vim.tbl_extend("force", { name = "Inside " .. name .. " textobject" }, ic) + a[key] = vim.tbl_extend("force", { name = "Around " .. name .. " textobject" }, ac) + end + require("which-key").register({ + mode = { "o", "x" }, + i = i, + a = a, + }) +end + +return M diff --git a/lua/lazyvim/util/plugin.lua b/lua/lazyvim/util/plugin.lua index 0789b09f..99e66ae5 100644 --- a/lua/lazyvim/util/plugin.lua +++ b/lua/lazyvim/util/plugin.lua @@ -12,6 +12,7 @@ M.deprecated_extras = { ["lazyvim.plugins.extras.ui.dashboard"] = "`dashboard.nvim` is now the default **LazyVim** starter.", ["lazyvim.plugins.extras.coding.native_snippets"] = "Native snippets are now the default for **Neovim >= 0.10**", ["lazyvim.plugins.extras.ui.treesitter-rewrite"] = "Disabled `treesitter-rewrite` extra for now. Not ready yet.", + ["lazyvim.plugins.extras.coding.mini-ai"] = "`mini.ai` is now a code LazyVim plugin (again)", } M.deprecated_modules = { From 4614666d1ee5864e95a08eb5b85808d7834ce85f Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 18 May 2024 21:53:19 +0200 Subject: [PATCH 318/526] fix(ibl): remove ibl fix since it's been fixed upstream --- lua/lazyvim/plugins/ui.lua | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 1846ba0a..0d401f23 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -237,13 +237,6 @@ return { }, }, main = "ibl", - config = function(_, opts) - if vim.fn.has("nvim-0.10.0") == 0 then - local utils = require("ibl.utils") - utils.tbl_join = vim.tbl_flatten - end - require("ibl").setup(opts) - end, }, -- Displays a popup with possible key bindings of the command you started typing From 649fa9d52188e0c28733402f2f65014fa73308bc Mon Sep 17 00:00:00 2001 From: Rubin Bhandari Date: Sun, 19 May 2024 01:40:54 +0545 Subject: [PATCH 319/526] fix(keymaps): delete lazygit keymap when using gitui (#2986) * fix(keymaps): delete lazygit keymap when using gitui * Update gitui.lua --- lua/lazyvim/plugins/extras/util/gitui.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/lazyvim/plugins/extras/util/gitui.lua b/lua/lazyvim/plugins/extras/util/gitui.lua index 588cdbfd..ad044cd8 100644 --- a/lua/lazyvim/plugins/extras/util/gitui.lua +++ b/lua/lazyvim/plugins/extras/util/gitui.lua @@ -18,6 +18,8 @@ return { opts = function(_, opts) opts.ensure_installed = opts.ensure_installed or {} vim.list_extend(opts.ensure_installed, { "gitui" }) + -- delete lazygit keymap for file history + vim.keymap.del("n", "gf") end, }, } From 96aa4b8877faa2fea30d2d4e2d3d117d9d3851f8 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Sat, 18 May 2024 16:31:13 -0400 Subject: [PATCH 320/526] fix(plugin): typo (#3225) --- lua/lazyvim/util/plugin.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/plugin.lua b/lua/lazyvim/util/plugin.lua index 99e66ae5..a1cb8f46 100644 --- a/lua/lazyvim/util/plugin.lua +++ b/lua/lazyvim/util/plugin.lua @@ -12,7 +12,7 @@ M.deprecated_extras = { ["lazyvim.plugins.extras.ui.dashboard"] = "`dashboard.nvim` is now the default **LazyVim** starter.", ["lazyvim.plugins.extras.coding.native_snippets"] = "Native snippets are now the default for **Neovim >= 0.10**", ["lazyvim.plugins.extras.ui.treesitter-rewrite"] = "Disabled `treesitter-rewrite` extra for now. Not ready yet.", - ["lazyvim.plugins.extras.coding.mini-ai"] = "`mini.ai` is now a code LazyVim plugin (again)", + ["lazyvim.plugins.extras.coding.mini-ai"] = "`mini.ai` is now a core LazyVim plugin (again)", } M.deprecated_modules = { From 673975ebbe9870ded302bf3621e249bb4cd5f4f8 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 18 May 2024 23:28:35 +0200 Subject: [PATCH 321/526] feat(cmp): create undo point right before confirming a completion --- lua/lazyvim/plugins/coding.lua | 10 +++++++++- lua/lazyvim/util/init.lua | 8 ++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 4c023141..db83a9f8 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -36,7 +36,15 @@ return { [""] = cmp.mapping.scroll_docs(4), [""] = cmp.mapping.complete(), [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + [""] = function(fallback) + if cmp.visible() then + LazyVim.create_undo() + if cmp.confirm({ select = true }) then + return + end + end + return fallback() + end, [""] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true, diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index bc13b730..3f30f517 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -190,4 +190,12 @@ function M.dedup(list) return ret end +M.CREATE_UNDO = vim.api.nvim_replace_termcodes("u", true, true, true) +function M.create_undo() + if vim.api.nvim_get_mode().mode == "i" then + dd("undo") + vim.api.nvim_feedkeys(M.CREATE_UNDO, "n", false) + end +end + return M From 32cdfa5e2681cd57510bf3c23a75f77d643cafb1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 18 May 2024 23:30:40 +0200 Subject: [PATCH 322/526] chore(main): release 11.3.0 (#3221) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd192b07..d9249d8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [11.3.0](https://github.com/LazyVim/LazyVim/compare/v11.2.0...v11.3.0) (2024-05-18) + + +### Features + +* **cmp:** create undo point right before confirming a completion ([673975e](https://github.com/LazyVim/LazyVim/commit/673975ebbe9870ded302bf3621e249bb4cd5f4f8)) +* **mini.ai:** `mini.ai` is back in core with some improved features. Removing it was a mistake. ([d8644c4](https://github.com/LazyVim/LazyVim/commit/d8644c47158fd28b88f5e3a90af6e5e6a0df2eba)) +* **util:** added Util.is_loaded ([4105c0a](https://github.com/LazyVim/LazyVim/commit/4105c0ad3a441da3a31cc7d8e53305a6117f6ee5)) + + +### Bug Fixes + +* **ibl:** remove ibl fix since it's been fixed upstream ([4614666](https://github.com/LazyVim/LazyVim/commit/4614666d1ee5864e95a08eb5b85808d7834ce85f)) +* **keymaps:** delete lazygit keymap when using gitui ([#2986](https://github.com/LazyVim/LazyVim/issues/2986)) ([649fa9d](https://github.com/LazyVim/LazyVim/commit/649fa9d52188e0c28733402f2f65014fa73308bc)) +* **lsp:** move next/prev reference keymaps to lsp keymaps. See [#3220](https://github.com/LazyVim/LazyVim/issues/3220) ([a4d8352](https://github.com/LazyVim/LazyVim/commit/a4d83524a7179274c17414ebeb0a4e4b8d9a8706)) +* **mini.starter:** changes based on echasnovski's recommendation ([#3223](https://github.com/LazyVim/LazyVim/issues/3223)) ([eb6c9fb](https://github.com/LazyVim/LazyVim/commit/eb6c9fb5784a8001c876203de174cd79e96bb637)) +* **plugin:** typo ([#3225](https://github.com/LazyVim/LazyVim/issues/3225)) ([96aa4b8](https://github.com/LazyVim/LazyVim/commit/96aa4b8877faa2fea30d2d4e2d3d117d9d3851f8)) +* **treesitter:** refactored treesitter code and fixed nvim-treesitter-textobjects ([fe55285](https://github.com/LazyVim/LazyVim/commit/fe552853f5c065df2d79092c0cbac6745f8ea8fc)) + ## [11.2.0](https://github.com/LazyVim/LazyVim/compare/v11.1.2...v11.2.0) (2024-05-18) From 3a4672de3f8b6410de9fbd5b7134d5108d86f46c Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 18 May 2024 23:54:15 +0200 Subject: [PATCH 323/526] fix(util): fixup --- lua/lazyvim/util/init.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index 3f30f517..433efda8 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -193,7 +193,6 @@ end M.CREATE_UNDO = vim.api.nvim_replace_termcodes("u", true, true, true) function M.create_undo() if vim.api.nvim_get_mode().mode == "i" then - dd("undo") vim.api.nvim_feedkeys(M.CREATE_UNDO, "n", false) end end From b0128b60bffd0d6a97ddd99af6179ebcd8a5096f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 18 May 2024 23:55:59 +0200 Subject: [PATCH 324/526] chore(main): release 11.3.1 (#3226) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9249d8a..b0606dd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [11.3.1](https://github.com/LazyVim/LazyVim/compare/v11.3.0...v11.3.1) (2024-05-18) + + +### Bug Fixes + +* **util:** fixup ([3a4672d](https://github.com/LazyVim/LazyVim/commit/3a4672de3f8b6410de9fbd5b7134d5108d86f46c)) + ## [11.3.0](https://github.com/LazyVim/LazyVim/compare/v11.2.0...v11.3.0) (2024-05-18) From 22c4eadef5920e0a77d537727868d4fa87f1c384 Mon Sep 17 00:00:00 2001 From: Aaron Lichtman Date: Sun, 19 May 2024 00:23:37 -0700 Subject: [PATCH 325/526] docs: Clarify vim.g.deprecation_warnings behavior (#3229) The previous wording was a little clunky (disable disabling). This removes the double negative. --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 754615b9..72882791 100644 --- a/NEWS.md +++ b/NEWS.md @@ -14,7 +14,7 @@ - **Languages**: other language extras - new option `vim.g.deprecation_warnings` to disable deprecation warnings - Defaults to `false`. To disable, set it to `true` in your `options.lua` + Defaults to `false`. To enable deprecation warnings, set it to `true` in your `options.lua` - `vim-illuminate` move to extras Document highlights now use native lsp functionality by default From 74b7c9110e501f29fb4cc3fd025935984abadda8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 19 May 2024 07:24:09 +0000 Subject: [PATCH 326/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index b4aa3516..774f7969 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 18 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 19 ============================================================================== Table of Contents *LazyVim-table-of-contents* From e346d17812de516ad0789ede49b49a8b7ba213fe Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 19 May 2024 09:29:15 +0200 Subject: [PATCH 327/526] fix(gitui): properly delete lazygit keymap at the correct time. Fixes #3227 --- lua/lazyvim/plugins/extras/util/gitui.lua | 24 +++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/lua/lazyvim/plugins/extras/util/gitui.lua b/lua/lazyvim/plugins/extras/util/gitui.lua index ad044cd8..d78c4f81 100644 --- a/lua/lazyvim/plugins/extras/util/gitui.lua +++ b/lua/lazyvim/plugins/extras/util/gitui.lua @@ -4,22 +4,34 @@ return { { "williamboman/mason.nvim", keys = { - { "gG", + { + "gG", function() LazyVim.terminal.open({ "gitui" }, { esc_esc = false, ctrl_hjkl = false }) end, - desc = "GitUi (cwd)" }, - { "gg", + desc = "GitUi (cwd)", + }, + { + "gg", function() LazyVim.terminal.open({ "gitui" }, { cwd = LazyVim.root.get(), esc_esc = false, ctrl_hjkl = false }) end, - desc = "GitUi (Root Dir)" } + desc = "GitUi (Root Dir)", + }, }, + init = function() + -- delete lazygit keymap for file history + vim.api.nvim_create_autocmd("User", { + pattern = "LazyVimKeymaps", + once = true, + callback = function() + pcall(vim.keymap.del, "n", "gf") + end, + }) + end, opts = function(_, opts) opts.ensure_installed = opts.ensure_installed or {} vim.list_extend(opts.ensure_installed, { "gitui" }) - -- delete lazygit keymap for file history - vim.keymap.del("n", "gf") end, }, } From 4208a09df8cd20fe491a5fdcc722c12fb07588dc Mon Sep 17 00:00:00 2001 From: Felipe Cury <26260549+flpcury@users.noreply.github.com> Date: Sun, 19 May 2024 16:30:03 +0900 Subject: [PATCH 328/526] fix(git): off-by-one issue in lazygit blame line (#3230) --- lua/lazyvim/util/lazygit.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/lazygit.lua b/lua/lazyvim/util/lazygit.lua index 1b0d3922..a56e98c0 100644 --- a/lua/lazyvim/util/lazygit.lua +++ b/lua/lazyvim/util/lazygit.lua @@ -152,7 +152,7 @@ function M.blame_line(opts) border = "rounded", }, opts or {}) local cursor = vim.api.nvim_win_get_cursor(0) - local line = cursor[1] - 1 + local line = cursor[1] local file = vim.api.nvim_buf_get_name(0) local cmd = { "git", "log", "-n", opts.count, "-u", "-L", line .. ",+1:" .. file } return require("lazy.util").float_cmd(cmd, opts) From ad22adab7d446018875de2dc96168295cad9298e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 19 May 2024 09:58:28 +0200 Subject: [PATCH 329/526] fix(cmp): only complete on `` when cmp is really visible. Dont wait till it might be visible. Faster and more correct imho --- lua/lazyvim/plugins/coding.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index db83a9f8..9a3f674a 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -37,7 +37,7 @@ return { [""] = cmp.mapping.complete(), [""] = cmp.mapping.abort(), [""] = function(fallback) - if cmp.visible() then + if cmp.core.view:visible() or vim.fn.pumvisible() == 1 then LazyVim.create_undo() if cmp.confirm({ select = true }) then return From 93c156a0a54e5400436a950263dd140ca591d3e5 Mon Sep 17 00:00:00 2001 From: dotfrag <17456867+dotfrag@users.noreply.github.com> Date: Sun, 19 May 2024 18:25:00 +0300 Subject: [PATCH 330/526] fix(yanky): load yanky earlier to avoid losing deleted lines (#3234) --- lua/lazyvim/plugins/extras/coding/yanky.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/coding/yanky.lua b/lua/lazyvim/plugins/extras/coding/yanky.lua index b915bc7b..46dca784 100644 --- a/lua/lazyvim/plugins/extras/coding/yanky.lua +++ b/lua/lazyvim/plugins/extras/coding/yanky.lua @@ -3,6 +3,7 @@ return { "gbprod/yanky.nvim", recommended = true, desc = "Better Yank/Paste", + event = "LazyFile", opts = { highlight = { timer = 150 }, }, From 4a41012483e67ffe5ff65f31934ed668325ea131 Mon Sep 17 00:00:00 2001 From: Rubin Bhandari Date: Sun, 19 May 2024 21:30:36 +0545 Subject: [PATCH 331/526] fix: show refactored success msg (#3233) --- lua/lazyvim/plugins/extras/editor/refactoring.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/refactoring.lua b/lua/lazyvim/plugins/extras/editor/refactoring.lua index cf6988a9..ff6351c7 100644 --- a/lua/lazyvim/plugins/extras/editor/refactoring.lua +++ b/lua/lazyvim/plugins/extras/editor/refactoring.lua @@ -112,6 +112,8 @@ return { }, printf_statements = {}, print_var_statements = {}, + show_success_message = true, -- shows a message with information about the refactor on success + -- i.e. [Refactor] Inlined 3 variable occurrences }, config = function(_, opts) require("refactoring").setup(opts) From 573aa226f9f9b9fb9c9886381d3fd06746b7ae6a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 19 May 2024 19:44:34 +0200 Subject: [PATCH 332/526] fix(bufferline): pin bufferline to older version on 0.9.x for now --- lua/lazyvim/plugins/ui.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 0d401f23..c3983dd7 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -56,6 +56,7 @@ return { -- tabs, which include filetype icons and close buttons. { "akinsho/bufferline.nvim", + commit = vim.fn.has("nvim-0.10") == 0 and "73540cb95f8d95aa1af3ed57713c6720c78af915" or nil, event = "VeryLazy", keys = { { "bp", "BufferLineTogglePin", desc = "Toggle Pin" }, From a72baa8295eaff59d7b891bcb30126be0b5659c6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 19 May 2024 19:46:44 +0200 Subject: [PATCH 333/526] chore(main): release 11.3.2 (#3232) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0606dd4..1985df18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [11.3.2](https://github.com/LazyVim/LazyVim/compare/v11.3.1...v11.3.2) (2024-05-19) + + +### Bug Fixes + +* **bufferline:** pin bufferline to older version on 0.9.x for now ([573aa22](https://github.com/LazyVim/LazyVim/commit/573aa226f9f9b9fb9c9886381d3fd06746b7ae6a)) +* **cmp:** only complete on `<cr>` when cmp is really visible. Dont wait till it might be visible. Faster and more correct imho ([ad22ada](https://github.com/LazyVim/LazyVim/commit/ad22adab7d446018875de2dc96168295cad9298e)) +* **git:** off-by-one issue in lazygit blame line ([#3230](https://github.com/LazyVim/LazyVim/issues/3230)) ([4208a09](https://github.com/LazyVim/LazyVim/commit/4208a09df8cd20fe491a5fdcc722c12fb07588dc)) +* **gitui:** properly delete lazygit keymap at the correct time. Fixes [#3227](https://github.com/LazyVim/LazyVim/issues/3227) ([e346d17](https://github.com/LazyVim/LazyVim/commit/e346d17812de516ad0789ede49b49a8b7ba213fe)) +* show refactored success msg ([#3233](https://github.com/LazyVim/LazyVim/issues/3233)) ([4a41012](https://github.com/LazyVim/LazyVim/commit/4a41012483e67ffe5ff65f31934ed668325ea131)) +* **yanky:** load yanky earlier to avoid losing deleted lines ([#3234](https://github.com/LazyVim/LazyVim/issues/3234)) ([93c156a](https://github.com/LazyVim/LazyVim/commit/93c156a0a54e5400436a950263dd140ca591d3e5)) + ## [11.3.1](https://github.com/LazyVim/LazyVim/compare/v11.3.0...v11.3.1) (2024-05-18) From e0c67f6776a5e6f1b72852567ce4fec16598b2da Mon Sep 17 00:00:00 2001 From: Andrea C from The App <3269984+gacallea@users.noreply.github.com> Date: Sun, 19 May 2024 20:47:00 +0200 Subject: [PATCH 334/526] feat(lang): add toml (#3022) Co-authored-by: gacallea --- lua/lazyvim/plugins/extras/lang/toml.lua | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lang/toml.lua diff --git a/lua/lazyvim/plugins/extras/lang/toml.lua b/lua/lazyvim/plugins/extras/lang/toml.lua new file mode 100644 index 00000000..03ec5029 --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/toml.lua @@ -0,0 +1,30 @@ +return { + recommended = function() + return LazyVim.extras.wants({ + ft = "toml", + }) + end, + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + if type(opts.ensure_installed) == "table" then + vim.list_extend(opts.ensure_installed, { "toml" }) + end + end, + }, + { + "williamboman/mason.nvim", + opts = function(_, opts) + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, { "taplo" }) + end, + }, + { + "neovim/nvim-lspconfig", + opts = { + servers = { + taplo = {}, + }, + }, + }, +} From 76033c6aa92e633de968b515d3fd5f9e0447a74f Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 19 May 2024 21:12:51 +0200 Subject: [PATCH 335/526] fix(config): add some extra LazyVim keys to lazy health --- lua/lazyvim/config/init.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index d990f94d..62b14237 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -191,6 +191,13 @@ function M.setup(opts) vim.cmd([[Lazy! load all]]) vim.cmd([[checkhealth]]) end, { desc = "Load all plugins and run :checkhealth" }) + + local health = require("lazy.health") + vim.list_extend(health.valid, { + "recommended", + "desc", + "vscode", + }) end, }) From c264253d8fd4f068c7c2ddb5ea3c63596ab5d23f Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 19 May 2024 21:23:49 +0200 Subject: [PATCH 336/526] feat(toml): also recommend toml when theres toml files in the cwd --- lua/lazyvim/plugins/extras/lang/toml.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/lang/toml.lua b/lua/lazyvim/plugins/extras/lang/toml.lua index 03ec5029..9dcc029d 100644 --- a/lua/lazyvim/plugins/extras/lang/toml.lua +++ b/lua/lazyvim/plugins/extras/lang/toml.lua @@ -2,6 +2,7 @@ return { recommended = function() return LazyVim.extras.wants({ ft = "toml", + root = "*.toml", }) end, { From 57a31c3920bcb9baec9a6d3915506a638b0801b8 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 19 May 2024 21:24:23 +0200 Subject: [PATCH 337/526] fix(cmp): no need to setup native snippets with latest cmp --- lua/lazyvim/plugins/coding.lua | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 9a3f674a..19f5dfff 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -112,11 +112,6 @@ return { { "garymjr/nvim-snippets", opts = { friendly_snippets = true } }, }, opts = function(_, opts) - opts.snippet = { - expand = function(args) - vim.snippet.expand(args.body) - end, - } table.insert(opts.sources, { name = "snippets" }) end, keys = { From 39f3ebcadf49b285d8ae06270ed0c2098e7f03bd Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 19 May 2024 21:46:54 +0200 Subject: [PATCH 338/526] feat(cmp): move cmp autobracket support to util class --- lua/lazyvim/plugins/coding.lua | 15 ++------------- lua/lazyvim/util/cmp.lua | 19 +++++++++++++++++++ lua/lazyvim/util/init.lua | 1 + 3 files changed, 22 insertions(+), 13 deletions(-) create mode 100644 lua/lazyvim/util/cmp.lua diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 19f5dfff..6c349732 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -83,21 +83,10 @@ return { source.group_index = source.group_index or 1 end local cmp = require("cmp") - local Kind = cmp.lsp.CompletionItemKind cmp.setup(opts) cmp.event:on("confirm_done", function(event) - if not vim.tbl_contains(opts.auto_brackets or {}, vim.bo.filetype) then - return - end - local entry = event.entry - local item = entry:get_completion_item() - if vim.tbl_contains({ Kind.Function, Kind.Method }, item.kind) and item.insertTextFormat ~= 2 then - local cursor = vim.api.nvim_win_get_cursor(0) - local prev_char = vim.api.nvim_buf_get_text(0, cursor[1] - 1, cursor[2], cursor[1] - 1, cursor[2] + 1, {})[1] - if prev_char ~= "(" and prev_char ~= ")" then - local keys = vim.api.nvim_replace_termcodes("()", false, false, true) - vim.api.nvim_feedkeys(keys, "i", true) - end + if vim.tbl_contains(opts.auto_brackets or {}, vim.bo.filetype) then + LazyVim.cmp.auto_brackets(event.entry) end end) end, diff --git a/lua/lazyvim/util/cmp.lua b/lua/lazyvim/util/cmp.lua new file mode 100644 index 00000000..a075f0cb --- /dev/null +++ b/lua/lazyvim/util/cmp.lua @@ -0,0 +1,19 @@ +---@class lazyvim.util.cmp +local M = {} + +---@param entry cmp.Entry +function M.auto_brackets(entry) + local cmp = require("cmp") + local Kind = cmp.lsp.CompletionItemKind + local item = entry:get_completion_item() + if vim.tbl_contains({ Kind.Function, Kind.Method }, item.kind) then + local cursor = vim.api.nvim_win_get_cursor(0) + local prev_char = vim.api.nvim_buf_get_text(0, cursor[1] - 1, cursor[2], cursor[1] - 1, cursor[2] + 1, {})[1] + if prev_char ~= "(" and prev_char ~= ")" then + local keys = vim.api.nvim_replace_termcodes("()", false, false, true) + vim.api.nvim_feedkeys(keys, "i", true) + end + end +end + +return M diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index 433efda8..c36ef101 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -17,6 +17,7 @@ local LazyUtil = require("lazy.core.util") ---@field json lazyvim.util.json ---@field lualine lazyvim.util.lualine ---@field mini lazyvim.util.mini +---@field cmp lazyvim.util.cmp local M = {} ---@type table From 24a2a9fb0ba60e0e7c6c8c4ee95a5db7ea0e123e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 19 May 2024 21:47:42 +0200 Subject: [PATCH 339/526] feat(cmp): add missing documentation to snippets when needed --- lua/lazyvim/plugins/coding.lua | 3 +++ lua/lazyvim/util/cmp.lua | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 6c349732..4acd5b3b 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -89,6 +89,9 @@ return { LazyVim.cmp.auto_brackets(event.entry) end end) + cmp.event:on("menu_opened", function(event) + LazyVim.cmp.add_missing_snippet_docs(event.window) + end) end, }, diff --git a/lua/lazyvim/util/cmp.lua b/lua/lazyvim/util/cmp.lua index a075f0cb..037f48e6 100644 --- a/lua/lazyvim/util/cmp.lua +++ b/lua/lazyvim/util/cmp.lua @@ -16,4 +16,24 @@ function M.auto_brackets(entry) end end +-- This function adds missing documentation to snippets. +-- The documentation is a preview of the snippet. +---@param window cmp.CustomEntriesView|cmp.NativeEntriesView +function M.add_missing_snippet_docs(window) + local cmp = require("cmp") + local Kind = cmp.lsp.CompletionItemKind + local entries = window:get_entries() + for _, entry in ipairs(entries) do + if entry:get_kind() == Kind.Snippet then + local item = entry:get_completion_item() + if not item.documentation and item.insertText then + item.documentation = { + kind = cmp.lsp.MarkupKind.Markdown, + value = string.format("```%s\n%s\n```", vim.bo.filetype, item.insertText), + } + end + end + end +end + return M From 2961162ebaef96e4ffbc1e6c97dba0dc32efbbb0 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 19 May 2024 22:46:09 +0200 Subject: [PATCH 340/526] fix(cmp): use better cmp.confirm --- lua/lazyvim/plugins/coding.lua | 15 ++------------- lua/lazyvim/util/cmp.lua | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 4acd5b3b..b754eaf6 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -36,19 +36,8 @@ return { [""] = cmp.mapping.scroll_docs(4), [""] = cmp.mapping.complete(), [""] = cmp.mapping.abort(), - [""] = function(fallback) - if cmp.core.view:visible() or vim.fn.pumvisible() == 1 then - LazyVim.create_undo() - if cmp.confirm({ select = true }) then - return - end - end - return fallback() - end, - [""] = cmp.mapping.confirm({ - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + [""] = LazyVim.cmp.confirm(), + [""] = LazyVim.cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. [""] = function(fallback) cmp.abort() fallback() diff --git a/lua/lazyvim/util/cmp.lua b/lua/lazyvim/util/cmp.lua index 037f48e6..3343245a 100644 --- a/lua/lazyvim/util/cmp.lua +++ b/lua/lazyvim/util/cmp.lua @@ -36,4 +36,25 @@ function M.add_missing_snippet_docs(window) end end +-- This is a better implementation of `cmp.confirm`: +-- * check if the completion menu is visible without waiting for running sources +-- * create an undo point before confirming +-- This function is both faster and more reliable. +---@param opts? {select: boolean, behavior: cmp.ConfirmBehavior} +function M.confirm(opts) + local cmp = require("cmp") + opts = vim.tbl_extend("force", { + select = true, + behavior = cmp.ConfirmBehavior.Insert, + }, opts or {}) + return function(fallback) + if cmp.core.view:visible() or vim.fn.pumvisible() == 1 then + LazyVim.create_undo() + if cmp.confirm(opts) then + return + end + end + return fallback() + end +end return M From 7d72436193b3624a9198a5e57ec1bd7e90260c00 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 19 May 2024 22:47:13 +0200 Subject: [PATCH 341/526] feat(cmp): resolve placeholders in generated missing snippet documentation --- lua/lazyvim/util/cmp.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/util/cmp.lua b/lua/lazyvim/util/cmp.lua index 3343245a..64c43f0a 100644 --- a/lua/lazyvim/util/cmp.lua +++ b/lua/lazyvim/util/cmp.lua @@ -1,6 +1,23 @@ ---@class lazyvim.util.cmp local M = {} +---@param snippet string +---@param fn fun(placeholder:Placeholder):string +---@return string +function M.snippet_replace(snippet, fn) + return snippet:gsub("%$%b{}", function(m) + local n, name = m:match("^%${(%d+):(.+)}$") + return n and fn({ n = n, text = name }) or m + end) or snippet +end + +-- This function resolves nested placeholders in a snippet. +function M.snippet_resolve(snippet) + return M.snippet_replace(snippet, function(placeholder) + return M.snippet_resolve(placeholder.text) + end):gsub("%$0", "") +end + ---@param entry cmp.Entry function M.auto_brackets(entry) local cmp = require("cmp") @@ -29,7 +46,7 @@ function M.add_missing_snippet_docs(window) if not item.documentation and item.insertText then item.documentation = { kind = cmp.lsp.MarkupKind.Markdown, - value = string.format("```%s\n%s\n```", vim.bo.filetype, item.insertText), + value = string.format("```%s\n%s\n```", vim.bo.filetype, M.snippet_resolve(item.insertText)), } end end From 97862f425997bf89f581e6aeceed9aac85d90432 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 19 May 2024 22:48:01 +0200 Subject: [PATCH 342/526] feat(cmp): better error handling and automatic fixing of snippets that fail to parse with native Neovim snippets --- lua/lazyvim/plugins/coding.lua | 5 +++++ lua/lazyvim/util/cmp.lua | 26 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index b754eaf6..589e4b1c 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -93,6 +93,11 @@ return { { "garymjr/nvim-snippets", opts = { friendly_snippets = true } }, }, opts = function(_, opts) + opts.snippet = { + expand = function(item) + return LazyVim.cmp.expand(item.body) + end, + } table.insert(opts.sources, { name = "snippets" }) end, keys = { diff --git a/lua/lazyvim/util/cmp.lua b/lua/lazyvim/util/cmp.lua index 64c43f0a..d0e5b48f 100644 --- a/lua/lazyvim/util/cmp.lua +++ b/lua/lazyvim/util/cmp.lua @@ -18,6 +18,13 @@ function M.snippet_resolve(snippet) end):gsub("%$0", "") end +-- This function replaces nested placeholders in a snippet with LSP placeholders. +function M.snippet_fix(snippet) + return M.snippet_replace(snippet, function(placeholder) + return "${" .. placeholder.n .. ":" .. M.snippet_resolve(placeholder.text) .. "}" + end) +end + ---@param entry cmp.Entry function M.auto_brackets(entry) local cmp = require("cmp") @@ -74,4 +81,23 @@ function M.confirm(opts) return fallback() end end + +function M.expand(snippet) + local ok = pcall(vim.snippet.expand, snippet) + if not ok then + local fixed = M.snippet_fix(snippet) + ok = pcall(vim.snippet.expand, fixed) + + local msg = ok and "Failed to parse snippet,\nbut was able to fix it automatically." or "Failed to parse snippet." + + LazyVim[ok and "warn" or "error"]( + ([[%s +```%s +%s +```]]):format(msg, vim.bo.filetype, snippet), + { title = "vim.snippet" } + ) + end +end + return M From 20e002f9f0e9bfdff1ffc638987fbd46b31e5f9b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 20 May 2024 00:08:05 +0200 Subject: [PATCH 343/526] feat(lsp): properly update certain Neovim functionlity based on dynamic capabilities. See #3244. Fixes #3246 --- lua/lazyvim/plugins/lsp/init.lua | 33 ++++------- lua/lazyvim/util/lsp.lua | 97 ++++++++++++++++++++++++-------- 2 files changed, 85 insertions(+), 45 deletions(-) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 3a6ae964..f99c997c 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -121,16 +121,8 @@ return { require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer) end) - local register_capability = vim.lsp.handlers["client/registerCapability"] - - vim.lsp.handlers["client/registerCapability"] = function(err, res, ctx) - ---@diagnostic disable-next-line: no-unknown - local ret = register_capability(err, res, ctx) - local client = vim.lsp.get_client_by_id(ctx.client_id) - local buffer = vim.api.nvim_get_current_buf() - require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer) - return ret - end + LazyVim.lsp.setup_dynamic_capability() + LazyVim.lsp.on_dynamic_capability(require("lazyvim.plugins.lsp.keymaps").on_attach) LazyVim.lsp.words.setup(opts.document_highlight) @@ -148,24 +140,19 @@ return { if vim.fn.has("nvim-0.10") == 1 then -- inlay hints if opts.inlay_hints.enabled then - LazyVim.lsp.on_attach(function(client, buffer) - if client.supports_method("textDocument/inlayHint") then - LazyVim.toggle.inlay_hints(buffer, true) - end + LazyVim.lsp.on_supports_method("textDocument/inlayHint", function(client, buffer) + LazyVim.toggle.inlay_hints(buffer, true) end) end -- code lens if opts.codelens.enabled and vim.lsp.codelens then - LazyVim.lsp.on_attach(function(client, buffer) - if client.supports_method("textDocument/codeLens") then - vim.lsp.codelens.refresh() - --- autocmd BufEnter,CursorHold,InsertLeave lua vim.lsp.codelens.refresh() - vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave" }, { - buffer = buffer, - callback = vim.lsp.codelens.refresh, - }) - end + LazyVim.lsp.on_supports_method("textDocument/codeLens", function(client, buffer) + vim.lsp.codelens.refresh() + vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave" }, { + buffer = buffer, + callback = vim.lsp.codelens.refresh, + }) end) end end diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index e2eb82de..e7a1c026 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -5,14 +5,14 @@ local M = {} ---@param opts? lsp.Client.filter function M.get_clients(opts) - local ret = {} ---@type lsp.Client[] + local ret = {} ---@type vim.lsp.Client[] if vim.lsp.get_clients then ret = vim.lsp.get_clients(opts) else ---@diagnostic disable-next-line: deprecated ret = vim.lsp.get_active_clients(opts) if opts and opts.method then - ---@param client lsp.Client + ---@param client vim.lsp.Client ret = vim.tbl_filter(function(client) return client.supports_method(opts.method, { bufnr = opts.bufnr }) end, ret) @@ -21,17 +21,66 @@ function M.get_clients(opts) return opts and opts.filter and vim.tbl_filter(opts.filter, ret) or ret end ----@param on_attach fun(client:lsp.Client, buffer) +---@param on_attach fun(client:vim.lsp.Client, buffer) function M.on_attach(on_attach) - vim.api.nvim_create_autocmd("LspAttach", { + return vim.api.nvim_create_autocmd("LspAttach", { callback = function(args) local buffer = args.buf ---@type number local client = vim.lsp.get_client_by_id(args.data.client_id) - on_attach(client, buffer) + if client then + return on_attach(client, buffer) + end end, }) end +M._dynamic_handlers = {} ---@type fun(client:vim.lsp.Client, buffer)[] + +function M.setup_dynamic_capability() + local register_capability = vim.lsp.handlers["client/registerCapability"] + + vim.lsp.handlers["client/registerCapability"] = function(err, res, ctx) + ---@diagnostic disable-next-line: no-unknown + local ret = register_capability(err, res, ctx) + local client = vim.lsp.get_client_by_id(ctx.client_id) + local buffer = vim.api.nvim_get_current_buf() + if client then + M._dynamic_handlers = vim.tbl_filter(function(handler) + return handler(client, buffer) ~= false + end, M._dynamic_handlers) + end + return ret + end +end + +---@param fn fun(client:vim.lsp.Client, buffer) +function M.on_dynamic_capability(fn) + table.insert(M._dynamic_handlers, fn) +end + +---@type table>> +M._on_supports_method = {} + +---@param method string +---@param fn fun(client:vim.lsp.Client, buffer) +function M.on_supports_method(method, fn) + M._on_supports_method[method] = M._on_supports_method[method] or setmetatable({}, { __mode = "k" }) + + ---@param client vim.lsp.Client + local function check(client, buffer) + M._on_supports_method[method][client] = M._on_supports_method[method][client] or {} + if M._on_supports_method[method][client][buffer] then + return + end + if client.supports_method(method, { bufnr = buffer }) then + M._on_supports_method[method][client][buffer] = true + fn(client, buffer) + end + end + M.on_attach(check) + M.on_dynamic_capability(check) +end + ---@param from string ---@param to string function M.on_rename(from, to) @@ -89,12 +138,12 @@ function M.formatter(opts) end, sources = function(buf) local clients = M.get_clients(LazyVim.merge({}, filter, { bufnr = buf })) - ---@param client lsp.Client + ---@param client vim.lsp.Client local ret = vim.tbl_filter(function(client) return client.supports_method("textDocument/formatting") or client.supports_method("textDocument/rangeFormatting") end, clients) - ---@param client lsp.Client + ---@param client vim.lsp.Client return vim.tbl_map(function(client) return client.name end, ret) @@ -143,22 +192,26 @@ function M.words.setup(opts) return handler(err, result, ctx, config) end - M.on_attach(function(client, buf) - if client.supports_method("textDocument/documentHighlight") then - vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI", "CursorMoved", "CursorMovedI" }, { - group = vim.api.nvim_create_augroup("lsp_word_" .. buf, { clear = true }), - buffer = buf, - callback = function(ev) - if not M.words.at() then - if ev.event:find("CursorMoved") then - vim.lsp.buf.clear_references() - else - vim.lsp.buf.document_highlight() - end + M.on_supports_method("textDocument/documentHighlight", function(client, buf) + local group = vim.api.nvim_create_augroup("lsp_word_" .. buf, { clear = true }) + vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI", "CursorMoved", "CursorMovedI" }, { + group = group, + buffer = buf, + callback = function(ev) + if not M.words.at() then + if ev.event:find("CursorMoved") then + vim.lsp.buf.clear_references() + else + vim.lsp.buf.document_highlight() end - end, - }) - end + end + end, + }) + vim.api.nvim_create_autocmd("LspDetach", { + callback = function() + vim.api.nvim_create_augroup("lsp_word_" .. buf, { clear = true }) + end, + }) end) end From 32f000754f8718a8ef1d16e14339bc0a3859d7eb Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 20 May 2024 00:13:18 +0200 Subject: [PATCH 344/526] docs: readme should be unix format. Fixes #3247 --- README-DE.md | 276 +++++++++++++++++++++++++-------------------------- 1 file changed, 138 insertions(+), 138 deletions(-) diff --git a/README-DE.md b/README-DE.md index f5a05985..a9522c84 100644 --- a/README-DE.md +++ b/README-DE.md @@ -1,138 +1,138 @@ -
- -
- -
- -

- Installieren - · - Konfigurieren - · - Dokumentation -

- - - -LazyVim ist ein Neovim-Setup aufgebaut auf [💤 lazy.nvim](https://github.com/folke/lazy.nvim). -Es erleichtert das Anpassen und Erweitern von Ihrer Konfiguration. -Anstatt von vorne anzufangen oder eine vorgefertigte Distro zu verwenden, gibt LazyVim das beste aus -beiden Welten - die Flexibilität Ihre Konfiguration zu verändern und einzustellen wie Sie es wollen -und die Einfachheit von einem vorgefertigten Setup. - -![image](https://user-images.githubusercontent.com/292349/213447056-92290767-ea16-430c-8727-ce994c93e9cc.png) - -![image](https://user-images.githubusercontent.com/292349/211285846-0b7bb3bf-0462-4029-b64c-4ee1d037fc1c.png) - -## ✨ Features - -- 🔥 Transformiere dein Neovim in eine komplette IDE -- 💤 Passe deine Konfiguration einfach an und erweitere diese mit [lazy.nvim](https://github.com/folke/lazy.nvim) -- 🚀 Extrem schnell -- 🧹 Logische Voreinstellungen für optionen, autocmds und keymaps -- 📦 Kommt mit einem Haufen vorkonfigurierter, ready-to-use Plugins - -## ⚡️ Vorraussetzungen - -- Neovim >= **0.8.0** (gebraucht um mit **LuaJIT** zu bauen) -- Git >= **2.19.0** (um Teil-Klone zu unterstützen) -- eine [Nerd Font](https://www.nerdfonts.com/) **_(optional)_** - -## 🚀 Einstieg - -Sie können eine Startvorlage für **LazyVim** [hier](https://github.com/LazyVim/starter) finden - -
Versuchen Sie's mit Docker - -```sh -docker run -w /root -it --rm alpine:edge sh -uelic ' - apk add git lazygit neovim ripgrep alpine-sdk --update - git clone https://github.com/LazyVim/starter ~/.config/nvim - cd ~/.config/nvim - nvim -' -``` - -
- -
Installieren von LazyVim Starter - -- Neovim Files sichern: - - ```sh - mv ~/.config/nvim ~/.config/nvim.bak - mv ~/.local/share/nvim ~/.local/share/nvim.bak - ``` - -- Den Starter Klonen: - - ```sh - git clone https://github.com/LazyVim/starter ~/.config/nvim - ``` - -- Den `.git` Folder löschen, um die Konfiguration zu einer eigenen distro hinzuzufügen: - - ```sh - rm -rf ~/.config/nvim/.git - ``` - -- Neovim starten! - - ```sh - nvim - ``` - - Refer to the comments in the files on how to customize **LazyVim**. - -
- -## 📂 Dateistruktur - -Die Dateien unter `config` werden automatisch und zur richtigen Zeit geladen, -sodass ein manuelles `require` nicht nötig ist. -**LazyVim** bringt Konfigurationsdatein mit, die **_vor_** Ihren eigenen geladen werden - -siehe [hier](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config) -Sie können eigene Plugins unter `lua/plugins/` hinzufügen. Alle Dateien innerhalb -dieses Ordners werden automatisch mit [lazy.nvim](https://github.com/folke/lazy.nvim) -geladen. - -
-~/.config/nvim
-├── lua
-│   ├── config
-│   │   ├── autocmds.lua
-│   │   ├── keymaps.lua
-│   │   ├── lazy.lua
-│   │   └── options.lua
-│   └── plugins
-│       ├── spec1.lua
-│       ├── **
-│       └── spec2.lua
-└── init.toml
-
- -## ⚙️ Konfiguration - -Siehe [Dokumentation](https://lazyvim.github.io). +
+ +
+ +
+ +

+ Installieren + · + Konfigurieren + · + Dokumentation +

+ + + +LazyVim ist ein Neovim-Setup aufgebaut auf [💤 lazy.nvim](https://github.com/folke/lazy.nvim). +Es erleichtert das Anpassen und Erweitern von Ihrer Konfiguration. +Anstatt von vorne anzufangen oder eine vorgefertigte Distro zu verwenden, gibt LazyVim das beste aus +beiden Welten - die Flexibilität Ihre Konfiguration zu verändern und einzustellen wie Sie es wollen +und die Einfachheit von einem vorgefertigten Setup. + +![image](https://user-images.githubusercontent.com/292349/213447056-92290767-ea16-430c-8727-ce994c93e9cc.png) + +![image](https://user-images.githubusercontent.com/292349/211285846-0b7bb3bf-0462-4029-b64c-4ee1d037fc1c.png) + +## ✨ Features + +- 🔥 Transformiere dein Neovim in eine komplette IDE +- 💤 Passe deine Konfiguration einfach an und erweitere diese mit [lazy.nvim](https://github.com/folke/lazy.nvim) +- 🚀 Extrem schnell +- 🧹 Logische Voreinstellungen für optionen, autocmds und keymaps +- 📦 Kommt mit einem Haufen vorkonfigurierter, ready-to-use Plugins + +## ⚡️ Vorraussetzungen + +- Neovim >= **0.8.0** (gebraucht um mit **LuaJIT** zu bauen) +- Git >= **2.19.0** (um Teil-Klone zu unterstützen) +- eine [Nerd Font](https://www.nerdfonts.com/) **_(optional)_** + +## 🚀 Einstieg + +Sie können eine Startvorlage für **LazyVim** [hier](https://github.com/LazyVim/starter) finden + +
Versuchen Sie's mit Docker + +```sh +docker run -w /root -it --rm alpine:edge sh -uelic ' + apk add git lazygit neovim ripgrep alpine-sdk --update + git clone https://github.com/LazyVim/starter ~/.config/nvim + cd ~/.config/nvim + nvim +' +``` + +
+ +
Installieren von LazyVim Starter + +- Neovim Files sichern: + + ```sh + mv ~/.config/nvim ~/.config/nvim.bak + mv ~/.local/share/nvim ~/.local/share/nvim.bak + ``` + +- Den Starter Klonen: + + ```sh + git clone https://github.com/LazyVim/starter ~/.config/nvim + ``` + +- Den `.git` Folder löschen, um die Konfiguration zu einer eigenen distro hinzuzufügen: + + ```sh + rm -rf ~/.config/nvim/.git + ``` + +- Neovim starten! + + ```sh + nvim + ``` + + Refer to the comments in the files on how to customize **LazyVim**. + +
+ +## 📂 Dateistruktur + +Die Dateien unter `config` werden automatisch und zur richtigen Zeit geladen, +sodass ein manuelles `require` nicht nötig ist. +**LazyVim** bringt Konfigurationsdatein mit, die **_vor_** Ihren eigenen geladen werden - +siehe [hier](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config) +Sie können eigene Plugins unter `lua/plugins/` hinzufügen. Alle Dateien innerhalb +dieses Ordners werden automatisch mit [lazy.nvim](https://github.com/folke/lazy.nvim) +geladen. + +
+~/.config/nvim
+├── lua
+│   ├── config
+│   │   ├── autocmds.lua
+│   │   ├── keymaps.lua
+│   │   ├── lazy.lua
+│   │   └── options.lua
+│   └── plugins
+│       ├── spec1.lua
+│       ├── **
+│       └── spec2.lua
+└── init.toml
+
+ +## ⚙️ Konfiguration + +Siehe [Dokumentation](https://lazyvim.github.io). From 69751cf417504cb57fef040703236bd4fd6a9a79 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 20 May 2024 00:35:52 +0200 Subject: [PATCH 345/526] refactor(lsp): refactored on_supports_method --- lua/lazyvim/util/lsp.lua | 48 +++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index e7a1c026..756b1864 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -34,51 +34,53 @@ function M.on_attach(on_attach) }) end -M._dynamic_handlers = {} ---@type fun(client:vim.lsp.Client, buffer)[] - function M.setup_dynamic_capability() local register_capability = vim.lsp.handlers["client/registerCapability"] - vim.lsp.handlers["client/registerCapability"] = function(err, res, ctx) ---@diagnostic disable-next-line: no-unknown local ret = register_capability(err, res, ctx) local client = vim.lsp.get_client_by_id(ctx.client_id) local buffer = vim.api.nvim_get_current_buf() if client then - M._dynamic_handlers = vim.tbl_filter(function(handler) - return handler(client, buffer) ~= false - end, M._dynamic_handlers) + vim.api.nvim_exec_autocmds("User", { + pattern = "LspDynamicCapability", + data = { client_id = client.id, buffer = buffer }, + }) end return ret end end ---@param fn fun(client:vim.lsp.Client, buffer) -function M.on_dynamic_capability(fn) - table.insert(M._dynamic_handlers, fn) +---@param buf? number +function M.on_dynamic_capability(fn, buf) + vim.api.nvim_create_autocmd("User", { + pattern = "LspDynamicCapability", + callback = function(args) + local client = vim.lsp.get_client_by_id(args.data.client_id) + local buffer = args.data.buffer ---@type number + if client and (buf == nil or buf == buffer) then + return fn(client, buffer) + end + end, + }) end ----@type table>> -M._on_supports_method = {} - ---@param method string ---@param fn fun(client:vim.lsp.Client, buffer) function M.on_supports_method(method, fn) - M._on_supports_method[method] = M._on_supports_method[method] or setmetatable({}, { __mode = "k" }) - - ---@param client vim.lsp.Client - local function check(client, buffer) - M._on_supports_method[method][client] = M._on_supports_method[method][client] or {} - if M._on_supports_method[method][client][buffer] then - return - end + M.on_attach(function(client, buffer) if client.supports_method(method, { bufnr = buffer }) then - M._on_supports_method[method][client][buffer] = true fn(client, buffer) + else + M.on_dynamic_capability(function() + if client.supports_method(method, { bufnr = buffer }) then + fn(client, buffer) + return false + end + end, buffer) end - end - M.on_attach(check) - M.on_dynamic_capability(check) + end) end ---@param from string From ac092289f506052cfdd1879f462be05075fe3081 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 20 May 2024 00:53:23 +0200 Subject: [PATCH 346/526] refactor(lsp): prevent autocmd leaks --- lua/lazyvim/util/lsp.lua | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index 756b1864..af04b1c4 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -51,21 +51,24 @@ function M.setup_dynamic_capability() end end ----@param fn fun(client:vim.lsp.Client, buffer) ----@param buf? number -function M.on_dynamic_capability(fn, buf) - vim.api.nvim_create_autocmd("User", { +---@param fn fun(client:vim.lsp.Client, buffer):boolean? +---@param opts? {group?: integer} +function M.on_dynamic_capability(fn, opts) + return vim.api.nvim_create_autocmd("User", { pattern = "LspDynamicCapability", + group = opts and opts.group or nil, callback = function(args) local client = vim.lsp.get_client_by_id(args.data.client_id) local buffer = args.data.buffer ---@type number - if client and (buf == nil or buf == buffer) then + if client then return fn(client, buffer) end end, }) end +M._on_supports_method_id = 0 + ---@param method string ---@param fn fun(client:vim.lsp.Client, buffer) function M.on_supports_method(method, fn) @@ -73,12 +76,22 @@ function M.on_supports_method(method, fn) if client.supports_method(method, { bufnr = buffer }) then fn(client, buffer) else - M.on_dynamic_capability(function() - if client.supports_method(method, { bufnr = buffer }) then + M._on_supports_method_id = M._on_supports_method_id + 1 + local id = M._on_supports_method_id + local group = vim.api.nvim_create_augroup("on_supports_method_" .. id, { clear = true }) + M.on_dynamic_capability(function(c, b) + if c == client and b == buffer and client.supports_method(method, { bufnr = buffer }) then fn(client, buffer) - return false + pcall(vim.api.nvim_del_augroup_by_id, group) end - end, buffer) + end, { group = group }) + vim.api.nvim_create_autocmd({ "LspDetach", "BufDelete" }, { + group = group, + buffer = buffer, + callback = function() + pcall(vim.api.nvim_del_augroup_by_id, group) + end, + }) end end) end From ea1c3ad6b46dfaeca9ff4564499b4cdc8f839610 Mon Sep 17 00:00:00 2001 From: Lawrence Ho <203431+lawrenceho@users.noreply.github.com> Date: Tue, 21 May 2024 01:53:49 +0800 Subject: [PATCH 347/526] fix(bufferline): unpin bufferline with 0.9.x compatibility (#3252) --- lua/lazyvim/plugins/ui.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index c3983dd7..0d401f23 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -56,7 +56,6 @@ return { -- tabs, which include filetype icons and close buttons. { "akinsho/bufferline.nvim", - commit = vim.fn.has("nvim-0.10") == 0 and "73540cb95f8d95aa1af3ed57713c6720c78af915" or nil, event = "VeryLazy", keys = { { "bp", "BufferLineTogglePin", desc = "Toggle Pin" }, From 130d402759be72aab0e8f3fa39de9f38d7acc673 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 20 May 2024 17:54:27 +0000 Subject: [PATCH 348/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 774f7969..9fb3ea57 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 19 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 20 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 5726f3966df7c1e9b350d24aa94f621d0ea484da Mon Sep 17 00:00:00 2001 From: Theo Lemay <16546293+theol0403@users.noreply.github.com> Date: Mon, 20 May 2024 13:56:14 -0400 Subject: [PATCH 349/526] feat(vscode): enable more compatible plugins (#3250) --- lua/lazyvim/plugins/extras/vscode.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lazyvim/plugins/extras/vscode.lua b/lua/lazyvim/plugins/extras/vscode.lua index 6f78fd9f..49172cdb 100644 --- a/lua/lazyvim/plugins/extras/vscode.lua +++ b/lua/lazyvim/plugins/extras/vscode.lua @@ -3,17 +3,20 @@ if not vim.g.vscode then end local enabled = { + "dial.nvim", "flit.nvim", "lazy.nvim", "leap.nvim", "mini.ai", "mini.comment", + "mini.move", "mini.pairs", "mini.surround", "nvim-treesitter", "nvim-treesitter-textobjects", "nvim-ts-context-commentstring", "vim-repeat", + "yanky.nvim", "LazyVim", } From 0006fe7a3c5128daaf0f56887f4c9f4838bfe0c5 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 20 May 2024 20:03:08 +0200 Subject: [PATCH 350/526] refactor(cmp): snippet_resolve => snippet_preview --- lua/lazyvim/util/cmp.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/util/cmp.lua b/lua/lazyvim/util/cmp.lua index d0e5b48f..fd836d4e 100644 --- a/lua/lazyvim/util/cmp.lua +++ b/lua/lazyvim/util/cmp.lua @@ -12,16 +12,19 @@ function M.snippet_replace(snippet, fn) end -- This function resolves nested placeholders in a snippet. -function M.snippet_resolve(snippet) - return M.snippet_replace(snippet, function(placeholder) - return M.snippet_resolve(placeholder.text) +---@param snippet string +---@return string +function M.snippet_preview(snippet) + local ret = M.snippet_replace(snippet, function(placeholder) + return M.snippet_preview(placeholder.text) end):gsub("%$0", "") + return ret end -- This function replaces nested placeholders in a snippet with LSP placeholders. function M.snippet_fix(snippet) return M.snippet_replace(snippet, function(placeholder) - return "${" .. placeholder.n .. ":" .. M.snippet_resolve(placeholder.text) .. "}" + return "${" .. placeholder.n .. ":" .. M.snippet_preview(placeholder.text) .. "}" end) end @@ -53,7 +56,7 @@ function M.add_missing_snippet_docs(window) if not item.documentation and item.insertText then item.documentation = { kind = cmp.lsp.MarkupKind.Markdown, - value = string.format("```%s\n%s\n```", vim.bo.filetype, M.snippet_resolve(item.insertText)), + value = string.format("```%s\n%s\n```", vim.bo.filetype, M.snippet_preview(item.insertText)), } end end From 3db94e44a0881a4f911afbe1c8d82931a4b073f7 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 20 May 2024 20:25:55 +0200 Subject: [PATCH 351/526] refactor(lsp): refactored again :) --- lua/lazyvim/plugins/lsp/init.lua | 2 +- lua/lazyvim/util/lsp.lua | 68 ++++++++++++++++---------------- 2 files changed, 36 insertions(+), 34 deletions(-) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index f99c997c..5cc32494 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -121,7 +121,7 @@ return { require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer) end) - LazyVim.lsp.setup_dynamic_capability() + LazyVim.lsp.setup() LazyVim.lsp.on_dynamic_capability(require("lazyvim.plugins.lsp.keymaps").on_attach) LazyVim.lsp.words.setup(opts.document_highlight) diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index af04b1c4..6479f1df 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -34,7 +34,10 @@ function M.on_attach(on_attach) }) end -function M.setup_dynamic_capability() +---@type table>> +M._supports_method = {} + +function M.setup() local register_capability = vim.lsp.handlers["client/registerCapability"] vim.lsp.handlers["client/registerCapability"] = function(err, res, ctx) ---@diagnostic disable-next-line: no-unknown @@ -49,6 +52,24 @@ function M.setup_dynamic_capability() end return ret end + M.on_attach(M._check_methods) + M.on_dynamic_capability(M._check_methods) +end + +---@param client vim.lsp.Client +function M._check_methods(client, buffer) + for method, clients in pairs(M._supports_method) do + clients[client] = clients[client] or {} + if not clients[client][buffer] then + if client.supports_method(method, { bufnr = buffer }) then + clients[client][buffer] = true + vim.api.nvim_exec_autocmds("User", { + pattern = "LspSupportsMethod", + data = { client_id = client.id, buffer = buffer, method = method }, + }) + end + end + end end ---@param fn fun(client:vim.lsp.Client, buffer):boolean? @@ -67,33 +88,20 @@ function M.on_dynamic_capability(fn, opts) }) end -M._on_supports_method_id = 0 - ---@param method string ---@param fn fun(client:vim.lsp.Client, buffer) function M.on_supports_method(method, fn) - M.on_attach(function(client, buffer) - if client.supports_method(method, { bufnr = buffer }) then - fn(client, buffer) - else - M._on_supports_method_id = M._on_supports_method_id + 1 - local id = M._on_supports_method_id - local group = vim.api.nvim_create_augroup("on_supports_method_" .. id, { clear = true }) - M.on_dynamic_capability(function(c, b) - if c == client and b == buffer and client.supports_method(method, { bufnr = buffer }) then - fn(client, buffer) - pcall(vim.api.nvim_del_augroup_by_id, group) - end - end, { group = group }) - vim.api.nvim_create_autocmd({ "LspDetach", "BufDelete" }, { - group = group, - buffer = buffer, - callback = function() - pcall(vim.api.nvim_del_augroup_by_id, group) - end, - }) - end - end) + M._supports_method[method] = M._supports_method[method] or setmetatable({}, { __mode = "k" }) + return vim.api.nvim_create_autocmd("User", { + pattern = "LspSupportsMethod", + callback = function(args) + local client = vim.lsp.get_client_by_id(args.data.client_id) + local buffer = args.data.buffer ---@type number + if client and method == args.data.method then + return fn(client, buffer) + end + end, + }) end ---@param from string @@ -207,10 +215,9 @@ function M.words.setup(opts) return handler(err, result, ctx, config) end - M.on_supports_method("textDocument/documentHighlight", function(client, buf) - local group = vim.api.nvim_create_augroup("lsp_word_" .. buf, { clear = true }) + M.on_supports_method("textDocument/documentHighlight", function(_, buf) vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI", "CursorMoved", "CursorMovedI" }, { - group = group, + group = vim.api.nvim_create_augroup("lsp_word_" .. buf, { clear = true }), buffer = buf, callback = function(ev) if not M.words.at() then @@ -222,11 +229,6 @@ function M.words.setup(opts) end end, }) - vim.api.nvim_create_autocmd("LspDetach", { - callback = function() - vim.api.nvim_create_augroup("lsp_word_" .. buf, { clear = true }) - end, - }) end) end From e5ea8abd38c4b93edccd69c9ef4462377103a9c3 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 20 May 2024 20:42:10 +0200 Subject: [PATCH 352/526] feat(java): enable inlay hints. Fixes #3244 --- lua/lazyvim/plugins/extras/lang/java.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/java.lua b/lua/lazyvim/plugins/extras/lang/java.lua index 2d99a6cd..53e6a008 100644 --- a/lua/lazyvim/plugins/extras/lang/java.lua +++ b/lua/lazyvim/plugins/extras/lang/java.lua @@ -118,11 +118,18 @@ return { dap = { hotcodereplace = "auto", config_overrides = {} }, dap_main = {}, test = true, + settings = { + java = { + inlayHints = { + parameterNames = { + enabled = "all", + }, + }, + }, + }, } end, - config = function() - local opts = LazyVim.opts("nvim-jdtls") or {} - + config = function(_, opts) -- Find the extra bundles that should be passed on the jdtls command-line -- if nvim-dap is enabled with java debug/test. local mason_registry = require("mason-registry") From 94c9f4cf379e472fbd1a342ef28687dfa418dec0 Mon Sep 17 00:00:00 2001 From: Arthur <82575487+arthur-mountain@users.noreply.github.com> Date: Tue, 21 May 2024 03:24:50 +0800 Subject: [PATCH 353/526] feat(extras.lang): Add kotlin (#2890) * Add kotlin lang * Update the opts.ensure_installed * Add the kotlin setup in nvim-dap * Update plugins based on the review comments. 1. Remove kotlin language server from mason 2. Add optinal is true, only enabled if the user has explicitly enabled the extra plugin. 3. Remove duplicate dependencies cause they are already defined in the plugin. 4. Add none-ls as optional * Update comment message --- lua/lazyvim/plugins/extras/lang/kotlin.lua | 104 +++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lang/kotlin.lua diff --git a/lua/lazyvim/plugins/extras/lang/kotlin.lua b/lua/lazyvim/plugins/extras/lang/kotlin.lua new file mode 100644 index 00000000..0393697d --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/kotlin.lua @@ -0,0 +1,104 @@ +return { + -- Add packages(linting, debug adapter) + { + "williamboman/mason.nvim", + opts = function(_, opts) + vim.list_extend(opts.ensure_installed or {}, { "ktlint", "kotlin-debug-adapter" }) + end, + }, + -- Add syntax highlighting + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + vim.list_extend(opts.ensure_installed or {}, { "kotlin" }) + end, + }, + -- Add language server + { + "neovim/nvim-lspconfig", + opts = { + servers = { + kotlin_language_server = {}, + }, + }, + }, + -- Add linting as optional + { + "mfussenegger/nvim-lint", + optional = true, + dependencies = "williamboman/mason.nvim", + opts = { + linters_by_ft = { kotlin = { "ktlint" } }, + }, + }, + -- Add formatting as optional + { + "stevearc/conform.nvim", + optional = true, + opts = { + formatters_by_ft = { kotlin = { "ktlint" } }, + }, + }, + -- Add formatting and linting as optional + { + "nvimtools/none-ls.nvim", + optional = true, + opts = function(_, opts) + local nls = require("null-ls") + opts.sources = vim.list_extend(opts.sources or {}, { + nls.builtins.formatting.ktlint, + nls.builtins.diagnostics.ktlint, + }) + end, + }, + -- Add debugger + { + "mfussenegger/nvim-dap", + optional = true, + dependencies = "williamboman/mason.nvim", + opts = function() + local dap = require("dap") + if not dap.adapters.kotlin then + require("dap").adapters.kotlin = { + type = "executable", + command = "kotlin-debug-adapter", + options = { auto_continue_if_many_stopped = false }, + } + end + + dap.configurations.kotlin = { + { + type = "kotlin", + request = "launch", + name = "This file", + -- may differ, when in doubt, whatever your project structure may be, + -- it has to correspond to the class file located at `build/classes/` + -- and of course you have to build before you debug + mainClass = function() + local root = vim.fs.find("src", { path = vim.uv.cwd(), upward = true, stop = vim.env.HOME })[1] or "" + local fname = vim.api.nvim_buf_get_name(0) + -- src/main/kotlin/websearch/Main.kt -> websearch.MainKt + return fname:gsub(root, ""):gsub("main/kotlin/", ""):gsub(".kt", "Kt"):gsub("/", "."):sub(2, -1) + end, + projectRoot = "${workspaceFolder}", + jsonLogFile = "", + enableJsonLogging = false, + }, + { + -- Use this for unit tests + -- First, run + -- ./gradlew --info cleanTest test --debug-jvm + -- then attach the debugger to it + type = "kotlin", + request = "attach", + name = "Attach to debugging session", + port = 5005, + args = {}, + projectRoot = vim.fn.getcwd, + hostName = "localhost", + timeout = 2000, + }, + } + end, + }, +} From dd417c36cd14b5b347b4f82e9e7683b085c768fb Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 20 May 2024 21:25:29 +0200 Subject: [PATCH 354/526] feat(kotlin): added recommended checks --- lua/lazyvim/plugins/extras/lang/kotlin.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/kotlin.lua b/lua/lazyvim/plugins/extras/lang/kotlin.lua index 0393697d..1db56545 100644 --- a/lua/lazyvim/plugins/extras/lang/kotlin.lua +++ b/lua/lazyvim/plugins/extras/lang/kotlin.lua @@ -1,4 +1,17 @@ return { + recommended = function() + return LazyVim.extras.wants({ + ft = "kotlin", + root = { + "settings.gradle", -- Gradle (multi-project) + "settings.gradle.kts", -- Gradle (multi-project) + "build.xml", -- Ant + "pom.xml", -- Maven + "build.gradle", -- Gradle + "build.gradle.kts", -- Gradle + }, + }) + end, -- Add packages(linting, debug adapter) { "williamboman/mason.nvim", From 50626e30925909450bbfe934d1a50e1d34d007c7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 21:26:18 +0200 Subject: [PATCH 355/526] chore(main): release 11.4.0 (#3243) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1985df18..a8c9cc0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,30 @@ # Changelog +## [11.4.0](https://github.com/LazyVim/LazyVim/compare/v11.3.2...v11.4.0) (2024-05-20) + + +### Features + +* **cmp:** add missing documentation to snippets when needed ([24a2a9f](https://github.com/LazyVim/LazyVim/commit/24a2a9fb0ba60e0e7c6c8c4ee95a5db7ea0e123e)) +* **cmp:** better error handling and automatic fixing of snippets that fail to parse with native Neovim snippets ([97862f4](https://github.com/LazyVim/LazyVim/commit/97862f425997bf89f581e6aeceed9aac85d90432)) +* **cmp:** move cmp autobracket support to util class ([39f3ebc](https://github.com/LazyVim/LazyVim/commit/39f3ebcadf49b285d8ae06270ed0c2098e7f03bd)) +* **cmp:** resolve placeholders in generated missing snippet documentation ([7d72436](https://github.com/LazyVim/LazyVim/commit/7d72436193b3624a9198a5e57ec1bd7e90260c00)) +* **extras.lang:** Add kotlin ([#2890](https://github.com/LazyVim/LazyVim/issues/2890)) ([94c9f4c](https://github.com/LazyVim/LazyVim/commit/94c9f4cf379e472fbd1a342ef28687dfa418dec0)) +* **java:** enable inlay hints. Fixes [#3244](https://github.com/LazyVim/LazyVim/issues/3244) ([e5ea8ab](https://github.com/LazyVim/LazyVim/commit/e5ea8abd38c4b93edccd69c9ef4462377103a9c3)) +* **kotlin:** added recommended checks ([dd417c3](https://github.com/LazyVim/LazyVim/commit/dd417c36cd14b5b347b4f82e9e7683b085c768fb)) +* **lang:** add toml ([#3022](https://github.com/LazyVim/LazyVim/issues/3022)) ([e0c67f6](https://github.com/LazyVim/LazyVim/commit/e0c67f6776a5e6f1b72852567ce4fec16598b2da)) +* **lsp:** properly update certain Neovim functionlity based on dynamic capabilities. See [#3244](https://github.com/LazyVim/LazyVim/issues/3244). Fixes [#3246](https://github.com/LazyVim/LazyVim/issues/3246) ([20e002f](https://github.com/LazyVim/LazyVim/commit/20e002f9f0e9bfdff1ffc638987fbd46b31e5f9b)) +* **toml:** also recommend toml when theres toml files in the cwd ([c264253](https://github.com/LazyVim/LazyVim/commit/c264253d8fd4f068c7c2ddb5ea3c63596ab5d23f)) +* **vscode:** enable more compatible plugins ([#3250](https://github.com/LazyVim/LazyVim/issues/3250)) ([5726f39](https://github.com/LazyVim/LazyVim/commit/5726f3966df7c1e9b350d24aa94f621d0ea484da)) + + +### Bug Fixes + +* **bufferline:** unpin bufferline with 0.9.x compatibility ([#3252](https://github.com/LazyVim/LazyVim/issues/3252)) ([ea1c3ad](https://github.com/LazyVim/LazyVim/commit/ea1c3ad6b46dfaeca9ff4564499b4cdc8f839610)) +* **cmp:** no need to setup native snippets with latest cmp ([57a31c3](https://github.com/LazyVim/LazyVim/commit/57a31c3920bcb9baec9a6d3915506a638b0801b8)) +* **cmp:** use better cmp.confirm ([2961162](https://github.com/LazyVim/LazyVim/commit/2961162ebaef96e4ffbc1e6c97dba0dc32efbbb0)) +* **config:** add some extra LazyVim keys to lazy health ([76033c6](https://github.com/LazyVim/LazyVim/commit/76033c6aa92e633de968b515d3fd5f9e0447a74f)) + ## [11.3.2](https://github.com/LazyVim/LazyVim/compare/v11.3.1...v11.3.2) (2024-05-19) From 8e67bb124009e0dbf29f8e78d701d07756670278 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 20 May 2024 22:39:34 +0200 Subject: [PATCH 356/526] fix(java): properly pass settings to jdtls --- lua/lazyvim/plugins/extras/lang/java.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/lang/java.lua b/lua/lazyvim/plugins/extras/lang/java.lua index 53e6a008..a1b49716 100644 --- a/lua/lazyvim/plugins/extras/lang/java.lua +++ b/lua/lazyvim/plugins/extras/lang/java.lua @@ -165,6 +165,7 @@ return { init_options = { bundles = bundles, }, + settings = opts.settings, -- enable CMP capabilities capabilities = LazyVim.has("cmp-nvim-lsp") and require("cmp_nvim_lsp").default_capabilities() or nil, }, opts.jdtls) From 6aae99e76df387507dadcaaa93af97191aace714 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 21 May 2024 12:00:59 +0200 Subject: [PATCH 357/526] chore(main): release 11.4.1 (#3256) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8c9cc0a..06b99bc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [11.4.1](https://github.com/LazyVim/LazyVim/compare/v11.4.0...v11.4.1) (2024-05-20) + + +### Bug Fixes + +* **java:** properly pass settings to jdtls ([8e67bb1](https://github.com/LazyVim/LazyVim/commit/8e67bb124009e0dbf29f8e78d701d07756670278)) + ## [11.4.0](https://github.com/LazyVim/LazyVim/compare/v11.3.2...v11.4.0) (2024-05-20) From d19a0041362f0a862b1bef995844ca07bbae6caf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 21 May 2024 10:01:38 +0000 Subject: [PATCH 358/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 9fb3ea57..9733cc94 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 20 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 21 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 8c94842b4a613995bf4c0c79febcd74c310439d0 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 21 May 2024 18:23:04 +0200 Subject: [PATCH 359/526] fix(lsp): sometimes lsp client is not fully initialized and doesnt yet have client.supports_method on 0.9.5. Fixes #3263 --- lua/lazyvim/util/lsp.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index 6479f1df..e14a5e13 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -61,7 +61,7 @@ function M._check_methods(client, buffer) for method, clients in pairs(M._supports_method) do clients[client] = clients[client] or {} if not clients[client][buffer] then - if client.supports_method(method, { bufnr = buffer }) then + if client.supports_method and client.supports_method(method, { bufnr = buffer }) then clients[client][buffer] = true vim.api.nvim_exec_autocmds("User", { pattern = "LspSupportsMethod", From 55b07dee21ee5306624e16dd90c2b3c9c0f3ddde Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 21 May 2024 19:22:41 +0200 Subject: [PATCH 360/526] fix(nvim-snippets): enable global friendly-snippets. See #3240 --- lua/lazyvim/plugins/coding.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 589e4b1c..9e623296 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -90,7 +90,13 @@ return { "nvim-cmp", dependencies = { { "rafamadriz/friendly-snippets" }, - { "garymjr/nvim-snippets", opts = { friendly_snippets = true } }, + { + "garymjr/nvim-snippets", + opts = { + friendly_snippets = true, + global_snippets = { "all", "global" }, + }, + }, }, opts = function(_, opts) opts.snippet = { From 8ba7c64a7da9e46f2ac601919508803824208935 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 21 May 2024 19:31:40 +0200 Subject: [PATCH 361/526] feat(comments): use ts-comments.nvim instead of nvim-ts-context-commentstring on Neovim 0.10 --- lua/lazyvim/plugins/coding.lua | 20 ++++--------------- .../plugins/extras/coding/mini-comment.lua | 7 +++++++ 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 9e623296..c6150347 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -156,22 +156,10 @@ return { -- comments { - "JoosepAlviste/nvim-ts-context-commentstring", - lazy = true, - opts = { - enable_autocmd = false, - }, - init = function() - if vim.fn.has("nvim-0.10") == 1 then - vim.schedule(function() - local get_option = vim.filetype.get_option - vim.filetype.get_option = function(filetype, option) - return option == "commentstring" and require("ts_context_commentstring.internal").calculate_commentstring() - or get_option(filetype, option) - end - end) - end - end, + "folke/ts-comments.nvim", + event = "VeryLazy", + opts = {}, + enabled = vim.fn.has("nvim-0.10") == 1, }, { import = "lazyvim.plugins.extras.coding.mini-comment", diff --git a/lua/lazyvim/plugins/extras/coding/mini-comment.lua b/lua/lazyvim/plugins/extras/coding/mini-comment.lua index d401c9de..457787ef 100644 --- a/lua/lazyvim/plugins/extras/coding/mini-comment.lua +++ b/lua/lazyvim/plugins/extras/coding/mini-comment.lua @@ -10,4 +10,11 @@ return { }, }, }, + { + "JoosepAlviste/nvim-ts-context-commentstring", + lazy = true, + opts = { + enable_autocmd = false, + }, + }, } From 2bae438570aa96904836e56d8dad7f33eb3204ee Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 21 May 2024 19:51:13 +0200 Subject: [PATCH 362/526] fix(cmp): fix cmp's broken snippet parsing functionality. Fixes #3266 --- lua/lazyvim/plugins/coding.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index c6150347..231b8f2b 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -71,6 +71,16 @@ return { for _, source in ipairs(opts.sources) do source.group_index = source.group_index or 1 end + + local parse = require("cmp.utils.snippet").parse + require("cmp.utils.snippet").parse = function(input) + local ok, ret = pcall(parse, input) + if ok then + return ret + end + return LazyVim.cmp.snippet_preview(input) + end + local cmp = require("cmp") cmp.setup(opts) cmp.event:on("confirm_done", function(event) From d73397c4aaac74d95970ac06caffa25abd7c2af4 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 21 May 2024 19:54:20 +0200 Subject: [PATCH 363/526] fix(snippets): make friendly snippets a dep of nvim-snippets --- lua/lazyvim/plugins/coding.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 231b8f2b..659a28ab 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -99,13 +99,13 @@ return { and { "nvim-cmp", dependencies = { - { "rafamadriz/friendly-snippets" }, { "garymjr/nvim-snippets", opts = { friendly_snippets = true, global_snippets = { "all", "global" }, }, + dependencies = { "rafamadriz/friendly-snippets" }, }, }, opts = function(_, opts) From cb1e1b9c82b405fa277f1869cd04dcd9c4507412 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 21 May 2024 20:18:20 +0200 Subject: [PATCH 364/526] fix(snippets): fixes custom snippets. use my branch till nvim-snippets PR is merged. Fixes #3240 --- lua/lazyvim/plugins/coding.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 659a28ab..1634f551 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -101,6 +101,9 @@ return { dependencies = { { "garymjr/nvim-snippets", + -- Use my branch till PR is merged. + -- https://github.com/garymjr/nvim-snippets/pull/10 + url = "https://github.com/folke/nvim-snippets", opts = { friendly_snippets = true, global_snippets = { "all", "global" }, From 027d6bc2e896d453153f48a8c15db2a627698dc8 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 21 May 2024 20:26:30 +0200 Subject: [PATCH 365/526] fix(snippets): my nvim-snippets PR is merged, so remove work-around. That was quick :) --- lua/lazyvim/plugins/coding.lua | 3 --- 1 file changed, 3 deletions(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 1634f551..659a28ab 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -101,9 +101,6 @@ return { dependencies = { { "garymjr/nvim-snippets", - -- Use my branch till PR is merged. - -- https://github.com/garymjr/nvim-snippets/pull/10 - url = "https://github.com/folke/nvim-snippets", opts = { friendly_snippets = true, global_snippets = { "all", "global" }, From ab4e57a4bfe6107c21a25450292ef69537a2b37b Mon Sep 17 00:00:00 2001 From: Kevin Traver Date: Tue, 21 May 2024 12:34:28 -0600 Subject: [PATCH 366/526] feat(telescope): add quickfix and telescope keymaps (#3077) --- lua/lazyvim/plugins/editor.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index b09d4f02..1ae0b76f 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -198,10 +198,12 @@ return { { "sh", "Telescope help_tags", desc = "Help Pages" }, { "sH", "Telescope highlights", desc = "Search Highlight Groups" }, { "sk", "Telescope keymaps", desc = "Key Maps" }, + { "sl", "Telescope loclist", desc = "Location List" }, { "sM", "Telescope man_pages", desc = "Man Pages" }, { "sm", "Telescope marks", desc = "Jump to Mark" }, { "so", "Telescope vim_options", desc = "Options" }, { "sR", "Telescope resume", desc = "Resume" }, + { "sq", "Telescope quickfix", desc = "Quickfix List" }, { "sw", LazyVim.telescope("grep_string", { word_match = "-w" }), desc = "Word (Root Dir)" }, { "sW", LazyVim.telescope("grep_string", { cwd = false, word_match = "-w" }), desc = "Word (cwd)" }, { "sw", LazyVim.telescope("grep_string"), mode = "v", desc = "Selection (Root Dir)" }, From e46dd4e9b2ac68a5058447ef73b413605d15ae62 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 21 May 2024 22:06:52 +0200 Subject: [PATCH 367/526] fix(neo-tree): better icons for git staged/unstaged --- lua/lazyvim/plugins/editor.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 1ae0b76f..a834c074 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -96,6 +96,12 @@ return { expander_expanded = "", expander_highlight = "NeoTreeExpander", }, + git_status = { + symbols = { + unstaged = "󰄱", + staged = "󰱒", + }, + }, }, }, config = function(_, opts) From 3ebe30685d8b5c6e3c0723b532c73b64771f1ec7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 21 May 2024 22:28:15 +0200 Subject: [PATCH 368/526] chore(main): release 11.5.0 (#3265) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06b99bc6..4e3b1fb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [11.5.0](https://github.com/LazyVim/LazyVim/compare/v11.4.1...v11.5.0) (2024-05-21) + + +### Features + +* **comments:** use ts-comments.nvim instead of nvim-ts-context-commentstring on Neovim 0.10 ([8ba7c64](https://github.com/LazyVim/LazyVim/commit/8ba7c64a7da9e46f2ac601919508803824208935)) +* **telescope:** add quickfix and telescope keymaps ([#3077](https://github.com/LazyVim/LazyVim/issues/3077)) ([ab4e57a](https://github.com/LazyVim/LazyVim/commit/ab4e57a4bfe6107c21a25450292ef69537a2b37b)) + + +### Bug Fixes + +* **cmp:** fix cmp's broken snippet parsing functionality. Fixes [#3266](https://github.com/LazyVim/LazyVim/issues/3266) ([2bae438](https://github.com/LazyVim/LazyVim/commit/2bae438570aa96904836e56d8dad7f33eb3204ee)) +* **lsp:** sometimes lsp client is not fully initialized and doesnt yet have client.supports_method on 0.9.5. Fixes [#3263](https://github.com/LazyVim/LazyVim/issues/3263) ([8c94842](https://github.com/LazyVim/LazyVim/commit/8c94842b4a613995bf4c0c79febcd74c310439d0)) +* **neo-tree:** better icons for git staged/unstaged ([e46dd4e](https://github.com/LazyVim/LazyVim/commit/e46dd4e9b2ac68a5058447ef73b413605d15ae62)) +* **nvim-snippets:** enable global friendly-snippets. See [#3240](https://github.com/LazyVim/LazyVim/issues/3240) ([55b07de](https://github.com/LazyVim/LazyVim/commit/55b07dee21ee5306624e16dd90c2b3c9c0f3ddde)) +* **snippets:** fixes custom snippets. use my branch till nvim-snippets PR is merged. Fixes [#3240](https://github.com/LazyVim/LazyVim/issues/3240) ([cb1e1b9](https://github.com/LazyVim/LazyVim/commit/cb1e1b9c82b405fa277f1869cd04dcd9c4507412)) +* **snippets:** make friendly snippets a dep of nvim-snippets ([d73397c](https://github.com/LazyVim/LazyVim/commit/d73397c4aaac74d95970ac06caffa25abd7c2af4)) +* **snippets:** my nvim-snippets PR is merged, so remove work-around. That was quick :) ([027d6bc](https://github.com/LazyVim/LazyVim/commit/027d6bc2e896d453153f48a8c15db2a627698dc8)) + ## [11.4.1](https://github.com/LazyVim/LazyVim/compare/v11.4.0...v11.4.1) (2024-05-20) From 79608fbc4fe7d5fbd2d238e8d8ebfce7d576b7c2 Mon Sep 17 00:00:00 2001 From: Kevin Traver Date: Tue, 21 May 2024 14:56:15 -0600 Subject: [PATCH 369/526] feat(telescope): add telescope jumplist keymap (#3268) --- lua/lazyvim/plugins/editor.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index a834c074..3c98ba8e 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -203,6 +203,7 @@ return { { "sG", LazyVim.telescope("live_grep", { cwd = false }), desc = "Grep (cwd)" }, { "sh", "Telescope help_tags", desc = "Help Pages" }, { "sH", "Telescope highlights", desc = "Search Highlight Groups" }, + { "sj", "Telescope jumplist", desc = "Jumplist" }, { "sk", "Telescope keymaps", desc = "Key Maps" }, { "sl", "Telescope loclist", desc = "Location List" }, { "sM", "Telescope man_pages", desc = "Man Pages" }, From 9eec03d890f7846e6f47e12ebbe369c7177fd5f1 Mon Sep 17 00:00:00 2001 From: Peter Benjamin Date: Tue, 21 May 2024 14:03:43 -0700 Subject: [PATCH 370/526] feat(markdown): configure conform for markdown files (#2308) --- lua/lazyvim/plugins/extras/lang/markdown.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/markdown.lua b/lua/lazyvim/plugins/extras/lang/markdown.lua index e290f174..dcffbad0 100644 --- a/lua/lazyvim/plugins/extras/lang/markdown.lua +++ b/lua/lazyvim/plugins/extras/lang/markdown.lua @@ -5,6 +5,15 @@ return { root = "README.md", }) end, + { + "stevearc/conform.nvim", + optional = true, + opts = { + formatters_by_ft = { + markdown = { { "prettierd", "prettier" }, "markdownlint", "markdown-toc" }, + }, + }, + }, { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) From ae6d8f1a34fff49f9f1abf9fdd8a559c95b85cf3 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 21 May 2024 23:05:29 +0200 Subject: [PATCH 371/526] feat(markdown): add formatter for mdx --- lua/lazyvim/plugins/extras/lang/markdown.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/markdown.lua b/lua/lazyvim/plugins/extras/lang/markdown.lua index dcffbad0..81f4cc88 100644 --- a/lua/lazyvim/plugins/extras/lang/markdown.lua +++ b/lua/lazyvim/plugins/extras/lang/markdown.lua @@ -10,7 +10,8 @@ return { optional = true, opts = { formatters_by_ft = { - markdown = { { "prettierd", "prettier" }, "markdownlint", "markdown-toc" }, + ["markdown"] = { { "prettierd", "prettier" }, "markdownlint", "markdown-toc" }, + ["markdown.mdx"] = { { "prettierd", "prettier" }, "markdownlint", "markdown-toc" }, }, }, }, From 1eea51606e1ec1035c440a4ca9b3eab053337a7d Mon Sep 17 00:00:00 2001 From: Rubin Bhandari Date: Wed, 22 May 2024 23:21:33 +0545 Subject: [PATCH 372/526] fix: set markdown for LICENSE file (#3276) --- lua/lazyvim/plugins/extras/util/dot.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/util/dot.lua b/lua/lazyvim/plugins/extras/util/dot.lua index ad4e2278..92dcdb0e 100644 --- a/lua/lazyvim/plugins/extras/util/dot.lua +++ b/lua/lazyvim/plugins/extras/util/dot.lua @@ -36,6 +36,7 @@ return { extension = { rasi = "rasi", rofi = "rasi", wofi = "rasi" }, filename = { ["vifmrc"] = "vim", + ["LICENSE"] = "markdown", }, pattern = { [".*/waybar/config"] = "jsonc", From 31f876cc4c1c174da6ef5107c77004e296b50f82 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 22 May 2024 17:37:04 +0000 Subject: [PATCH 373/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 9733cc94..509c2002 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 21 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 22 ============================================================================== Table of Contents *LazyVim-table-of-contents* From ad6c9bcfab1305cd29e2f273a37b6aeb85d79486 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 22 May 2024 19:37:13 +0200 Subject: [PATCH 374/526] Revert "fix: set markdown for LICENSE file (#3276)" This reverts commit 1eea51606e1ec1035c440a4ca9b3eab053337a7d. --- lua/lazyvim/plugins/extras/util/dot.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/util/dot.lua b/lua/lazyvim/plugins/extras/util/dot.lua index 92dcdb0e..ad4e2278 100644 --- a/lua/lazyvim/plugins/extras/util/dot.lua +++ b/lua/lazyvim/plugins/extras/util/dot.lua @@ -36,7 +36,6 @@ return { extension = { rasi = "rasi", rofi = "rasi", wofi = "rasi" }, filename = { ["vifmrc"] = "vim", - ["LICENSE"] = "markdown", }, pattern = { [".*/waybar/config"] = "jsonc", From f9b31372aef9f1f862bf24879ba388f0d89c2349 Mon Sep 17 00:00:00 2001 From: Caidan Williams <9907093+caidanw@users.noreply.github.com> Date: Wed, 22 May 2024 10:39:16 -0700 Subject: [PATCH 375/526] fix(python): extras.lang.python to enable venv select keys on ft (#3280) --- lua/lazyvim/plugins/extras/lang/python.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index f1e70548..ac59a543 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -127,7 +127,7 @@ return { }, }) end, - keys = { { "cv", ":VenvSelect", desc = "Select VirtualEnv" } }, + keys = { { "cv", ":VenvSelect", desc = "Select VirtualEnv", ft = "python" } }, }, { "hrsh7th/nvim-cmp", From 46cf5347b5649e856a69b9f52ccad8a671ddefc6 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 23 May 2024 07:13:41 +0200 Subject: [PATCH 376/526] fix(lsp): only enableinlay hints for when buffer is an actual file. See #3284 --- lua/lazyvim/plugins/lsp/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 5cc32494..a2b76326 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -141,7 +141,9 @@ return { -- inlay hints if opts.inlay_hints.enabled then LazyVim.lsp.on_supports_method("textDocument/inlayHint", function(client, buffer) - LazyVim.toggle.inlay_hints(buffer, true) + if vim.api.nvim_buf_is_valid(buffer) and vim.bo[buffer].buftype == "" then + LazyVim.toggle.inlay_hints(buffer, true) + end end) end From 692aa08da73543805c60d0d88f68c5fec566c03f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 23 May 2024 05:14:55 +0000 Subject: [PATCH 377/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 509c2002..102f15d5 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 22 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 23 ============================================================================== Table of Contents *LazyVim-table-of-contents* From c6e8c5b45011210042e0791bd52baff8784ed26a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 23 May 2024 07:15:41 +0200 Subject: [PATCH 378/526] chore(main): release 11.6.0 (#3269) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e3b1fb9..b2562006 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [11.6.0](https://github.com/LazyVim/LazyVim/compare/v11.5.0...v11.6.0) (2024-05-23) + + +### Features + +* **markdown:** add formatter for mdx ([ae6d8f1](https://github.com/LazyVim/LazyVim/commit/ae6d8f1a34fff49f9f1abf9fdd8a559c95b85cf3)) +* **markdown:** configure conform for markdown files ([#2308](https://github.com/LazyVim/LazyVim/issues/2308)) ([9eec03d](https://github.com/LazyVim/LazyVim/commit/9eec03d890f7846e6f47e12ebbe369c7177fd5f1)) +* **telescope:** add telescope jumplist keymap ([#3268](https://github.com/LazyVim/LazyVim/issues/3268)) ([79608fb](https://github.com/LazyVim/LazyVim/commit/79608fbc4fe7d5fbd2d238e8d8ebfce7d576b7c2)) + + +### Bug Fixes + +* **lsp:** only enableinlay hints for when buffer is an actual file. See [#3284](https://github.com/LazyVim/LazyVim/issues/3284) ([46cf534](https://github.com/LazyVim/LazyVim/commit/46cf5347b5649e856a69b9f52ccad8a671ddefc6)) +* **python:** extras.lang.python to enable venv select keys on ft ([#3280](https://github.com/LazyVim/LazyVim/issues/3280)) ([f9b3137](https://github.com/LazyVim/LazyVim/commit/f9b31372aef9f1f862bf24879ba388f0d89c2349)) +* set markdown for LICENSE file ([#3276](https://github.com/LazyVim/LazyVim/issues/3276)) ([1eea516](https://github.com/LazyVim/LazyVim/commit/1eea51606e1ec1035c440a4ca9b3eab053337a7d)) + ## [11.5.0](https://github.com/LazyVim/LazyVim/compare/v11.4.1...v11.5.0) (2024-05-21) From 10ed3082a415b525628dfaebdcd007c7e96a5b87 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 23 May 2024 17:39:20 +0200 Subject: [PATCH 379/526] fix(lsp): use proper buffer for dynamic capabilities. Fixes #3246 --- lua/lazyvim/util/lsp.lua | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index e14a5e13..1ccc7544 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -43,12 +43,13 @@ function M.setup() ---@diagnostic disable-next-line: no-unknown local ret = register_capability(err, res, ctx) local client = vim.lsp.get_client_by_id(ctx.client_id) - local buffer = vim.api.nvim_get_current_buf() if client then - vim.api.nvim_exec_autocmds("User", { - pattern = "LspDynamicCapability", - data = { client_id = client.id, buffer = buffer }, - }) + for buffer in ipairs(client.attached_buffers) do + vim.api.nvim_exec_autocmds("User", { + pattern = "LspDynamicCapability", + data = { client_id = client.id, buffer = buffer }, + }) + end end return ret end @@ -58,6 +59,18 @@ end ---@param client vim.lsp.Client function M._check_methods(client, buffer) + -- don't trigger on invalid buffers + if not vim.api.nvim_buf_is_valid(buffer) then + return + end + -- don't trigger on non-listed buffers + if not vim.bo[buffer].buflisted then + return + end + -- don't trigger on nofile buffers + if vim.bo[buffer].buftype == "nofile" then + return + end for method, clients in pairs(M._supports_method) do clients[client] = clients[client] or {} if not clients[client][buffer] then From 0f6ff53ce336082869314db11e9dfa487cf83292 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 23 May 2024 17:41:03 +0200 Subject: [PATCH 380/526] chore(main): release 11.6.1 (#3292) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2562006..e0b1c4da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [11.6.1](https://github.com/LazyVim/LazyVim/compare/v11.6.0...v11.6.1) (2024-05-23) + + +### Bug Fixes + +* **lsp:** use proper buffer for dynamic capabilities. Fixes [#3246](https://github.com/LazyVim/LazyVim/issues/3246) ([10ed308](https://github.com/LazyVim/LazyVim/commit/10ed3082a415b525628dfaebdcd007c7e96a5b87)) + ## [11.6.0](https://github.com/LazyVim/LazyVim/compare/v11.5.0...v11.6.0) (2024-05-23) From 07a137199cde87f089776b3f992bd9ed08889cac Mon Sep 17 00:00:00 2001 From: Lawrence Ho <203431+lawrenceho@users.noreply.github.com> Date: Sun, 26 May 2024 16:11:12 +0800 Subject: [PATCH 381/526] fix(lsp): properly get buffer for dynamic capabilities (#3315) --- lua/lazyvim/util/lsp.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index 1ccc7544..c281fa85 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -44,7 +44,7 @@ function M.setup() local ret = register_capability(err, res, ctx) local client = vim.lsp.get_client_by_id(ctx.client_id) if client then - for buffer in ipairs(client.attached_buffers) do + for buffer in pairs(client.attached_buffers) do vim.api.nvim_exec_autocmds("User", { pattern = "LspDynamicCapability", data = { client_id = client.id, buffer = buffer }, From 945ee7e283d3d92fa346217932067ed3e2d97bec Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 26 May 2024 08:11:46 +0000 Subject: [PATCH 382/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 102f15d5..2415f44a 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 23 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 26 ============================================================================== Table of Contents *LazyVim-table-of-contents* From cdff9de17226701f37069744a402b7afd9942f66 Mon Sep 17 00:00:00 2001 From: jyuan0 Date: Sun, 26 May 2024 04:33:40 -0400 Subject: [PATCH 383/526] fix(lsp): correct previous reference keymap description (#3314) --- lua/lazyvim/plugins/lsp/keymaps.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/lsp/keymaps.lua b/lua/lazyvim/plugins/lsp/keymaps.lua index 14626afd..52dfed9f 100644 --- a/lua/lazyvim/plugins/lsp/keymaps.lua +++ b/lua/lazyvim/plugins/lsp/keymaps.lua @@ -41,7 +41,7 @@ function M.get() has = "codeAction", }, { "]]", function() LazyVim.lsp.words.jump(vim.v.count1) end, has = "documentHighlight", desc = "Next Reference" }, - { "[[", function() LazyVim.lsp.words.jump(-vim.v.count1) end, has = "documentHighlight", desc = "Next Reference" }, + { "[[", function() LazyVim.lsp.words.jump(-vim.v.count1) end, has = "documentHighlight", desc = "Prev Reference" }, } if LazyVim.has("inc-rename.nvim") then M._keys[#M._keys + 1] = { From c9ab8224f54fb6e93050fab1043b9d1efb917c23 Mon Sep 17 00:00:00 2001 From: jyuan0 Date: Sun, 26 May 2024 04:38:28 -0400 Subject: [PATCH 384/526] fix(illuminate): s/enabed/enabled (#3313) --- lua/lazyvim/plugins/extras/editor/illuminate.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/illuminate.lua b/lua/lazyvim/plugins/extras/editor/illuminate.lua index 6fef79b4..d4f4bf89 100644 --- a/lua/lazyvim/plugins/extras/editor/illuminate.lua +++ b/lua/lazyvim/plugins/extras/editor/illuminate.lua @@ -40,6 +40,6 @@ return { }, { "neovim/nvim-lspconfig", - opts = { document_highlight = { enabed = false } }, + opts = { document_highlight = { enabled = false } }, }, } From b3373f3428f8ded19f8162a46bf9f2784299b43b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 26 May 2024 16:03:13 +0200 Subject: [PATCH 385/526] fix(lsp): added a-n, a-p for document highlights and cycling. Closes #3320 --- lua/lazyvim/plugins/lsp/keymaps.lua | 22 +++++++++++---- lua/lazyvim/util/lsp.lua | 44 ++++++++++++++--------------- 2 files changed, 38 insertions(+), 28 deletions(-) diff --git a/lua/lazyvim/plugins/lsp/keymaps.lua b/lua/lazyvim/plugins/lsp/keymaps.lua index 52dfed9f..65db0057 100644 --- a/lua/lazyvim/plugins/lsp/keymaps.lua +++ b/lua/lazyvim/plugins/lsp/keymaps.lua @@ -3,8 +3,8 @@ local M = {} ---@type LazyKeysLspSpec[]|nil M._keys = nil ----@alias LazyKeysLspSpec LazyKeysSpec|{has?:string} ----@alias LazyKeysLsp LazyKeys|{has?:string} +---@alias LazyKeysLspSpec LazyKeysSpec|{has?:string, cond?:fun():boolean} +---@alias LazyKeysLsp LazyKeys|{has?:string, cond?:fun():boolean} ---@return LazyKeysLspSpec[] function M.get() @@ -40,8 +40,14 @@ function M.get() desc = "Source Action", has = "codeAction", }, - { "]]", function() LazyVim.lsp.words.jump(vim.v.count1) end, has = "documentHighlight", desc = "Next Reference" }, - { "[[", function() LazyVim.lsp.words.jump(-vim.v.count1) end, has = "documentHighlight", desc = "Prev Reference" }, + { "]]", function() LazyVim.lsp.words.jump(vim.v.count1) end, has = "documentHighlight", + desc = "Next Reference", cond = function() return LazyVim.lsp.words.enabled end }, + { "[[", function() LazyVim.lsp.words.jump(-vim.v.count1) end, has = "documentHighlight", + desc = "Prev Reference", cond = function() return LazyVim.lsp.words.enabled end }, + { "", function() LazyVim.lsp.words.jump(vim.v.count1, true) end, has = "documentHighlight", + desc = "Next Reference", cond = function() return LazyVim.lsp.words.enabled end }, + { "", function() LazyVim.lsp.words.jump(-vim.v.count1, true) end, has = "documentHighlight", + desc = "Prev Reference", cond = function() return LazyVim.lsp.words.enabled end }, } if LazyVim.has("inc-rename.nvim") then M._keys[#M._keys + 1] = { @@ -72,7 +78,7 @@ function M.has(buffer, method) return false end ----@return (LazyKeys|{has?:string})[] +---@return LazyKeysLsp[] function M.resolve(buffer) local Keys = require("lazy.core.handler.keys") if not Keys.resolve then @@ -93,8 +99,12 @@ function M.on_attach(_, buffer) local keymaps = M.resolve(buffer) for _, keys in pairs(keymaps) do - if not keys.has or M.has(buffer, keys.has) then + local has = not keys.has or M.has(buffer, keys.has) + local cond = not (keys.cond == false or ((type(keys.cond) == "function") and not keys.cond())) + + if has and cond then local opts = Keys.opts(keys) + opts.cond = nil opts.has = nil opts.silent = opts.silent ~= false opts.buffer = buffer diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index c281fa85..24a2bc98 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -210,8 +210,9 @@ function M.format(opts) end end ----@alias LspWord {from:{[1]:number, [2]:number}, to:{[1]:number, [2]:number}, current?:boolean} 1-0 indexed +---@alias LspWord {from:{[1]:number, [2]:number}, to:{[1]:number, [2]:number}} 1-0 indexed M.words = {} +M.words.enabled = false M.words.ns = vim.api.nvim_create_namespace("vim_lsp_references") ---@param opts? {enabled?: boolean} @@ -220,11 +221,13 @@ function M.words.setup(opts) if not opts.enabled then return end + M.words.enabled = true local handler = vim.lsp.handlers["textDocument/documentHighlight"] vim.lsp.handlers["textDocument/documentHighlight"] = function(err, result, ctx, config) if not vim.api.nvim_buf_is_loaded(ctx.bufnr) then return end + vim.lsp.buf.clear_references() return handler(err, result, ctx, config) end @@ -233,7 +236,7 @@ function M.words.setup(opts) group = vim.api.nvim_create_augroup("lsp_word_" .. buf, { clear = true }), buffer = buf, callback = function(ev) - if not M.words.at() then + if not ({ M.words.get() })[2] then if ev.event:find("CursorMoved") then vim.lsp.buf.clear_references() else @@ -245,38 +248,35 @@ function M.words.setup(opts) end) end ----@return LspWord[] +---@return LspWord[] words, number? current function M.words.get() local cursor = vim.api.nvim_win_get_cursor(0) - return vim.tbl_map(function(extmark) - local ret = { + local current, ret = nil, {} ---@type number?, LspWord[] + for _, extmark in ipairs(vim.api.nvim_buf_get_extmarks(0, M.words.ns, 0, -1, { details = true })) do + local w = { from = { extmark[2] + 1, extmark[3] }, to = { extmark[4].end_row + 1, extmark[4].end_col }, } - if cursor[1] >= ret.from[1] and cursor[1] <= ret.to[1] and cursor[2] >= ret.from[2] and cursor[2] <= ret.to[2] then - ret.current = true - end - return ret - end, vim.api.nvim_buf_get_extmarks(0, M.words.ns, 0, -1, { details = true })) -end - ----@param words? LspWord[] ----@return LspWord?, number? -function M.words.at(words) - for idx, word in ipairs(words or M.words.get()) do - if word.current then - return word, idx + ret[#ret + 1] = w + if cursor[1] >= w.from[1] and cursor[1] <= w.to[1] and cursor[2] >= w.from[2] and cursor[2] <= w.to[2] then + current = #ret end end + return ret, current end -function M.words.jump(count) - local words = M.words.get() - local _, idx = M.words.at(words) +---@param count number +---@param cycle? boolean +function M.words.jump(count, cycle) + local words, idx = M.words.get() if not idx then return end - local target = words[idx + count] + idx = idx + count + if cycle then + idx = (idx - 1) % #words + 1 + end + local target = words[idx] if target then vim.api.nvim_win_set_cursor(0, target.from) end From 7aa37064a2421f044c61d4baf42f71a923fab94b Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Sun, 26 May 2024 17:06:15 +0300 Subject: [PATCH 386/526] fix(lspconfig): make `opts` a function (#3311) `LazyVim.config` gets evaluated during the parsing phase with `opts` as a table (thus not taking into account changes made in the user's personal configuration for the icons), so make `opts` a function to defer the evaluation until the plugin loads. --- lua/lazyvim/plugins/lsp/init.lua | 184 ++++++++++++++++--------------- 1 file changed, 93 insertions(+), 91 deletions(-) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index a2b76326..2896417b 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -10,103 +10,105 @@ return { "williamboman/mason-lspconfig.nvim", }, ---@class PluginLspOpts - opts = { - -- options for vim.diagnostic.config() - ---@type vim.diagnostic.Opts - diagnostics = { - underline = true, - update_in_insert = false, - virtual_text = { - spacing = 4, - source = "if_many", - prefix = "●", - -- this will set set the prefix to a function that returns the diagnostics icon based on the severity - -- this only works on a recent 0.10.0 build. Will be set to "●" when not supported - -- prefix = "icons", - }, - severity_sort = true, - signs = { - text = { - [vim.diagnostic.severity.ERROR] = LazyVim.config.icons.diagnostics.Error, - [vim.diagnostic.severity.WARN] = LazyVim.config.icons.diagnostics.Warn, - [vim.diagnostic.severity.HINT] = LazyVim.config.icons.diagnostics.Hint, - [vim.diagnostic.severity.INFO] = LazyVim.config.icons.diagnostics.Info, + opts = function() + return { + -- options for vim.diagnostic.config() + ---@type vim.diagnostic.Opts + diagnostics = { + underline = true, + update_in_insert = false, + virtual_text = { + spacing = 4, + source = "if_many", + prefix = "●", + -- this will set set the prefix to a function that returns the diagnostics icon based on the severity + -- this only works on a recent 0.10.0 build. Will be set to "●" when not supported + -- prefix = "icons", + }, + severity_sort = true, + signs = { + text = { + [vim.diagnostic.severity.ERROR] = LazyVim.config.icons.diagnostics.Error, + [vim.diagnostic.severity.WARN] = LazyVim.config.icons.diagnostics.Warn, + [vim.diagnostic.severity.HINT] = LazyVim.config.icons.diagnostics.Hint, + [vim.diagnostic.severity.INFO] = LazyVim.config.icons.diagnostics.Info, + }, }, }, - }, - -- Enable this to enable the builtin LSP inlay hints on Neovim >= 0.10.0 - -- Be aware that you also will need to properly configure your LSP server to - -- provide the inlay hints. - inlay_hints = { - enabled = true, - }, - -- Enable this to enable the builtin LSP code lenses on Neovim >= 0.10.0 - -- Be aware that you also will need to properly configure your LSP server to - -- provide the code lenses. - codelens = { - enabled = false, - }, - -- Enable lsp cursor word highlighting - document_highlight = { - enabled = true, - }, - -- add any global capabilities here - capabilities = {}, - -- options for vim.lsp.buf.format - -- `bufnr` and `filter` is handled by the LazyVim formatter, - -- but can be also overridden when specified - format = { - formatting_options = nil, - timeout_ms = nil, - }, - -- LSP Server Settings - ---@type lspconfig.options - servers = { - lua_ls = { - -- mason = false, -- set to false if you don't want this server to be installed with mason - -- Use this to add any additional keymaps - -- for specific lsp servers - ---@type LazyKeysSpec[] - -- keys = {}, - settings = { - Lua = { - workspace = { - checkThirdParty = false, - }, - codeLens = { - enable = true, - }, - completion = { - callSnippet = "Replace", - }, - doc = { - privateName = { "^_" }, - }, - hint = { - enable = true, - setType = false, - paramType = true, - paramName = "Disable", - semicolon = "Disable", - arrayIndex = "Disable", + -- Enable this to enable the builtin LSP inlay hints on Neovim >= 0.10.0 + -- Be aware that you also will need to properly configure your LSP server to + -- provide the inlay hints. + inlay_hints = { + enabled = true, + }, + -- Enable this to enable the builtin LSP code lenses on Neovim >= 0.10.0 + -- Be aware that you also will need to properly configure your LSP server to + -- provide the code lenses. + codelens = { + enabled = false, + }, + -- Enable lsp cursor word highlighting + document_highlight = { + enabled = true, + }, + -- add any global capabilities here + capabilities = {}, + -- options for vim.lsp.buf.format + -- `bufnr` and `filter` is handled by the LazyVim formatter, + -- but can be also overridden when specified + format = { + formatting_options = nil, + timeout_ms = nil, + }, + -- LSP Server Settings + ---@type lspconfig.options + servers = { + lua_ls = { + -- mason = false, -- set to false if you don't want this server to be installed with mason + -- Use this to add any additional keymaps + -- for specific lsp servers + ---@type LazyKeysSpec[] + -- keys = {}, + settings = { + Lua = { + workspace = { + checkThirdParty = false, + }, + codeLens = { + enable = true, + }, + completion = { + callSnippet = "Replace", + }, + doc = { + privateName = { "^_" }, + }, + hint = { + enable = true, + setType = false, + paramType = true, + paramName = "Disable", + semicolon = "Disable", + arrayIndex = "Disable", + }, }, }, }, }, - }, - -- you can do any additional lsp server setup here - -- return true if you don't want this server to be setup with lspconfig - ---@type table - setup = { - -- example to setup with typescript.nvim - -- tsserver = function(_, opts) - -- require("typescript").setup({ server = opts }) - -- return true - -- end, - -- Specify * to use this function as a fallback for any server - -- ["*"] = function(server, opts) end, - }, - }, + -- you can do any additional lsp server setup here + -- return true if you don't want this server to be setup with lspconfig + ---@type table + setup = { + -- example to setup with typescript.nvim + -- tsserver = function(_, opts) + -- require("typescript").setup({ server = opts }) + -- return true + -- end, + -- Specify * to use this function as a fallback for any server + -- ["*"] = function(server, opts) end, + }, + } + end, ---@param opts PluginLspOpts config = function(_, opts) if LazyVim.has("neoconf.nvim") then From 3a30070a4cd4465699d1fdd384d95bdb9935376b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 26 May 2024 16:49:48 +0200 Subject: [PATCH 387/526] feat: lazyrc files are now a lazy.nvim feature --- lua/lazyvim/config/init.lua | 2 +- lua/lazyvim/plugins/extras/lazyrc.lua | 38 --------------------------- lua/lazyvim/util/json.lua | 4 +++ lua/lazyvim/util/plugin.lua | 1 + 4 files changed, 6 insertions(+), 39 deletions(-) delete mode 100644 lua/lazyvim/plugins/extras/lazyrc.lua diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 62b14237..83cadffc 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -132,7 +132,7 @@ local defaults = { } M.json = { - version = 4, + version = 5, data = { version = nil, ---@type string? news = {}, ---@type table diff --git a/lua/lazyvim/plugins/extras/lazyrc.lua b/lua/lazyvim/plugins/extras/lazyrc.lua deleted file mode 100644 index 24d06b51..00000000 --- a/lua/lazyvim/plugins/extras/lazyrc.lua +++ /dev/null @@ -1,38 +0,0 @@ ---[[ -Enable project-specific plugin specs. - -File .lazy.lua: - is read when present in the current working directory - should return a plugin spec - has to be manually trusted for each instance of the file - -This extra should be the last plugin spec added to lazy.nvim - -See: - :h 'exrc' - :h :trust ---]] -local filepath = vim.fn.fnamemodify(".lazy.lua", ":p") -local file = vim.secure.read(filepath) -if not file then - return {} -end - -vim.api.nvim_create_autocmd("User", { - pattern = "VeryLazy", - once = true, - callback = function() - local Config = require("lazy.core.config") - local lazyrc_idx = LazyVim.plugin.extra_idx("lazyrc") - - if lazyrc_idx and lazyrc_idx ~= #Config.spec.modules then - LazyVim.warn({ - "The `lazyrc` extra must be the last plugin spec added to **lazy.nvim**. ", - "", - "Add `{ import = 'lazyvim.plugins.extras.lazyrc' }` to file `config.lazy`. ", - "Do not use the `LazyExtras` command. ", - }, { title = "LazyVim", once = true }) - end - end, -}) -return loadstring(file)() diff --git a/lua/lazyvim/util/json.lua b/lua/lazyvim/util/json.lua index 4196847e..3e17662e 100644 --- a/lua/lazyvim/util/json.lua +++ b/lua/lazyvim/util/json.lua @@ -85,6 +85,10 @@ function M.migrate() or extra == "lazyvim.plugins.extras.ui.treesitter-rewrite" ) end, json.data.extras or {}) + elseif json.data.version == 4 then + json.data.extras = vim.tbl_filter(function(extra) + return not (extra == "lazyvim.plugins.extras.lazyrc") + end, json.data.extras or {}) end M.save() diff --git a/lua/lazyvim/util/plugin.lua b/lua/lazyvim/util/plugin.lua index a1cb8f46..77a1c28e 100644 --- a/lua/lazyvim/util/plugin.lua +++ b/lua/lazyvim/util/plugin.lua @@ -13,6 +13,7 @@ M.deprecated_extras = { ["lazyvim.plugins.extras.coding.native_snippets"] = "Native snippets are now the default for **Neovim >= 0.10**", ["lazyvim.plugins.extras.ui.treesitter-rewrite"] = "Disabled `treesitter-rewrite` extra for now. Not ready yet.", ["lazyvim.plugins.extras.coding.mini-ai"] = "`mini.ai` is now a core LazyVim plugin (again)", + ["lazyvim.plugins.extras.lazyrc"] = "local spec files are now a lazy.nvim feature", } M.deprecated_modules = { From 59204df1cb4a1d0176005dd7dc901ddbae9d23bd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 26 May 2024 17:04:15 +0200 Subject: [PATCH 388/526] chore(main): release 11.7.0 (#3317) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0b1c4da..e7cbee8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [11.7.0](https://github.com/LazyVim/LazyVim/compare/v11.6.1...v11.7.0) (2024-05-26) + + +### Features + +* lazyrc files are now a lazy.nvim feature ([3a30070](https://github.com/LazyVim/LazyVim/commit/3a30070a4cd4465699d1fdd384d95bdb9935376b)) + + +### Bug Fixes + +* **illuminate:** s/enabed/enabled ([#3313](https://github.com/LazyVim/LazyVim/issues/3313)) ([c9ab822](https://github.com/LazyVim/LazyVim/commit/c9ab8224f54fb6e93050fab1043b9d1efb917c23)) +* **lsp:** added a-n, a-p for document highlights and cycling. Closes [#3320](https://github.com/LazyVim/LazyVim/issues/3320) ([b3373f3](https://github.com/LazyVim/LazyVim/commit/b3373f3428f8ded19f8162a46bf9f2784299b43b)) +* **lspconfig:** make `opts` a function ([#3311](https://github.com/LazyVim/LazyVim/issues/3311)) ([7aa3706](https://github.com/LazyVim/LazyVim/commit/7aa37064a2421f044c61d4baf42f71a923fab94b)) +* **lsp:** correct previous reference keymap description ([#3314](https://github.com/LazyVim/LazyVim/issues/3314)) ([cdff9de](https://github.com/LazyVim/LazyVim/commit/cdff9de17226701f37069744a402b7afd9942f66)) +* **lsp:** properly get buffer for dynamic capabilities ([#3315](https://github.com/LazyVim/LazyVim/issues/3315)) ([07a1371](https://github.com/LazyVim/LazyVim/commit/07a137199cde87f089776b3f992bd9ed08889cac)) + ## [11.6.1](https://github.com/LazyVim/LazyVim/compare/v11.6.0...v11.6.1) (2024-05-23) From 53911748ddc7f92793c6fec6348a9cde32159ef3 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 26 May 2024 18:51:11 +0200 Subject: [PATCH 389/526] fix(snippet): always use top-level snippet session. Fixes #3199 --- lua/lazyvim/util/cmp.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lua/lazyvim/util/cmp.lua b/lua/lazyvim/util/cmp.lua index fd836d4e..957fb052 100644 --- a/lua/lazyvim/util/cmp.lua +++ b/lua/lazyvim/util/cmp.lua @@ -86,6 +86,13 @@ function M.confirm(opts) end function M.expand(snippet) + -- Native sessions don't support nested snippet sessions. + -- Always use the top-level session. + -- Otherwise, when on the first placeholder and selecting a new completion, + -- the nested session will be used instead of the top-level session. + -- See: https://github.com/LazyVim/LazyVim/issues/3199 + local session = vim.snippet.active() and vim.snippet._session or nil + local ok = pcall(vim.snippet.expand, snippet) if not ok then local fixed = M.snippet_fix(snippet) @@ -101,6 +108,11 @@ function M.expand(snippet) { title = "vim.snippet" } ) end + + -- Restore top-level session when needed + if session then + vim.snippet._session = session + end end return M From d23e8572e8ccc96b686ef8187aadf56ad47edd67 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 27 May 2024 07:13:43 +0200 Subject: [PATCH 390/526] fix(laygit): use correct .git root for git blame --- lua/lazyvim/util/lazygit.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/util/lazygit.lua b/lua/lazyvim/util/lazygit.lua index a56e98c0..d5586f7f 100644 --- a/lua/lazyvim/util/lazygit.lua +++ b/lua/lazyvim/util/lazygit.lua @@ -154,7 +154,8 @@ function M.blame_line(opts) local cursor = vim.api.nvim_win_get_cursor(0) local line = cursor[1] local file = vim.api.nvim_buf_get_name(0) - local cmd = { "git", "log", "-n", opts.count, "-u", "-L", line .. ",+1:" .. file } + local root = LazyVim.root.detectors.pattern(0, { ".git" })[1] + local cmd = { "git", "-C", root, "log", "-n", opts.count, "-u", "-L", line .. ",+1:" .. file } return require("lazy.util").float_cmd(cmd, opts) end From 61dc00147be8369db01908b07640ab71b7b77550 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 27 May 2024 05:14:23 +0000 Subject: [PATCH 391/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 2415f44a..0d167ab1 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 26 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 27 ============================================================================== Table of Contents *LazyVim-table-of-contents* From dbed614655fdf13436654356c0ba156d45ee7cc4 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 27 May 2024 05:35:47 +0200 Subject: [PATCH 392/526] fix(laygit): normalize paths. Fixes #3327 --- lua/lazyvim/util/lazygit.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/util/lazygit.lua b/lua/lazyvim/util/lazygit.lua index d5586f7f..e360ad82 100644 --- a/lua/lazyvim/util/lazygit.lua +++ b/lua/lazyvim/util/lazygit.lua @@ -32,7 +32,7 @@ M.theme = { unstagedChangesColor = { fg = "DiagnosticError" }, } -M.theme_path = vim.fn.stdpath("cache") .. "/lazygit-theme.yml" +M.theme_path = LazyVim.norm(vim.fn.stdpath("cache") .. "/lazygit-theme.yml") -- re-create config file on startup M.dirty = true @@ -69,7 +69,7 @@ function M.open(opts) local ok, lines = pcall(Process.exec, { "lazygit", "-cd" }) if ok then M.config_dir = lines[1] - vim.env.LG_CONFIG_FILE = M.config_dir .. "/config.yml" .. "," .. M.theme_path + vim.env.LG_CONFIG_FILE = LazyVim.norm(M.config_dir .. "/config.yml" .. "," .. M.theme_path) else ---@diagnostic disable-next-line: cast-type-mismatch ---@cast lines string From 9ccdbf644cc6f38ade7fdd7e554e8da8b38091ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Guimar=C3=A3es?= Date: Sun, 26 May 2024 22:53:49 -0700 Subject: [PATCH 393/526] feat(git): Change Commit Log to use Lazygit (#2959) * feat(git): Change Commit Log to use Lazygit * fix: use gl * fix conflicts --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/config/keymaps.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 7464f33e..86552999 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -136,6 +136,10 @@ map("n", "gf", function() LazyVim.lazygit({args = { "-f", vim.trim(git_path) }}) end, { desc = "Lazygit Current File History" }) +map("n", "gl", function() + LazyVim.lazygit({ args = { "log" } }) +end, { desc = "Lazygit Log" }) + -- quit map("n", "qq", "qa", { desc = "Quit All" }) From f48d55a653cc829e7dfecc3c01bf1ccbdf337257 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Mon, 27 May 2024 09:04:51 +0300 Subject: [PATCH 394/526] fix(lang/rust): Remove `rust-analyzer` from `nvim-lspconfig` (#2755) According to the maintainer of `rustaceanvim` (see his comment [here](https://github.com/LazyVim/LazyVim/pull/2198#issuecomment-1999475044)) he says > To pick up on this: There's a good reason rustaceanvim doesn't automatically pick up a mason.nvim installation. It will most likely be built with a different toolchain than the one your project uses, often leading to discrepancies and subtle bugs. It's easy to configure rustaceanvim to use mason.nvim if you really want it, but I generally adhere to the YAGNI principle. I tried locally and the removal of `rust-analyzer` from `nvim-lspconfig` doesn't seem to have any effect on how `rustaceanvim` behaves. I propose to remove all instances of `rust-analyzer` from `nvim-lspconfig` to avoid any possible issues from users that don't have `rust-analyzer` installed in their toolchain (in this case it would pick up Mason's $PATH I believe), since they will think that since `rust-analyzer` is installed by Mason, there shouldn't be a problem and report issues as bugs. --- lua/lazyvim/plugins/extras/lang/rust.lua | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/rust.lua b/lua/lazyvim/plugins/extras/lang/rust.lua index 98a166f5..3c2710df 100644 --- a/lua/lazyvim/plugins/extras/lang/rust.lua +++ b/lua/lazyvim/plugins/extras/lang/rust.lua @@ -98,7 +98,6 @@ return { "neovim/nvim-lspconfig", opts = { servers = { - rust_analyzer = {}, taplo = { keys = { { @@ -115,11 +114,6 @@ return { }, }, }, - setup = { - rust_analyzer = function() - return true - end, - }, }, }, From d3500a4a33ab87c6225d991302a72012c54b26fe Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 27 May 2024 08:09:24 +0200 Subject: [PATCH 395/526] fix(rust): show error when rust-analyzer not found --- lua/lazyvim/plugins/extras/lang/rust.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/rust.lua b/lua/lazyvim/plugins/extras/lang/rust.lua index 3c2710df..5a3c59d7 100644 --- a/lua/lazyvim/plugins/extras/lang/rust.lua +++ b/lua/lazyvim/plugins/extras/lang/rust.lua @@ -90,6 +90,12 @@ return { }, config = function(_, opts) vim.g.rustaceanvim = vim.tbl_deep_extend("keep", vim.g.rustaceanvim or {}, opts or {}) + if vim.fn.executable("rust-analyzer") == 0 then + LazyVim.error( + "**rust-analyzer** not found in PATH, please install it.\nhttps://rust-analyzer.github.io/", + { title = "rustaceanvim" } + ) + end end, }, From 46785526a63b401d812de79fbbecca26414dc8e8 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 27 May 2024 08:42:30 +0200 Subject: [PATCH 396/526] feat(extras): added extra for CopilotChat.nvim --- .../plugins/extras/coding/copilot-chat.lua | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/coding/copilot-chat.lua diff --git a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua new file mode 100644 index 00000000..7297d890 --- /dev/null +++ b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua @@ -0,0 +1,91 @@ +return { + { + "CopilotC-Nvim/CopilotChat.nvim", + branch = "canary", + cmd = "CopilotChat", + opts = { + model = "gpt-4", + auto_insert_mode = true, + window = { + width = 0.4, + }, + selection = function(source) + local select = require("CopilotChat.select") + return select.visual(source) or select.buffer(source) + end, + }, + keys = { + { + "aa", + function() + return require("CopilotChat").toggle() + end, + desc = "Toggle (CopilotChat)", + }, + { + "ax", + function() + return require("CopilotChat").clear() + end, + desc = "Clear (CopilotChat)", + }, + { + "aq", + function() + local input = vim.fn.input("Quick Chat: ") + if input ~= "" then + require("CopilotChat").ask(input, { selection = require("CopilotChat.select").buffer }) + end + end, + desc = "Quick Chat (CopilotChat)", + }, + }, + init = function() + LazyVim.on_load("which-key.nvim", function() + vim.schedule(function() + require("which-key").register({ a = { name = "+CopilotChat (AI)" } }, { prefix = "" }) + end) + end) + end, + config = function(_, opts) + vim.api.nvim_create_autocmd("BufEnter", { + pattern = "copilot-chat", + callback = function() + vim.opt_local.relativenumber = false + vim.opt_local.number = false + end, + }) + require("CopilotChat").setup(opts) + end, + }, + + { + "nvim-telescope/telescope.nvim", + optional = true, + keys = { + -- Show help actions with telescope + { + "ad", + function() + local actions = require("CopilotChat.actions") + local help = actions.help_actions() + if not help then + LazyVim.warn("No diagnostics found on the current line") + return + end + require("CopilotChat.integrations.telescope").pick(help) + end, + desc = "Diagnostic Help (CopilotChat)", + }, + -- Show prompts actions with telescope + { + "ap", + function() + local actions = require("CopilotChat.actions") + require("CopilotChat.integrations.telescope").pick(actions.prompt_actions()) + end, + desc = "Prompt Actions (CopilotChat)", + }, + }, + }, +} From 91fe7ef56815263b6a0f4a5c23c4bd1134c77849 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 09:07:31 +0200 Subject: [PATCH 397/526] chore(main): release 11.8.0 (#3326) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7cbee8f..d26eb087 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [11.8.0](https://github.com/LazyVim/LazyVim/compare/v11.7.0...v11.8.0) (2024-05-27) + + +### Features + +* **extras:** added extra for CopilotChat.nvim ([4678552](https://github.com/LazyVim/LazyVim/commit/46785526a63b401d812de79fbbecca26414dc8e8)) +* **git:** Change Commit Log to use Lazygit ([#2959](https://github.com/LazyVim/LazyVim/issues/2959)) ([9ccdbf6](https://github.com/LazyVim/LazyVim/commit/9ccdbf644cc6f38ade7fdd7e554e8da8b38091ac)) + + +### Bug Fixes + +* **lang/rust:** Remove `rust-analyzer` from `nvim-lspconfig` ([#2755](https://github.com/LazyVim/LazyVim/issues/2755)) ([f48d55a](https://github.com/LazyVim/LazyVim/commit/f48d55a653cc829e7dfecc3c01bf1ccbdf337257)) +* **laygit:** normalize paths. Fixes [#3327](https://github.com/LazyVim/LazyVim/issues/3327) ([dbed614](https://github.com/LazyVim/LazyVim/commit/dbed614655fdf13436654356c0ba156d45ee7cc4)) +* **laygit:** use correct .git root for git blame ([d23e857](https://github.com/LazyVim/LazyVim/commit/d23e8572e8ccc96b686ef8187aadf56ad47edd67)) +* **rust:** show error when rust-analyzer not found ([d3500a4](https://github.com/LazyVim/LazyVim/commit/d3500a4a33ab87c6225d991302a72012c54b26fe)) +* **snippet:** always use top-level snippet session. Fixes [#3199](https://github.com/LazyVim/LazyVim/issues/3199) ([5391174](https://github.com/LazyVim/LazyVim/commit/53911748ddc7f92793c6fec6348a9cde32159ef3)) + ## [11.7.0](https://github.com/LazyVim/LazyVim/compare/v11.6.1...v11.7.0) (2024-05-26) From 54d7cea30567577bf926765e9282d7736e951941 Mon Sep 17 00:00:00 2001 From: Ben Elan Date: Mon, 27 May 2024 04:48:22 -0700 Subject: [PATCH 398/526] fix(typescript): invalid value in inlayHints options (#3331) --- lua/lazyvim/plugins/extras/lang/typescript.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua index 373775ce..414f11da 100644 --- a/lua/lazyvim/plugins/extras/lang/typescript.lua +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -2,7 +2,7 @@ local inlay_hints_settings = { includeInlayEnumMemberValueHints = true, includeInlayFunctionLikeReturnTypeHints = true, includeInlayFunctionParameterTypeHints = true, - includeInlayParameterNameHints = "literal", + includeInlayParameterNameHints = "literals", includeInlayParameterNameHintsWhenArgumentMatchesName = false, includeInlayPropertyDeclarationTypeHints = true, includeInlayVariableTypeHints = false, From 2695fc7dfc9972da9c3d7e1d3b4a138f54f1dcbb Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 27 May 2024 16:48:18 +0200 Subject: [PATCH 399/526] feat(copilot-chat): make keymaps work in visual mode --- .../plugins/extras/coding/copilot-chat.lua | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua index 7297d890..e356b771 100644 --- a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua +++ b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua @@ -6,6 +6,7 @@ return { opts = { model = "gpt-4", auto_insert_mode = true, + show_help = true, window = { width = 0.4, }, @@ -21,6 +22,7 @@ return { return require("CopilotChat").toggle() end, desc = "Toggle (CopilotChat)", + mode = { "n", "v" }, }, { "ax", @@ -28,16 +30,18 @@ return { return require("CopilotChat").clear() end, desc = "Clear (CopilotChat)", + mode = { "n", "v" }, }, { "aq", function() local input = vim.fn.input("Quick Chat: ") if input ~= "" then - require("CopilotChat").ask(input, { selection = require("CopilotChat.select").buffer }) + require("CopilotChat").ask(input) end end, desc = "Quick Chat (CopilotChat)", + mode = { "n", "v" }, }, }, init = function() @@ -48,6 +52,7 @@ return { end) end, config = function(_, opts) + local chat = require("CopilotChat") vim.api.nvim_create_autocmd("BufEnter", { pattern = "copilot-chat", callback = function() @@ -55,10 +60,11 @@ return { vim.opt_local.number = false end, }) - require("CopilotChat").setup(opts) + chat.setup(opts) end, }, + -- Telescope integration { "nvim-telescope/telescope.nvim", optional = true, @@ -76,6 +82,7 @@ return { require("CopilotChat.integrations.telescope").pick(help) end, desc = "Diagnostic Help (CopilotChat)", + mode = { "n", "v" }, }, -- Show prompts actions with telescope { @@ -85,7 +92,22 @@ return { require("CopilotChat.integrations.telescope").pick(actions.prompt_actions()) end, desc = "Prompt Actions (CopilotChat)", + mode = { "n", "v" }, }, }, }, + + -- Edgy integration + { + "folke/edgy.nvim", + optional = true, + opts = function(_, opts) + opts.right = opts.right or {} + table.insert(opts.right, { + ft = "copilot-chat", + title = "Copilot Chat", + size = { width = 50 }, + }) + end, + }, } From 163f7ea3036caf48eed9e9c7b0da8680475612a7 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 27 May 2024 17:38:30 +0200 Subject: [PATCH 400/526] fix(edgy): load edgy spec early --- lua/lazyvim/plugins/xtras.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/xtras.lua b/lua/lazyvim/plugins/xtras.lua index 6f50ec5b..6c789b0f 100644 --- a/lua/lazyvim/plugins/xtras.lua +++ b/lua/lazyvim/plugins/xtras.lua @@ -5,6 +5,7 @@ local prios = { ["lazyvim.plugins.extras.editor.aerial"] = 100, ["lazyvim.plugins.extras.editor.outline"] = 100, ["lazyvim.plugins.extras.editor.trouble-v3"] = 100, + ["lazyvim.plugins.extras.ui.edgy"] = 2, ["lazyvim.plugins.extras.test.core"] = 1, ["lazyvim.plugins.extras.dap.core"] = 1, } From eb1c04bd31d518377538ac228788b6a0be194c1b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 27 May 2024 17:38:51 +0200 Subject: [PATCH 401/526] fix(terminal): make `gf` behave. Fixes #3335 --- lua/lazyvim/util/terminal.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lua/lazyvim/util/terminal.lua b/lua/lazyvim/util/terminal.lua index 1a85d4f0..6d40dc95 100644 --- a/lua/lazyvim/util/terminal.lua +++ b/lua/lazyvim/util/terminal.lua @@ -73,6 +73,14 @@ function M.open(cmd, opts) vim.keymap.set("t", "", "", { buffer = buf, nowait = true }) end + vim.keymap.set("n", "gf", function() + local f = vim.fn.findfile(vim.fn.expand("")) + if f ~= "" then + vim.cmd("close") + vim.cmd("e " .. f) + end + end, { buffer = buf }) + vim.api.nvim_create_autocmd("BufEnter", { buffer = buf, callback = function() From 02b240cea56a5547f2b0729e09decfc228475c8b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 27 May 2024 17:53:38 +0200 Subject: [PATCH 402/526] fix(copilot-chat): clear -> reset --- lua/lazyvim/plugins/extras/coding/copilot-chat.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua index e356b771..46a21441 100644 --- a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua +++ b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua @@ -27,7 +27,7 @@ return { { "ax", function() - return require("CopilotChat").clear() + return require("CopilotChat").reset() end, desc = "Clear (CopilotChat)", mode = { "n", "v" }, From a23e8c15f50a176f0decf054ecbfc38c7570b9b0 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 27 May 2024 18:16:35 +0200 Subject: [PATCH 403/526] feat(copilot-chat): enhanced rendering of the chat window --- .../plugins/extras/coding/copilot-chat.lua | 60 +++++++++++++++---- 1 file changed, 47 insertions(+), 13 deletions(-) diff --git a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua index 46a21441..4fc4cc9f 100644 --- a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua +++ b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua @@ -3,18 +3,25 @@ return { "CopilotC-Nvim/CopilotChat.nvim", branch = "canary", cmd = "CopilotChat", - opts = { - model = "gpt-4", - auto_insert_mode = true, - show_help = true, - window = { - width = 0.4, - }, - selection = function(source) - local select = require("CopilotChat.select") - return select.visual(source) or select.buffer(source) - end, - }, + opts = function() + 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 .. " ", + answer_header = " Copilot ", + separator = "---", + window = { + width = 0.4, + }, + selection = function(source) + local select = require("CopilotChat.select") + return select.visual(source) or select.buffer(source) + end, + } + end, keys = { { "aa", @@ -53,13 +60,40 @@ return { end, config = function(_, opts) local chat = require("CopilotChat") + local ns = vim.api.nvim_create_namespace("copilot-chat-text-hl") + vim.api.nvim_create_autocmd("BufEnter", { pattern = "copilot-chat", - callback = function() + callback = function(ev) vim.opt_local.relativenumber = false vim.opt_local.number = false + + vim.api.nvim_create_autocmd({ "TextChanged", "TextChangedI" }, { + group = vim.api.nvim_create_augroup("copilot-chat-text-" .. ev.buf, { clear = true }), + buffer = ev.buf, + callback = function() + vim.api.nvim_buf_clear_namespace(ev.buf, ns, 0, -1) + local lines = vim.api.nvim_buf_get_lines(ev.buf, 0, -1, false) + for l, line in ipairs(lines) do + if line:match(opts.separator .. "$") then + local sep = vim.fn.strwidth(line) - vim.fn.strwidth(opts.separator) + vim.api.nvim_buf_set_extmark(ev.buf, ns, l - 1, sep, { + virt_text_win_col = sep, + virt_text = { { string.rep("─", vim.go.columns), "@punctuation.special.markdown" } }, + priority = 100, + }) + vim.api.nvim_buf_set_extmark(ev.buf, ns, l - 1, 0, { + end_col = sep + 1, + hl_group = "@markup.heading.2.markdown", + priority = 100, + }) + end + end + end, + }) end, }) + chat.setup(opts) end, }, From 0a63734b783509407530eae789258fcf9a6f2219 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 27 May 2024 18:22:44 +0200 Subject: [PATCH 404/526] fix(lsp): double check for documentHighlight. See #3246 --- lua/lazyvim/util/lsp.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index 24a2bc98..adc1be0d 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -236,6 +236,9 @@ function M.words.setup(opts) group = vim.api.nvim_create_augroup("lsp_word_" .. buf, { clear = true }), buffer = buf, callback = function(ev) + if not require("lazyvim.plugins.lsp.keymaps").has(buf, "documentHighlight") then + return false + end if not ({ M.words.get() })[2] then if ev.event:find("CursorMoved") then vim.lsp.buf.clear_references() From 505ce3851c600a8c1fc0c57f1c4ea790891c6023 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 18:24:15 +0200 Subject: [PATCH 405/526] chore(main): release 11.9.0 (#3333) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d26eb087..3b9f2b26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [11.9.0](https://github.com/LazyVim/LazyVim/compare/v11.8.0...v11.9.0) (2024-05-27) + + +### Features + +* **copilot-chat:** enhanced rendering of the chat window ([a23e8c1](https://github.com/LazyVim/LazyVim/commit/a23e8c15f50a176f0decf054ecbfc38c7570b9b0)) +* **copilot-chat:** make keymaps work in visual mode ([2695fc7](https://github.com/LazyVim/LazyVim/commit/2695fc7dfc9972da9c3d7e1d3b4a138f54f1dcbb)) + + +### Bug Fixes + +* **copilot-chat:** clear -> reset ([02b240c](https://github.com/LazyVim/LazyVim/commit/02b240cea56a5547f2b0729e09decfc228475c8b)) +* **edgy:** load edgy spec early ([163f7ea](https://github.com/LazyVim/LazyVim/commit/163f7ea3036caf48eed9e9c7b0da8680475612a7)) +* **lsp:** double check for documentHighlight. See [#3246](https://github.com/LazyVim/LazyVim/issues/3246) ([0a63734](https://github.com/LazyVim/LazyVim/commit/0a63734b783509407530eae789258fcf9a6f2219)) +* **terminal:** make `gf` behave. Fixes [#3335](https://github.com/LazyVim/LazyVim/issues/3335) ([eb1c04b](https://github.com/LazyVim/LazyVim/commit/eb1c04bd31d518377538ac228788b6a0be194c1b)) +* **typescript:** invalid value in inlayHints options ([#3331](https://github.com/LazyVim/LazyVim/issues/3331)) ([54d7cea](https://github.com/LazyVim/LazyVim/commit/54d7cea30567577bf926765e9282d7736e951941)) + ## [11.8.0](https://github.com/LazyVim/LazyVim/compare/v11.7.0...v11.8.0) (2024-05-27) From 08481c2c9272b8863611d5f3e79876674bfc570e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 27 May 2024 20:57:46 +0200 Subject: [PATCH 406/526] fix(copilot-chat): enhanced chat view is now merged upstream, so update your plugins! --- .../plugins/extras/coding/copilot-chat.lua | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua index 4fc4cc9f..d87326c5 100644 --- a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua +++ b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua @@ -12,7 +12,6 @@ return { show_help = true, question_header = " " .. user .. " ", answer_header = " Copilot ", - separator = "---", window = { width = 0.4, }, @@ -67,30 +66,6 @@ return { callback = function(ev) vim.opt_local.relativenumber = false vim.opt_local.number = false - - vim.api.nvim_create_autocmd({ "TextChanged", "TextChangedI" }, { - group = vim.api.nvim_create_augroup("copilot-chat-text-" .. ev.buf, { clear = true }), - buffer = ev.buf, - callback = function() - vim.api.nvim_buf_clear_namespace(ev.buf, ns, 0, -1) - local lines = vim.api.nvim_buf_get_lines(ev.buf, 0, -1, false) - for l, line in ipairs(lines) do - if line:match(opts.separator .. "$") then - local sep = vim.fn.strwidth(line) - vim.fn.strwidth(opts.separator) - vim.api.nvim_buf_set_extmark(ev.buf, ns, l - 1, sep, { - virt_text_win_col = sep, - virt_text = { { string.rep("─", vim.go.columns), "@punctuation.special.markdown" } }, - priority = 100, - }) - vim.api.nvim_buf_set_extmark(ev.buf, ns, l - 1, 0, { - end_col = sep + 1, - hl_group = "@markup.heading.2.markdown", - priority = 100, - }) - end - end - end, - }) end, }) From e68ff6897eb8e90ec08f7400d3271a8b4fb1da1e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 27 May 2024 21:19:36 +0200 Subject: [PATCH 407/526] feat(lsp): config option to exclude certain filetypes from inlay hints. Closes #3202 --- lua/lazyvim/plugins/lsp/init.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 2896417b..b183464e 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -40,6 +40,7 @@ return { -- provide the inlay hints. inlay_hints = { enabled = true, + exclude = {}, -- filetypes for which you don't want to enable inlay hints }, -- Enable this to enable the builtin LSP code lenses on Neovim >= 0.10.0 -- Be aware that you also will need to properly configure your LSP server to @@ -143,7 +144,11 @@ return { -- inlay hints if opts.inlay_hints.enabled then LazyVim.lsp.on_supports_method("textDocument/inlayHint", function(client, buffer) - if vim.api.nvim_buf_is_valid(buffer) and vim.bo[buffer].buftype == "" then + if + vim.api.nvim_buf_is_valid(buffer) + and vim.bo[buffer].buftype == "" + and not vim.tbl_contains(opts.inlay_hints.exclude, vim.bo[buffer].filetype) + then LazyVim.toggle.inlay_hints(buffer, true) end end) From 47a8736278d246769069dd1013560f1a122b0316 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 28 May 2024 07:39:26 +0200 Subject: [PATCH 408/526] feat(keymaps): add comment above/below current line with gco/gcO --- lua/lazyvim/config/keymaps.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 86552999..a6ac8f3c 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -75,6 +75,10 @@ map("n", "K", "norm! K", { desc = "Keywordprg" }) map("v", "<", "", ">gv") +-- commenting +map("n", "gco", "oVcxnormal gccfxa", { desc = "Add Comment Below" }) +map("n", "gcO", "OVcxnormal gccfxa", { desc = "Add Comment Above" }) + -- lazy map("n", "l", "Lazy", { desc = "Lazy" }) From a3011c91d4dfb64a4e9a9cb0928efefb0a25c4b7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 28 May 2024 05:40:04 +0000 Subject: [PATCH 409/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 0d167ab1..ac8e7259 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 27 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 28 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 80c9dcaabe97a2e07d4fbc060820d8eb3ae6a044 Mon Sep 17 00:00:00 2001 From: Ben Puryear <54869170+Ben10164@users.noreply.github.com> Date: Tue, 28 May 2024 04:44:38 -0700 Subject: [PATCH 410/526] feat(lang): add R (#3272) * Added R extra * Removed "made by Ben10164" * Formatted Lua * Removed hardcoded addition of R-languageserver in MasonLSP * Improved nvim-lspconfig config for r_language_server * Added nvim-neotest * Format * Removed Lualine * Rework into opts, modify `pdfviewer` to be os dependent * refactor: r * fix: add cmp-r back * Added quarto whichkey group label * Set pdfviewer to be an empty string --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/plugins/extras/lang/r.lua | 93 +++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lang/r.lua diff --git a/lua/lazyvim/plugins/extras/lang/r.lua b/lua/lazyvim/plugins/extras/lang/r.lua new file mode 100644 index 00000000..c89828c4 --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/r.lua @@ -0,0 +1,93 @@ +return { + recommended = function() + return LazyVim.extras.wants({ + ft = "r", + root = { "*.R", "*.Rmd", "*qmd" }, + }) + end, + { + "R-nvim/R.nvim", + lazy = false, + opts = { + -- Create a table with the options to be passed to setup() + R_args = { "--quiet", "--no-save" }, + hook = { + on_filetype = function() + -- This function will be called at the FileType event + -- of files supported by R.nvim. This is an + -- opportunity to create mappings local to buffers. + vim.keymap.set("n", "", "RDSendLine", { buffer = true }) + vim.keymap.set("v", "", "RSendSelection", { buffer = true }) + + -- Increase the width of which-key to handle the longer r-nvim descriptions + local wk = require("which-key") + -- Workaround from https://github.com/folke/which-key.nvim/issues/514#issuecomment-1987286901 + wk.register({ + [""] = { + a = { name = "+(a)ll", ["🚫"] = "which_key_ignore" }, + b = { name = "+(b)etween marks", ["🚫"] = "which_key_ignore" }, + c = { name = "+(c)hunks", ["🚫"] = "which_key_ignore" }, + f = { name = "+(f)unctions", ["🚫"] = "which_key_ignore" }, + g = { name = "+(g)oto", ["🚫"] = "which_key_ignore" }, + k = { name = "+(k)nit", ["🚫"] = "which_key_ignore" }, + p = { name = "+(p)aragraph", ["🚫"] = "which_key_ignore" }, + q = { name = "+(q)uarto", ["🚫"] = "which_key_ignore" }, + r = { name = "+(r) general", ["🚫"] = "which_key_ignore" }, + s = { name = "+(s)plit or (s)end", ["🚫"] = "which_key_ignore" }, + t = { name = "+(t)erminal", ["🚫"] = "which_key_ignore" }, + v = { name = "+(v)iew", ["🚫"] = "which_key_ignore" }, + }, + }) + end, + }, + pdfviewer = "" + }, + config = function(_, opts) + require("r").setup(opts) + require("r.pdf.generic").open = vim.ui.open + end, + }, + { + "hrsh7th/nvim-cmp", + optional = true, + dependencies = { "R-nvim/cmp-r" }, + opts = function(_, opts) + opts.sources = opts.sources or {} + table.insert(opts.sources, { name = "cmp_r" }) + end, + }, + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + if type(opts.ensure_installed) == "table" then + vim.list_extend(opts.ensure_installed, { "markdown", "markdown_inline", "r", "rnoweb" }) + end + end, + }, + { + "neovim/nvim-lspconfig", + opts = { + servers = { + r_language_server = { + root_dir = function(fname) + return require("lspconfig.util").root_pattern("DESCRIPTION", "NAMESPACE", ".Rbuildignore")(fname) + or require("lspconfig.util").find_git_ancestor(fname) + or vim.loop.os_homedir() + end, + }, + }, + }, + }, + { + "nvim-neotest/neotest", + optional = true, + dependencies = { + "shunsambongi/neotest-testthat", + }, + opts = { + adapters = { + ["neotest-testthat"] = {}, + }, + }, + }, +} From de5789415855eafa24f399ee11a5e96bee7c6f9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Kleinb=C3=B6lting?= Date: Tue, 28 May 2024 14:55:11 +0200 Subject: [PATCH 411/526] feat(scala-extra): Use noice for progress and add minimal keybinding (#3348) * Use fidget for progress and add minimal keybinding * remove figest, noice works already * make keybinding only available for scala filetypes --- lua/lazyvim/plugins/extras/lang/scala.lua | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/scala.lua b/lua/lazyvim/plugins/extras/lang/scala.lua index 47c87b87..0722b8d6 100644 --- a/lua/lazyvim/plugins/extras/lang/scala.lua +++ b/lua/lazyvim/plugins/extras/lang/scala.lua @@ -26,7 +26,7 @@ return { ft = { "scala", "sbt", "java" }, init = function() local metals_config = require("metals").bare_config() - metals_config.init_options.statusBarProvider = "on" + metals_config.init_options.statusBarProvider = "off" metals_config.settings = { showImplicitArguments = true, excludedPackages = { "akka.actor.typed.javadsl", "com.github.swagger.akka.javadsl" }, @@ -70,6 +70,24 @@ return { }, } end, + keys = { + { + "me", + function() + require("telescope").extensions.metals.commands() + end, + desc = "Metals commands", + ft = { "scala", "sbt", "java" }, + }, + { + "mc", + function() + require("metals").compile_cascade() + end, + desc = "Metals compile cascade", + ft = { "scala", "sbt", "java" }, + }, + }, }, { "nvim-treesitter/nvim-treesitter", From 99f0a1cb40cbfc099503bfa05fbd6c26370cada3 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 28 May 2024 15:11:29 +0200 Subject: [PATCH 412/526] fix(nvim-snippets): load js snippets for ts. See #3344 --- lua/lazyvim/plugins/coding.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 659a28ab..c9d275e9 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -104,6 +104,9 @@ return { opts = { friendly_snippets = true, global_snippets = { "all", "global" }, + extended_filetypes = { + typescript = { "javascript" }, + }, }, dependencies = { "rafamadriz/friendly-snippets" }, }, From 025ba33dc3e7899b26233f05cb650dbecb234441 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 28 May 2024 15:13:29 +0200 Subject: [PATCH 413/526] fix(nvim-snippets): also enable for tsx/jsx files --- lua/lazyvim/plugins/coding.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index c9d275e9..a42f2632 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -106,6 +106,8 @@ return { global_snippets = { "all", "global" }, extended_filetypes = { typescript = { "javascript" }, + typescriptreact = { "javascript" }, + javascriptreact = { "javascript" }, }, }, dependencies = { "rafamadriz/friendly-snippets" }, From cf4374867d39b590f1add8c654dbb2d3578cf24f Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 28 May 2024 16:12:35 +0200 Subject: [PATCH 414/526] feat(snippets): re-number tabstops for invalid snippets --- lua/lazyvim/util/cmp.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/util/cmp.lua b/lua/lazyvim/util/cmp.lua index 957fb052..0603b20d 100644 --- a/lua/lazyvim/util/cmp.lua +++ b/lua/lazyvim/util/cmp.lua @@ -23,8 +23,10 @@ end -- This function replaces nested placeholders in a snippet with LSP placeholders. function M.snippet_fix(snippet) + local nn = 0 return M.snippet_replace(snippet, function(placeholder) - return "${" .. placeholder.n .. ":" .. M.snippet_preview(placeholder.text) .. "}" + nn = nn + 1 + return "${" .. nn .. ":" .. M.snippet_preview(placeholder.text) .. "}" end) end From a6e6d4dabd60ab12546f56989811e58b19efb5a1 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 28 May 2024 16:12:53 +0200 Subject: [PATCH 415/526] fix(nvim-snippets): remove extra filetypes since thats no longer needed with merged PR --- lua/lazyvim/plugins/coding.lua | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index a42f2632..659a28ab 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -104,11 +104,6 @@ return { opts = { friendly_snippets = true, global_snippets = { "all", "global" }, - extended_filetypes = { - typescript = { "javascript" }, - typescriptreact = { "javascript" }, - javascriptreact = { "javascript" }, - }, }, dependencies = { "rafamadriz/friendly-snippets" }, }, From 97bdcc1c521347a3ac504287099dbf272d68fce8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 16:15:34 +0200 Subject: [PATCH 416/526] chore(main): release 11.10.0 (#3339) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b9f2b26..a7cda40e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [11.10.0](https://github.com/LazyVim/LazyVim/compare/v11.9.0...v11.10.0) (2024-05-28) + + +### Features + +* **keymaps:** add comment above/below current line with gco/gcO ([47a8736](https://github.com/LazyVim/LazyVim/commit/47a8736278d246769069dd1013560f1a122b0316)) +* **lang:** add R ([#3272](https://github.com/LazyVim/LazyVim/issues/3272)) ([80c9dca](https://github.com/LazyVim/LazyVim/commit/80c9dcaabe97a2e07d4fbc060820d8eb3ae6a044)) +* **lsp:** config option to exclude certain filetypes from inlay hints. Closes [#3202](https://github.com/LazyVim/LazyVim/issues/3202) ([e68ff68](https://github.com/LazyVim/LazyVim/commit/e68ff6897eb8e90ec08f7400d3271a8b4fb1da1e)) +* **scala-extra:** Use noice for progress and add minimal keybinding ([#3348](https://github.com/LazyVim/LazyVim/issues/3348)) ([de57894](https://github.com/LazyVim/LazyVim/commit/de5789415855eafa24f399ee11a5e96bee7c6f9e)) +* **snippets:** re-number tabstops for invalid snippets ([cf43748](https://github.com/LazyVim/LazyVim/commit/cf4374867d39b590f1add8c654dbb2d3578cf24f)) + + +### Bug Fixes + +* **copilot-chat:** enhanced chat view is now merged upstream, so update your plugins! ([08481c2](https://github.com/LazyVim/LazyVim/commit/08481c2c9272b8863611d5f3e79876674bfc570e)) +* **nvim-snippets:** also enable for tsx/jsx files ([025ba33](https://github.com/LazyVim/LazyVim/commit/025ba33dc3e7899b26233f05cb650dbecb234441)) +* **nvim-snippets:** load js snippets for ts. See [#3344](https://github.com/LazyVim/LazyVim/issues/3344) ([99f0a1c](https://github.com/LazyVim/LazyVim/commit/99f0a1cb40cbfc099503bfa05fbd6c26370cada3)) +* **nvim-snippets:** remove extra filetypes since thats no longer needed with merged PR ([a6e6d4d](https://github.com/LazyVim/LazyVim/commit/a6e6d4dabd60ab12546f56989811e58b19efb5a1)) + ## [11.9.0](https://github.com/LazyVim/LazyVim/compare/v11.8.0...v11.9.0) (2024-05-27) From 91493588a8580cc216ee63cdc98b4462c54b45a7 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 28 May 2024 17:50:13 +0200 Subject: [PATCH 417/526] fix(nvim-snippets): no longer needed to set global_snippets --- lua/lazyvim/plugins/coding.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 659a28ab..d143852f 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -103,7 +103,6 @@ return { "garymjr/nvim-snippets", opts = { friendly_snippets = true, - global_snippets = { "all", "global" }, }, dependencies = { "rafamadriz/friendly-snippets" }, }, From 425dadef72e2af17eb45faf7bf45f7d74276ad72 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 28 May 2024 19:31:22 +0200 Subject: [PATCH 418/526] fix(snippets): show actual error for failed snippet --- lua/lazyvim/util/cmp.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/util/cmp.lua b/lua/lazyvim/util/cmp.lua index 0603b20d..1c9ad419 100644 --- a/lua/lazyvim/util/cmp.lua +++ b/lua/lazyvim/util/cmp.lua @@ -95,12 +95,13 @@ function M.expand(snippet) -- See: https://github.com/LazyVim/LazyVim/issues/3199 local session = vim.snippet.active() and vim.snippet._session or nil - local ok = pcall(vim.snippet.expand, snippet) + local ok, err = pcall(vim.snippet.expand, snippet) if not ok then local fixed = M.snippet_fix(snippet) ok = pcall(vim.snippet.expand, fixed) - local msg = ok and "Failed to parse snippet,\nbut was able to fix it automatically." or "Failed to parse snippet." + local msg = ok and "Failed to parse snippet,\nbut was able to fix it automatically." + or ("Failed to parse snippet.\n" .. err) LazyVim[ok and "warn" or "error"]( ([[%s From eb0da3c92f2aee00ce951410ec820ce2f63490d8 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 28 May 2024 19:31:59 +0200 Subject: [PATCH 419/526] feat(snippets): try to use the snippet parse to get a preview --- lua/lazyvim/util/cmp.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lua/lazyvim/util/cmp.lua b/lua/lazyvim/util/cmp.lua index 1c9ad419..a3f83d79 100644 --- a/lua/lazyvim/util/cmp.lua +++ b/lua/lazyvim/util/cmp.lua @@ -1,6 +1,8 @@ ---@class lazyvim.util.cmp local M = {} +---@alias Placeholder {n:number, text:string} + ---@param snippet string ---@param fn fun(placeholder:Placeholder):string ---@return string @@ -15,10 +17,13 @@ end ---@param snippet string ---@return string function M.snippet_preview(snippet) - local ret = M.snippet_replace(snippet, function(placeholder) - return M.snippet_preview(placeholder.text) - end):gsub("%$0", "") - return ret + local ok, parsed = pcall(function() + return vim.lsp._snippet_grammar.parse(snippet) + end) + return ok and tostring(parsed) + or M.snippet_replace(snippet, function(placeholder) + return M.snippet_preview(placeholder.text) + end):gsub("%$0", "") end -- This function replaces nested placeholders in a snippet with LSP placeholders. From 1b86d7b2ade1dc934165fb1de8e5a3b211bc5ee0 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 28 May 2024 19:32:21 +0200 Subject: [PATCH 420/526] fix(snippets): fix snippets with multiple placeholders for the same tabstop --- lua/lazyvim/util/cmp.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/lazyvim/util/cmp.lua b/lua/lazyvim/util/cmp.lua index a3f83d79..e4a7f700 100644 --- a/lua/lazyvim/util/cmp.lua +++ b/lua/lazyvim/util/cmp.lua @@ -28,10 +28,10 @@ end -- This function replaces nested placeholders in a snippet with LSP placeholders. function M.snippet_fix(snippet) - local nn = 0 + local texts = {} ---@type table return M.snippet_replace(snippet, function(placeholder) - nn = nn + 1 - return "${" .. nn .. ":" .. M.snippet_preview(placeholder.text) .. "}" + texts[placeholder.n] = texts[placeholder.n] or M.snippet_preview(placeholder.text) + return "${" .. placeholder.n .. ":" .. texts[placeholder.n] .. "}" end) end From 0160851a2503ada6fda329a230a21307b8ef966a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 23:04:16 +0200 Subject: [PATCH 421/526] chore(main): release 11.11.0 (#3351) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7cda40e..b742f8b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [11.11.0](https://github.com/LazyVim/LazyVim/compare/v11.10.0...v11.11.0) (2024-05-28) + + +### Features + +* **snippets:** try to use the snippet parse to get a preview ([eb0da3c](https://github.com/LazyVim/LazyVim/commit/eb0da3c92f2aee00ce951410ec820ce2f63490d8)) + + +### Bug Fixes + +* **nvim-snippets:** no longer needed to set global_snippets ([9149358](https://github.com/LazyVim/LazyVim/commit/91493588a8580cc216ee63cdc98b4462c54b45a7)) +* **snippets:** fix snippets with multiple placeholders for the same tabstop ([1b86d7b](https://github.com/LazyVim/LazyVim/commit/1b86d7b2ade1dc934165fb1de8e5a3b211bc5ee0)) +* **snippets:** show actual error for failed snippet ([425dade](https://github.com/LazyVim/LazyVim/commit/425dadef72e2af17eb45faf7bf45f7d74276ad72)) + ## [11.10.0](https://github.com/LazyVim/LazyVim/compare/v11.9.0...v11.10.0) (2024-05-28) From 54d687383def060ef8a9106970bb904369ced848 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 28 May 2024 21:10:45 +0200 Subject: [PATCH 422/526] style: cleanup --- lua/lazyvim/plugins/extras/coding/copilot-chat.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua index d87326c5..e47c90ab 100644 --- a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua +++ b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua @@ -59,11 +59,10 @@ return { end, config = function(_, opts) local chat = require("CopilotChat") - local ns = vim.api.nvim_create_namespace("copilot-chat-text-hl") vim.api.nvim_create_autocmd("BufEnter", { pattern = "copilot-chat", - callback = function(ev) + callback = function() vim.opt_local.relativenumber = false vim.opt_local.number = false end, From 4bbeb37a18b02fc0c1bb5050dce4358b51583968 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 29 May 2024 14:19:03 +0200 Subject: [PATCH 423/526] fix(lsp): fix LazyVim's `on_file_rename` to work according to the lsp spec --- lua/lazyvim/plugins/lsp/init.lua | 9 ++++++++- lua/lazyvim/util/lsp.lua | 18 +++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index b183464e..105e7108 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -53,7 +53,14 @@ return { enabled = true, }, -- add any global capabilities here - capabilities = {}, + capabilities = { + workspace = { + fileOperations = { + didRename = true, + willRename = true, + }, + }, + }, -- options for vim.lsp.buf.format -- `bufnr` and `filter` is handled by the LazyVim formatter, -- but can be also overridden when specified diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index adc1be0d..86e14748 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -120,22 +120,22 @@ end ---@param from string ---@param to string function M.on_rename(from, to) + local changes = { files = { { + oldUri = vim.uri_from_fname(from), + newUri = vim.uri_from_fname(to), + } } } + local clients = M.get_clients() for _, client in ipairs(clients) do if client.supports_method("workspace/willRenameFiles") then - ---@diagnostic disable-next-line: invisible - local resp = client.request_sync("workspace/willRenameFiles", { - files = { - { - oldUri = vim.uri_from_fname(from), - newUri = vim.uri_from_fname(to), - }, - }, - }, 1000, 0) + local resp = client.request_sync("workspace/willRenameFiles", changes, 1000, 0) if resp and resp.result ~= nil then vim.lsp.util.apply_workspace_edit(resp.result, client.offset_encoding) end end + if client.supports_method("workspace/didRenameFiles") then + client.notify("workspace/didRenameFiles", changes) + end end end From b949dba489abae54ba28540da06f360d6fb2788d Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 29 May 2024 14:40:36 +0200 Subject: [PATCH 424/526] feat(lsp): added leader-cR to rename the current file and to lsp rename operations --- lua/lazyvim/plugins/lsp/keymaps.lua | 3 +++ lua/lazyvim/util/lsp.lua | 36 ++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/lsp/keymaps.lua b/lua/lazyvim/plugins/lsp/keymaps.lua index 65db0057..460a4cfd 100644 --- a/lua/lazyvim/plugins/lsp/keymaps.lua +++ b/lua/lazyvim/plugins/lsp/keymaps.lua @@ -25,6 +25,9 @@ function M.get() { "ca", vim.lsp.buf.code_action, desc = "Code Action", mode = { "n", "v" }, has = "codeAction" }, { "cc", vim.lsp.codelens.run, desc = "Run Codelens", mode = { "n", "v" }, has = "codeLens" }, { "cC", vim.lsp.codelens.refresh, desc = "Refresh & Display Codelens", mode = { "n" }, has = "codeLens" }, + { "cC", vim.lsp.codelens.refresh, desc = "Refresh & Display Codelens", mode = { "n" }, has = "codeLens" }, + { "cR", LazyVim.lsp.rename_file, desc = "Rename File", mode ={"n"}, has = "workspace/didRenameFiles"}, + { "cR", LazyVim.lsp.rename_file, desc = "Rename File", mode ={"n"}, has = "workspace/willRenameFiles"}, { "cA", function() diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index 86e14748..05070beb 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -117,9 +117,36 @@ function M.on_supports_method(method, fn) }) end +function M.rename_file() + local buf = vim.api.nvim_get_current_buf() + local old = assert(LazyVim.root.realpath(vim.api.nvim_buf_get_name(buf))) + local root = assert(LazyVim.root.realpath(LazyVim.root.get({ normalize = true }))) + assert(old:find(root, 1, true) == 1, "File not in project root") + + local extra = old:sub(#root + 2) + + vim.ui.input({ + prompt = "New File Name: ", + default = extra, + }, function(new) + if not new or new == "" or new == extra then + return + end + new = LazyVim.norm(root .. "/" .. new) + vim.fn.mkdir(vim.fs.dirname(new), "p") + M.on_rename(old, new, function() + vim.fn.rename(old, new) + vim.cmd.edit(new) + vim.api.nvim_buf_delete(buf, { force = true }) + vim.fn.delete(old) + end) + end) +end + ---@param from string ---@param to string -function M.on_rename(from, to) +---@param rename? fun() +function M.on_rename(from, to, rename) local changes = { files = { { oldUri = vim.uri_from_fname(from), newUri = vim.uri_from_fname(to), @@ -133,6 +160,13 @@ function M.on_rename(from, to) vim.lsp.util.apply_workspace_edit(resp.result, client.offset_encoding) end end + end + + if rename then + rename() + end + + for _, client in ipairs(clients) do if client.supports_method("workspace/didRenameFiles") then client.notify("workspace/didRenameFiles", changes) end From cf46d265ff9595be14c4f6d65bcb442d1e54f7c1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 29 May 2024 12:46:34 +0000 Subject: [PATCH 425/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index ac8e7259..ffd96e4b 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 28 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 29 ============================================================================== Table of Contents *LazyVim-table-of-contents* From fba06ce9f522b91be8a342f9c028948c2733132d Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 29 May 2024 15:10:53 +0200 Subject: [PATCH 426/526] feat(typescript)!: the typescript extra now uses vtsls instead of tsserver. You may want to update your lsp settings. --- .../plugins/extras/lang/typescript.lua | 109 +++++++++++------- lua/lazyvim/plugins/extras/lang/vue.lua | 20 ++-- lua/lazyvim/plugins/lsp/init.lua | 12 +- 3 files changed, 84 insertions(+), 57 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua index 414f11da..95014677 100644 --- a/lua/lazyvim/plugins/extras/lang/typescript.lua +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -1,14 +1,3 @@ -local inlay_hints_settings = { - includeInlayEnumMemberValueHints = true, - includeInlayFunctionLikeReturnTypeHints = true, - includeInlayFunctionParameterTypeHints = true, - includeInlayParameterNameHints = "literals", - includeInlayParameterNameHintsWhenArgumentMatchesName = false, - includeInlayPropertyDeclarationTypeHints = true, - includeInlayVariableTypeHints = false, - includeInlayVariableTypeHintsWhenTypeMatchesName = false, -} - return { recommended = function() return LazyVim.extras.wants({ @@ -24,13 +13,12 @@ return { }) end, - -- add typescript to treesitter { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - if type(opts.ensure_installed) == "table" then - vim.list_extend(opts.ensure_installed, { "typescript", "tsx" }) - end + "yioneko/nvim-vtsls", + lazy = true, + opts = {}, + config = function(_, opts) + require("vtsls").config(opts) end, }, @@ -40,52 +28,85 @@ return { opts = { -- make sure mason installs the server servers = { - ---@type lspconfig.options.tsserver tsserver = { + enabled = false, + }, + vtsls = { + settings = { + complete_function_calls = true, + typescript = { + updateImportsOnFileMove = { enabled = "always" }, + enableMoveToFileCodeAction = true, + experimental = { + completion = { + enableServerSideFuzzyMatch = true, + }, + }, + suggest = { + completeFunctionCalls = true, + }, + inlayHints = { + enumMemberValues = { enabled = true }, + functionLikeReturnTypes = { enabled = true }, + parameterNames = { enabled = "literals" }, + parameterTypes = { enabled = true }, + propertyDeclarationTypes = { enabled = true }, + variableTypes = { enabled = false }, + }, + }, + }, keys = { + { + "gD", + function() + require("vtsls").commands.goto_source_definition(0) + end, + desc = "Goto Source Definition", + }, { "co", function() - vim.lsp.buf.code_action({ - apply = true, - context = { - only = { "source.organizeImports.ts" }, - diagnostics = {}, - }, - }) + require("vtsls").commands.organize_imports(0) end, desc = "Organize Imports", }, { - "cR", + "cM", function() - vim.lsp.buf.code_action({ - apply = true, - context = { - only = { "source.removeUnused.ts" }, - diagnostics = {}, - }, - }) + require("vtsls").commands.add_missing_imports(0) end, - desc = "Remove Unused Imports", + desc = "Add missing imports", }, - }, - settings = { - typescript = { - inlayHints = inlay_hints_settings, - }, - javascript = { - inlayHints = inlay_hints_settings, - }, - completions = { - completeFunctionCalls = true, + { + "cD", + function() + require("vtsls").commands.fix_all(0) + end, + desc = "Fix all diagnostics", }, }, }, }, + setup = { + tsserver = function() + -- disable tsserver + return true + end, + }, }, }, + { + "neovim/nvim-lspconfig", + opts = function(_, opts) + -- copy typescript settings to javascript + opts.servers.vtsls.settings.javascript = vim.deepcopy(opts.servers.vtsls.settings.typescript) + + -- add vtsls to lspconfig + require("lspconfig.configs").vtsls = require("vtsls").lspconfig + end, + }, + { "mfussenegger/nvim-dap", optional = true, diff --git a/lua/lazyvim/plugins/extras/lang/vue.lua b/lua/lazyvim/plugins/extras/lang/vue.lua index 2ce87c03..36bac9a2 100644 --- a/lua/lazyvim/plugins/extras/lang/vue.lua +++ b/lua/lazyvim/plugins/extras/lang/vue.lua @@ -26,14 +26,18 @@ return { volar = {}, -- Volar 2.0 has discontinued their "take over mode" which in previous version provided support for typescript in vue files. -- The new approach to get typescript support involves using the typescript language server along side volar. - tsserver = { - init_options = { - plugins = { - -- Use typescript language server along with vue typescript plugin - { - name = "@vue/typescript-plugin", - location = vue_typescript_plugin, - languages = { "javascript", "typescript", "vue" }, + vtsls = { + settings = { + vtsls = { + tsserver = { + globalPlugins = { + -- Use typescript language server along with vue typescript plugin + { + name = "@vue/typescript-plugin", + location = vue_typescript_plugin, + languages = { "vue" }, + }, + }, }, }, }, diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 105e7108..a2e5286a 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -225,11 +225,13 @@ return { for server, server_opts in pairs(servers) do if server_opts then server_opts = server_opts == true and {} or server_opts - -- run manual setup if mason=false or if this is a server that cannot be installed with mason-lspconfig - if server_opts.mason == false or not vim.tbl_contains(all_mslp_servers, server) then - setup(server) - elseif server_opts.enabled ~= false then - ensure_installed[#ensure_installed + 1] = server + if server_opts.enabled ~= false then + -- run manual setup if mason=false or if this is a server that cannot be installed with mason-lspconfig + if server_opts.mason == false or not vim.tbl_contains(all_mslp_servers, server) then + setup(server) + else + ensure_installed[#ensure_installed + 1] = server + end end end end From f6bcf6f12c9a9f5ac256b394155d8a9649c6beda Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 29 May 2024 15:39:17 +0200 Subject: [PATCH 427/526] fix(lsp): fix ts/deno both attaching --- lua/lazyvim/plugins/lsp/init.lua | 4 ++-- lua/lazyvim/util/lsp.lua | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index a2e5286a..414bb655 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -247,9 +247,9 @@ return { }) end - if LazyVim.lsp.get_config("denols") and LazyVim.lsp.get_config("tsserver") then + if LazyVim.lsp.is_enabled("denols") and LazyVim.lsp.is_enabled("vtsls") then local is_deno = require("lspconfig.util").root_pattern("deno.json", "deno.jsonc") - LazyVim.lsp.disable("tsserver", is_deno) + LazyVim.lsp.disable("vtsls", is_deno) LazyVim.lsp.disable("denols", function(root_dir) return not is_deno(root_dir) end) diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index 05070beb..b68f7349 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -179,6 +179,11 @@ function M.get_config(server) return rawget(configs, server) end +function M.is_enabled(server) + local c = M.get_config(server) + return c and c.enabled ~= false +end + ---@param server string ---@param cond fun( root_dir, config): boolean function M.disable(server, cond) From 4dfd5c2596ff427a1232e6624add093d5b4da82e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 29 May 2024 16:02:13 +0200 Subject: [PATCH 428/526] fix(lsp): create `gr` with `nowait=true` --- lua/lazyvim/plugins/lsp/keymaps.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/lsp/keymaps.lua b/lua/lazyvim/plugins/lsp/keymaps.lua index 460a4cfd..b667ab0c 100644 --- a/lua/lazyvim/plugins/lsp/keymaps.lua +++ b/lua/lazyvim/plugins/lsp/keymaps.lua @@ -15,7 +15,7 @@ function M.get() M._keys = { { "cl", "LspInfo", desc = "Lsp Info" }, { "gd", function() require("telescope.builtin").lsp_definitions({ reuse_win = true }) end, desc = "Goto Definition", has = "definition" }, - { "gr", "Telescope lsp_references", desc = "References" }, + { "gr", "Telescope lsp_references", desc = "References", nowait = true }, { "gD", vim.lsp.buf.declaration, desc = "Goto Declaration" }, { "gI", function() require("telescope.builtin").lsp_implementations({ reuse_win = true }) end, desc = "Goto Implementation" }, { "gy", function() require("telescope.builtin").lsp_type_definitions({ reuse_win = true }) end, desc = "Goto T[y]pe Definition" }, From 38b8736b81870a01f4464c9dd07d545ea57b95fc Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 29 May 2024 16:02:38 +0200 Subject: [PATCH 429/526] feat(typescript): added `gR` to goto file references --- lua/lazyvim/plugins/extras/lang/typescript.lua | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua index 95014677..60631f21 100644 --- a/lua/lazyvim/plugins/extras/lang/typescript.lua +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -34,9 +34,11 @@ return { vtsls = { settings = { complete_function_calls = true, + vtsls = { + enableMoveToFileCodeAction = true, + }, typescript = { updateImportsOnFileMove = { enabled = "always" }, - enableMoveToFileCodeAction = true, experimental = { completion = { enableServerSideFuzzyMatch = true, @@ -63,6 +65,13 @@ return { end, desc = "Goto Source Definition", }, + { + "gR", + function() + require("vtsls").commands.file_references(0) + end, + desc = "File References", + }, { "co", function() @@ -101,9 +110,6 @@ return { opts = function(_, opts) -- copy typescript settings to javascript opts.servers.vtsls.settings.javascript = vim.deepcopy(opts.servers.vtsls.settings.typescript) - - -- add vtsls to lspconfig - require("lspconfig.configs").vtsls = require("vtsls").lspconfig end, }, From 01e6718e034d4a66bbdecef35f12c71bbde519fe Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 29 May 2024 16:31:16 +0200 Subject: [PATCH 430/526] fix(lsp): added support for `has` as array for lsp keymaps --- lua/lazyvim/plugins/lsp/keymaps.lua | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/plugins/lsp/keymaps.lua b/lua/lazyvim/plugins/lsp/keymaps.lua index b667ab0c..9a9aab38 100644 --- a/lua/lazyvim/plugins/lsp/keymaps.lua +++ b/lua/lazyvim/plugins/lsp/keymaps.lua @@ -3,8 +3,8 @@ local M = {} ---@type LazyKeysLspSpec[]|nil M._keys = nil ----@alias LazyKeysLspSpec LazyKeysSpec|{has?:string, cond?:fun():boolean} ----@alias LazyKeysLsp LazyKeys|{has?:string, cond?:fun():boolean} +---@alias LazyKeysLspSpec LazyKeysSpec|{has?:string|string[], cond?:fun():boolean} +---@alias LazyKeysLsp LazyKeys|{has?:string|string[], cond?:fun():boolean} ---@return LazyKeysLspSpec[] function M.get() @@ -26,8 +26,7 @@ function M.get() { "cc", vim.lsp.codelens.run, desc = "Run Codelens", mode = { "n", "v" }, has = "codeLens" }, { "cC", vim.lsp.codelens.refresh, desc = "Refresh & Display Codelens", mode = { "n" }, has = "codeLens" }, { "cC", vim.lsp.codelens.refresh, desc = "Refresh & Display Codelens", mode = { "n" }, has = "codeLens" }, - { "cR", LazyVim.lsp.rename_file, desc = "Rename File", mode ={"n"}, has = "workspace/didRenameFiles"}, - { "cR", LazyVim.lsp.rename_file, desc = "Rename File", mode ={"n"}, has = "workspace/willRenameFiles"}, + { "cR", LazyVim.lsp.rename_file, desc = "Rename File", mode ={"n"}, has = { "workspace/didRenameFiles", "workspace/willRenameFiles" } }, { "cA", function() @@ -69,8 +68,16 @@ function M.get() return M._keys end ----@param method string +---@param method string|string[] function M.has(buffer, method) + if type(method) == "table" then + for _, m in ipairs(method) do + if M.has(buffer, m) then + return true + end + end + return false + end method = method:find("/") and method or "textDocument/" .. method local clients = LazyVim.lsp.get_clients({ bufnr = buffer }) for _, client in ipairs(clients) do From 804756209e314d9bd466584e75aee37912b75223 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 29 May 2024 16:39:02 +0200 Subject: [PATCH 431/526] fix(lsp): remove duplicate keymap --- lua/lazyvim/plugins/lsp/keymaps.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/lazyvim/plugins/lsp/keymaps.lua b/lua/lazyvim/plugins/lsp/keymaps.lua index 9a9aab38..d56cee08 100644 --- a/lua/lazyvim/plugins/lsp/keymaps.lua +++ b/lua/lazyvim/plugins/lsp/keymaps.lua @@ -25,7 +25,6 @@ function M.get() { "ca", vim.lsp.buf.code_action, desc = "Code Action", mode = { "n", "v" }, has = "codeAction" }, { "cc", vim.lsp.codelens.run, desc = "Run Codelens", mode = { "n", "v" }, has = "codeLens" }, { "cC", vim.lsp.codelens.refresh, desc = "Refresh & Display Codelens", mode = { "n" }, has = "codeLens" }, - { "cC", vim.lsp.codelens.refresh, desc = "Refresh & Display Codelens", mode = { "n" }, has = "codeLens" }, { "cR", LazyVim.lsp.rename_file, desc = "Rename File", mode ={"n"}, has = { "workspace/didRenameFiles", "workspace/willRenameFiles" } }, { "cA", From 0975eeb9add54b1dc65f4c3874edd8e35e527099 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 29 May 2024 18:22:54 +0200 Subject: [PATCH 432/526] feat(vscode): added ts-comments to allow list for vscode --- lua/lazyvim/plugins/extras/vscode.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/vscode.lua b/lua/lazyvim/plugins/extras/vscode.lua index 49172cdb..25930d1d 100644 --- a/lua/lazyvim/plugins/extras/vscode.lua +++ b/lua/lazyvim/plugins/extras/vscode.lua @@ -15,6 +15,7 @@ local enabled = { "nvim-treesitter", "nvim-treesitter-textobjects", "nvim-ts-context-commentstring", + "ts-comments.nvim", "vim-repeat", "yanky.nvim", "LazyVim", From a13457eea3edf9b409e93e0391a5c206e0260022 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 29 May 2024 21:38:05 +0200 Subject: [PATCH 433/526] fix(trouble_v3): set correct lualine section background color --- lua/lazyvim/plugins/extras/editor/trouble-v3.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/editor/trouble-v3.lua b/lua/lazyvim/plugins/extras/editor/trouble-v3.lua index 9b6b8528..d7ceff2e 100644 --- a/lua/lazyvim/plugins/extras/editor/trouble-v3.lua +++ b/lua/lazyvim/plugins/extras/editor/trouble-v3.lua @@ -72,6 +72,7 @@ return { title = false, filter = { range = true }, format = "{kind_icon}{symbol.name:Normal}", + hl_group = "lualine_c_normal", }) table.insert(opts.sections.lualine_c, { symbols.get, From 3ace8277e54370c0aa3d17e61018cf039c42d69b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 29 May 2024 22:35:40 +0200 Subject: [PATCH 434/526] feat(keymaps): new keymap to toggle mazimize of current window leader-m or leader-wm --- lua/lazyvim/config/keymaps.lua | 2 ++ lua/lazyvim/plugins/extras/ui/mini-animate.lua | 2 +- lua/lazyvim/util/toggle.lua | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index a6ac8f3c..2bb782fc 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -177,6 +177,8 @@ map("n", "w-", "s", { desc = "Split Window Below", remap = true }) map("n", "w|", "v", { desc = "Split Window Right", remap = true }) map("n", "-", "s", { desc = "Split Window Below", remap = true }) map("n", "|", "v", { desc = "Split Window Right", remap = true }) +map("n", "wm", function() LazyVim.toggle.maximize() end, { desc = "Maximize Toggle" }) +map("n", "m", function() LazyVim.toggle.maximize() end, { desc = "Maximize Toggle" }) -- tabs map("n", "l", "tablast", { desc = "Last Tab" }) diff --git a/lua/lazyvim/plugins/extras/ui/mini-animate.lua b/lua/lazyvim/plugins/extras/ui/mini-animate.lua index cca34135..c1f44d6d 100644 --- a/lua/lazyvim/plugins/extras/ui/mini-animate.lua +++ b/lua/lazyvim/plugins/extras/ui/mini-animate.lua @@ -17,7 +17,7 @@ return { local animate = require("mini.animate") return { resize = { - timing = animate.gen_timing.linear({ duration = 100, unit = "total" }), + timing = animate.gen_timing.linear({ duration = 50, unit = "total" }), }, scroll = { timing = animate.gen_timing.linear({ duration = 150, unit = "total" }), diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index 543d4c13..b001798f 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -73,6 +73,23 @@ function M.inlay_hints(buf, value) end end +M._maximized = nil +function M.maximize() + if M._maximized then + vim.o.winwidth = M._maximized.width + vim.o.winheight = M._maximized.height + M._maximized = nil + vim.cmd("wincmd =") + else + M._maximized = { + width = vim.o.winwidth, + height = vim.o.winheight, + } + vim.o.winwidth = 999 + vim.o.winheight = 999 + end +end + setmetatable(M, { __call = function(m, ...) return m.option(...) From 80143069ff192beaed893ebc4e252adf33936e72 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 22:37:15 +0200 Subject: [PATCH 435/526] chore(main): release 12.0.0 (#3357) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b742f8b6..5d9880d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,30 @@ # Changelog +## [12.0.0](https://github.com/LazyVim/LazyVim/compare/v11.11.0...v12.0.0) (2024-05-29) + + +### ⚠ BREAKING CHANGES + +* **typescript:** the typescript extra now uses vtsls instead of tsserver. You may want to update your lsp settings. + +### Features + +* **keymaps:** new keymap to toggle mazimize of current window leader-m or leader-wm ([3ace827](https://github.com/LazyVim/LazyVim/commit/3ace8277e54370c0aa3d17e61018cf039c42d69b)) +* **lsp:** added leader-cR to rename the current file and to lsp rename operations ([b949dba](https://github.com/LazyVim/LazyVim/commit/b949dba489abae54ba28540da06f360d6fb2788d)) +* **typescript:** added `gR` to goto file references ([38b8736](https://github.com/LazyVim/LazyVim/commit/38b8736b81870a01f4464c9dd07d545ea57b95fc)) +* **typescript:** the typescript extra now uses vtsls instead of tsserver. You may want to update your lsp settings. ([fba06ce](https://github.com/LazyVim/LazyVim/commit/fba06ce9f522b91be8a342f9c028948c2733132d)) +* **vscode:** added ts-comments to allow list for vscode ([0975eeb](https://github.com/LazyVim/LazyVim/commit/0975eeb9add54b1dc65f4c3874edd8e35e527099)) + + +### Bug Fixes + +* **lsp:** added support for `has` as array for lsp keymaps ([01e6718](https://github.com/LazyVim/LazyVim/commit/01e6718e034d4a66bbdecef35f12c71bbde519fe)) +* **lsp:** create `gr` with `nowait=true` ([4dfd5c2](https://github.com/LazyVim/LazyVim/commit/4dfd5c2596ff427a1232e6624add093d5b4da82e)) +* **lsp:** fix LazyVim's `on_file_rename` to work according to the lsp spec ([4bbeb37](https://github.com/LazyVim/LazyVim/commit/4bbeb37a18b02fc0c1bb5050dce4358b51583968)) +* **lsp:** fix ts/deno both attaching ([f6bcf6f](https://github.com/LazyVim/LazyVim/commit/f6bcf6f12c9a9f5ac256b394155d8a9649c6beda)) +* **lsp:** remove duplicate keymap ([8047562](https://github.com/LazyVim/LazyVim/commit/804756209e314d9bd466584e75aee37912b75223)) +* **trouble_v3:** set correct lualine section background color ([a13457e](https://github.com/LazyVim/LazyVim/commit/a13457eea3edf9b409e93e0391a5c206e0260022)) + ## [11.11.0](https://github.com/LazyVim/LazyVim/compare/v11.10.0...v11.11.0) (2024-05-28) From 2a7d163a8a6de2a5ad58b240770d90e6e5947638 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 30 May 2024 00:27:10 +0200 Subject: [PATCH 436/526] feat(copilot-chat): add cmp integration --- lua/lazyvim/plugins/extras/coding/copilot-chat.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua index e47c90ab..8cd0e2d1 100644 --- a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua +++ b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua @@ -59,6 +59,7 @@ return { end, config = function(_, opts) local chat = require("CopilotChat") + require("CopilotChat.integrations.cmp").setup() vim.api.nvim_create_autocmd("BufEnter", { pattern = "copilot-chat", From a224ef2a73dd1e8b358179aab8fa36c1b6745b26 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 30 May 2024 07:18:41 +0200 Subject: [PATCH 437/526] fix(clangd): switch source/header is now leader-ch. Fixes #3363 --- lua/lazyvim/plugins/extras/lang/clangd.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/clangd.lua b/lua/lazyvim/plugins/extras/lang/clangd.lua index 44e2f64c..86a1afe7 100644 --- a/lua/lazyvim/plugins/extras/lang/clangd.lua +++ b/lua/lazyvim/plugins/extras/lang/clangd.lua @@ -62,7 +62,7 @@ return { -- Ensure mason installs the server clangd = { keys = { - { "cR", "ClangdSwitchSourceHeader", desc = "Switch Source/Header (C/C++)" }, + { "ch", "ClangdSwitchSourceHeader", desc = "Switch Source/Header (C/C++)" }, }, root_dir = function(fname) return require("lspconfig.util").root_pattern( From 2e5e46d9ff8ea11c805a40dec5cdb2beb9272c6c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 30 May 2024 05:19:20 +0000 Subject: [PATCH 438/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index ffd96e4b..569245db 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 29 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 30 ============================================================================== Table of Contents *LazyVim-table-of-contents* From b285a46dfcde44aa2ab4f5acbbc4a2a18cc1f16b Mon Sep 17 00:00:00 2001 From: Rubin Bhandari Date: Thu, 30 May 2024 13:42:10 +0545 Subject: [PATCH 439/526] feat(typescript): vtls add select ts version (#3366) --- lua/lazyvim/plugins/extras/lang/typescript.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua index 60631f21..74fa1a9e 100644 --- a/lua/lazyvim/plugins/extras/lang/typescript.lua +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -93,6 +93,13 @@ return { end, desc = "Fix all diagnostics", }, + { + "cV", + function() + require("vtsls").commands.select_ts_version(0) + end, + desc = "Select TS workspace version", + }, }, }, }, From 7414e84af96941fbe74555951ca6f5a58530775d Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 30 May 2024 11:03:02 +0200 Subject: [PATCH 440/526] fix(root): escape glob expressions --- lua/lazyvim/util/root.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/root.lua b/lua/lazyvim/util/root.lua index f1167337..4523f3cf 100644 --- a/lua/lazyvim/util/root.lua +++ b/lua/lazyvim/util/root.lua @@ -52,7 +52,7 @@ function M.detectors.pattern(buf, patterns) if name == p then return true end - if p:sub(1, 1) == "*" and name:find(p:sub(2) .. "$") then + if p:sub(1, 1) == "*" and name:find(vim.pesc(p:sub(2)) .. "$") then return true end end From c4b75059697a85c77e4d85e18e37ebb6f278cf2a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 30 May 2024 11:03:18 +0200 Subject: [PATCH 441/526] fix(extras): show recommended languages above enabled plugins --- lua/lazyvim/util/extras.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/util/extras.lua b/lua/lazyvim/util/extras.lua index 773f6b9e..aa8ea575 100644 --- a/lua/lazyvim/util/extras.lua +++ b/lua/lazyvim/util/extras.lua @@ -218,8 +218,14 @@ function X:render() for _, extra in ipairs(self.extras) do extra.section = nil end + self:section({ + recommended = true, + enabled = false, + include = "^lang%.", + title = "Recommended Languages", + empty = false, + }) self:section({ enabled = true, title = "Enabled" }) - self:section({ recommended = true, include = "^lang%.", title = "Recommended Languages", empty = false }) self:section({ recommended = true, title = "Recommended Plugins", empty = false }) self:section({ title = "Plugins", exclude = "^lang%." }) self:section({ title = "Languages" }) From cf6775a959de7df314a8db1c208daed33a70f0c4 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 30 May 2024 11:17:08 +0200 Subject: [PATCH 442/526] fix(typescript): allow easier merging of ts plugins --- .../plugins/extras/lang/typescript.lua | 19 +++++++++++-------- lua/lazyvim/plugins/extras/lang/vue.lua | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua index 74fa1a9e..d00443ad 100644 --- a/lua/lazyvim/plugins/extras/lang/typescript.lua +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -108,18 +108,21 @@ return { -- disable tsserver return true end, + vtsls = function(_, opts) + -- copy typescript settings to javascript + opts.settings.javascript = + vim.tbl_deep_extend("force", {}, opts.settings.typescript, opts.settings.javascript or {}) + local plugins = vim.tbl_get(opts.settings, "vtsls", "tsserver", "globalPlugins") + -- allow plugins to have a key for proper merging + -- remove the key here + if plugins then + opts.settings.vtsls.tsserver.globalPlugins = vim.tbl_values(plugins) + end + end, }, }, }, - { - "neovim/nvim-lspconfig", - opts = function(_, opts) - -- copy typescript settings to javascript - opts.servers.vtsls.settings.javascript = vim.deepcopy(opts.servers.vtsls.settings.typescript) - end, - }, - { "mfussenegger/nvim-dap", optional = true, diff --git a/lua/lazyvim/plugins/extras/lang/vue.lua b/lua/lazyvim/plugins/extras/lang/vue.lua index 36bac9a2..dfc1d2f7 100644 --- a/lua/lazyvim/plugins/extras/lang/vue.lua +++ b/lua/lazyvim/plugins/extras/lang/vue.lua @@ -32,7 +32,7 @@ return { tsserver = { globalPlugins = { -- Use typescript language server along with vue typescript plugin - { + vue = { name = "@vue/typescript-plugin", location = vue_typescript_plugin, languages = { "vue" }, From e7d4b397b291ec8854673e813ae67103bc75e15d Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 30 May 2024 11:17:21 +0200 Subject: [PATCH 443/526] feat(extras): simple extra for astro --- lua/lazyvim/plugins/extras/lang/astro.lua | 30 +++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lang/astro.lua diff --git a/lua/lazyvim/plugins/extras/lang/astro.lua b/lua/lazyvim/plugins/extras/lang/astro.lua new file mode 100644 index 00000000..67af3e4d --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/astro.lua @@ -0,0 +1,30 @@ +return { + recommended = function() + return LazyVim.extras.wants({ + ft = "astro", + root = { + "astro.config.js", + "astro.config.mjs", + "astro.config.cjs", + }, + }) + end, + + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + if type(opts.ensure_installed) == "table" then + vim.list_extend(opts.ensure_installed, { "astro" }) + end + end, + }, + + { + "neovim/nvim-lspconfig", + opts = { + servers = { + astro = {}, + }, + }, + }, +} From c2ef09227ee59692f931fd7d4183759d1a82ac02 Mon Sep 17 00:00:00 2001 From: Rubin Bhandari Date: Thu, 30 May 2024 15:02:55 +0545 Subject: [PATCH 444/526] fix: remove lazygit log gl keymap when on gitui (#3371) --- lua/lazyvim/plugins/extras/util/gitui.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/util/gitui.lua b/lua/lazyvim/plugins/extras/util/gitui.lua index d78c4f81..2a7a4fa6 100644 --- a/lua/lazyvim/plugins/extras/util/gitui.lua +++ b/lua/lazyvim/plugins/extras/util/gitui.lua @@ -26,6 +26,7 @@ return { once = true, callback = function() pcall(vim.keymap.del, "n", "gf") + pcall(vim.keymap.del, "n", "gl") end, }) end, From ae098d67d6842ccc097f5a10616369b60dfe6701 Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Thu, 30 May 2024 15:29:09 +0600 Subject: [PATCH 445/526] fix(typescript): vtsls server expe settings (#3372) Based on [vtsls schema](https://github.com/yioneko/vtsls/blob/bd2df5a2d45cbc087e4fe285ec7c7396fd96e9cf/packages/service/configuration.schema.json#L1092), experimental setting should be vtsls property not typescript. ```json "vtsls.experimental.completion.enableServerSideFuzzyMatch": { "default": false, "type": "boolean", "description": "Execute fuzzy match of completion items on server side. Enable this will help filter out useless completion items from tsserver." }, ``` --- lua/lazyvim/plugins/extras/lang/typescript.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua index d00443ad..d3a80569 100644 --- a/lua/lazyvim/plugins/extras/lang/typescript.lua +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -36,14 +36,14 @@ return { complete_function_calls = true, vtsls = { enableMoveToFileCodeAction = true, - }, - typescript = { - updateImportsOnFileMove = { enabled = "always" }, experimental = { completion = { enableServerSideFuzzyMatch = true, }, }, + }, + typescript = { + updateImportsOnFileMove = { enabled = "always" }, suggest = { completeFunctionCalls = true, }, From 95d055dcf7bbad34f6b8aaf94d285314ceaf6f0c Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 30 May 2024 14:41:13 +0200 Subject: [PATCH 446/526] feat: trouble v3 --- lua/lazyvim/config/init.lua | 2 +- lua/lazyvim/plugins/editor.lua | 25 ++-- .../plugins/extras/editor/trouble-v3.lua | 121 ------------------ lua/lazyvim/plugins/extras/ui/edgy.lua | 13 ++ lua/lazyvim/plugins/ui.lua | 15 +++ lua/lazyvim/util/json.lua | 4 + lua/lazyvim/util/plugin.lua | 1 + 7 files changed, 47 insertions(+), 134 deletions(-) delete mode 100644 lua/lazyvim/plugins/extras/editor/trouble-v3.lua diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 83cadffc..5cd3283e 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -132,7 +132,7 @@ local defaults = { } M.json = { - version = 5, + version = 6, data = { version = nil, ---@type string? news = {}, ---@type table diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 3c98ba8e..bd59b52b 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -238,12 +238,7 @@ return { opts = function() local actions = require("telescope.actions") - local open_with_trouble = function(...) - return require("trouble.providers.telescope").open_with_trouble(...) - end - local open_selected_with_trouble = function(...) - return require("trouble.providers.telescope").open_selected_with_trouble(...) - end + local open_with_trouble = require("trouble.sources.telescope").open local find_files_no_ignore = function() local action_state = require("telescope.actions.state") local line = action_state.get_current_line() @@ -275,7 +270,7 @@ return { mappings = { i = { [""] = open_with_trouble, - [""] = open_selected_with_trouble, + [""] = open_with_trouble, [""] = find_files_no_ignore, [""] = find_files_with_hidden, [""] = actions.cycle_history_next, @@ -424,15 +419,21 @@ return { cmd = { "TroubleToggle", "Trouble" }, opts = { use_diagnostic_signs = true }, keys = { - { "xx", "TroubleToggle document_diagnostics", desc = "Document Diagnostics (Trouble)" }, - { "xX", "TroubleToggle workspace_diagnostics", desc = "Workspace Diagnostics (Trouble)" }, - { "xL", "TroubleToggle loclist", desc = "Location List (Trouble)" }, - { "xQ", "TroubleToggle quickfix", desc = "Quickfix List (Trouble)" }, + { "xx", "Trouble diagnostics toggle", desc = "Diagnostics (Trouble)" }, + { "xX", "Trouble diagnostics toggle filter.buf=0", desc = "Buffer Diagnostics (Trouble)" }, + { "cs", "Trouble symbols toggle focus=false", desc = "Symbols (Trouble)" }, + { + "cS", + "Trouble lsp toggle focus=false win.position=right", + desc = "LSP references/definitions/... (Trouble)", + }, + { "xL", "Trouble loclist toggle", desc = "Location List (Trouble)" }, + { "xQ", "Trouble qflist toggle", desc = "Quickfix List (Trouble)" }, { "[q", function() if require("trouble").is_open() then - require("trouble").previous({ skip_groups = true, jump = true }) + require("trouble").prev({ skip_groups = true, jump = true }) else local ok, err = pcall(vim.cmd.cprev) if not ok then diff --git a/lua/lazyvim/plugins/extras/editor/trouble-v3.lua b/lua/lazyvim/plugins/extras/editor/trouble-v3.lua deleted file mode 100644 index d7ceff2e..00000000 --- a/lua/lazyvim/plugins/extras/editor/trouble-v3.lua +++ /dev/null @@ -1,121 +0,0 @@ -local Config = require("lazyvim.config") - -if vim.tbl_contains(Config.json.data.extras, "lazyvim.plugins.extras.editor.trouble-v3") then - for _, other in ipairs({ "aerial", "outline" }) do - local extra = "lazyvim.plugins.extras.editor." .. other - if vim.tbl_contains(Config.json.data.extras, extra) then - other = other:gsub("^%l", string.upper) - LazyVim.error({ - "**Trouble v3** includes support for document symbols.", - ("You currently have the **%s** extra enabled."):format(other), - "Please disable it in your config.", - }) - end - end - if vim.fn.has("nvim-0.9.2") == 0 then - LazyVim.error({ - "Trouble v3 requires Neovim >= 0.9.2", - "Please update your Neovim version.", - }) - return {} - end -end - -return { - desc = "Trouble rewrite including document symbols and a lualine component", - recommended = true, - { - "folke/trouble.nvim", - branch = "dev", - keys = { - { "xx", "Trouble diagnostics toggle", desc = "Diagnostics (Trouble)" }, - { "xX", "Trouble diagnostics toggle filter.buf=0", desc = "Buffer Diagnostics (Trouble)" }, - { "cs", "Trouble symbols toggle focus=false", desc = "Symbols (Trouble)" }, - { - "cS", - "Trouble lsp toggle focus=false win.position=right", - desc = "LSP references/definitions/... (Trouble)", - }, - { "xL", "Trouble loclist toggle", desc = "Location List (Trouble)" }, - { "xQ", "Trouble qflist toggle", desc = "Quickfix List (Trouble)" }, - { - "[q", - function() - if require("trouble").is_open() then - require("trouble").prev({ skip_groups = true, jump = true }) - else - local ok, err = pcall(vim.cmd.cprev) - if not ok then - vim.notify(err, vim.log.levels.ERROR) - end - end - end, - desc = "Previous Trouble/Quickfix Item", - }, - }, - }, - - -- lualine integration - { - "nvim-lualine/lualine.nvim", - optional = true, - opts = function(_, opts) - local trouble = require("trouble") - if not trouble.statusline then - LazyVim.error("You have enabled the **trouble-v3** extra,\nbut still need to update it with `:Lazy`") - return - end - - local symbols = trouble.statusline({ - mode = "symbols", - groups = {}, - title = false, - filter = { range = true }, - format = "{kind_icon}{symbol.name:Normal}", - hl_group = "lualine_c_normal", - }) - table.insert(opts.sections.lualine_c, { - symbols.get, - cond = symbols.has, - }) - end, - }, - - { - "folke/edgy.nvim", - optional = true, - opts = function(_, opts) - for _, pos in ipairs({ "top", "bottom", "left", "right" }) do - opts[pos] = opts[pos] or {} - table.insert(opts[pos], { - ft = "trouble", - filter = function(_buf, win) - return vim.w[win].trouble - and vim.w[win].trouble.position == pos - and vim.w[win].trouble.type == "split" - and vim.w[win].trouble.relative == "editor" - and not vim.w[win].trouble_preview - end, - }) - end - end, - }, - - { - "nvim-telescope/telescope.nvim", - optional = true, - opts = function(_, opts) - local open_with_trouble = require("trouble.sources.telescope").open - return vim.tbl_deep_extend("force", opts, { - defaults = { - mappings = { - i = { - [""] = open_with_trouble, - [""] = open_with_trouble, - }, - }, - }, - }) - end, - }, -} diff --git a/lua/lazyvim/plugins/extras/ui/edgy.lua b/lua/lazyvim/plugins/extras/ui/edgy.lua index f2249edd..4ccdc5f0 100644 --- a/lua/lazyvim/plugins/extras/ui/edgy.lua +++ b/lua/lazyvim/plugins/extras/ui/edgy.lua @@ -105,6 +105,19 @@ return { end, }, } + for _, pos in ipairs({ "top", "bottom", "left", "right" }) do + opts[pos] = opts[pos] or {} + table.insert(opts[pos], { + ft = "trouble", + filter = function(_buf, win) + return vim.w[win].trouble + and vim.w[win].trouble.position == pos + and vim.w[win].trouble.type == "split" + and vim.w[win].trouble.relative == "editor" + and not vim.w[win].trouble_preview + end, + }) + end return opts end, }, diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 0d401f23..94d72a12 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -128,6 +128,17 @@ return { vim.o.laststatus = vim.g.lualine_laststatus + local trouble = require("trouble") + local symbols = trouble.statusline + and trouble.statusline({ + mode = "symbols", + groups = {}, + title = false, + filter = { range = true }, + format = "{kind_icon}{symbol.name:Normal}", + hl_group = "lualine_c_normal", + }) + return { options = { theme = "auto", @@ -151,6 +162,10 @@ return { }, { "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } }, { LazyVim.lualine.pretty_path() }, + { + symbols and symbols.get, + cond = symbols and symbols.has, + }, }, lualine_x = { -- stylua: ignore diff --git a/lua/lazyvim/util/json.lua b/lua/lazyvim/util/json.lua index 3e17662e..60466a45 100644 --- a/lua/lazyvim/util/json.lua +++ b/lua/lazyvim/util/json.lua @@ -89,6 +89,10 @@ function M.migrate() json.data.extras = vim.tbl_filter(function(extra) return not (extra == "lazyvim.plugins.extras.lazyrc") end, json.data.extras or {}) + elseif json.data.version == 5 then + json.data.extras = vim.tbl_filter(function(extra) + return not (extra == "lazyvim.plugins.extras.editor.trouble-v3") + end, json.data.extras or {}) end M.save() diff --git a/lua/lazyvim/util/plugin.lua b/lua/lazyvim/util/plugin.lua index 77a1c28e..084b2ff9 100644 --- a/lua/lazyvim/util/plugin.lua +++ b/lua/lazyvim/util/plugin.lua @@ -14,6 +14,7 @@ M.deprecated_extras = { ["lazyvim.plugins.extras.ui.treesitter-rewrite"] = "Disabled `treesitter-rewrite` extra for now. Not ready yet.", ["lazyvim.plugins.extras.coding.mini-ai"] = "`mini.ai` is now a core LazyVim plugin (again)", ["lazyvim.plugins.extras.lazyrc"] = "local spec files are now a lazy.nvim feature", + ["lazyvim.plugins.extras.editor.trouble-v3"] = "Trouble v3 has been merged in main", } M.deprecated_modules = { From 298a8f5c5d7d854719eaf7c2ba113f463cab411d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 30 May 2024 14:55:03 +0200 Subject: [PATCH 447/526] chore(main): release 12.1.0 (#3362) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d9880d1..d09e9482 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [12.1.0](https://github.com/LazyVim/LazyVim/compare/v12.0.0...v12.1.0) (2024-05-30) + + +### Features + +* **copilot-chat:** add cmp integration ([2a7d163](https://github.com/LazyVim/LazyVim/commit/2a7d163a8a6de2a5ad58b240770d90e6e5947638)) +* **extras:** simple extra for astro ([e7d4b39](https://github.com/LazyVim/LazyVim/commit/e7d4b397b291ec8854673e813ae67103bc75e15d)) +* trouble v3 ([95d055d](https://github.com/LazyVim/LazyVim/commit/95d055dcf7bbad34f6b8aaf94d285314ceaf6f0c)) +* **typescript:** vtls add select ts version ([#3366](https://github.com/LazyVim/LazyVim/issues/3366)) ([b285a46](https://github.com/LazyVim/LazyVim/commit/b285a46dfcde44aa2ab4f5acbbc4a2a18cc1f16b)) + + +### Bug Fixes + +* **clangd:** switch source/header is now leader-ch. Fixes [#3363](https://github.com/LazyVim/LazyVim/issues/3363) ([a224ef2](https://github.com/LazyVim/LazyVim/commit/a224ef2a73dd1e8b358179aab8fa36c1b6745b26)) +* **extras:** show recommended languages above enabled plugins ([c4b7505](https://github.com/LazyVim/LazyVim/commit/c4b75059697a85c77e4d85e18e37ebb6f278cf2a)) +* remove lazygit log gl keymap when on gitui ([#3371](https://github.com/LazyVim/LazyVim/issues/3371)) ([c2ef092](https://github.com/LazyVim/LazyVim/commit/c2ef09227ee59692f931fd7d4183759d1a82ac02)) +* **root:** escape glob expressions ([7414e84](https://github.com/LazyVim/LazyVim/commit/7414e84af96941fbe74555951ca6f5a58530775d)) +* **typescript:** allow easier merging of ts plugins ([cf6775a](https://github.com/LazyVim/LazyVim/commit/cf6775a959de7df314a8db1c208daed33a70f0c4)) +* **typescript:** vtsls server expe settings ([#3372](https://github.com/LazyVim/LazyVim/issues/3372)) ([ae098d6](https://github.com/LazyVim/LazyVim/commit/ae098d67d6842ccc097f5a10616369b60dfe6701)) + ## [12.0.0](https://github.com/LazyVim/LazyVim/compare/v11.11.0...v12.0.0) (2024-05-29) From 0a9373733f79be5edb4ccb8d9268a700c1e3faad Mon Sep 17 00:00:00 2001 From: Rubin Bhandari Date: Thu, 30 May 2024 19:15:20 +0545 Subject: [PATCH 448/526] feat(typescript): add keymap for remove unused imports (#3376) --- lua/lazyvim/plugins/extras/lang/typescript.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua index d3a80569..f9e841a8 100644 --- a/lua/lazyvim/plugins/extras/lang/typescript.lua +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -86,6 +86,13 @@ return { end, desc = "Add missing imports", }, + { + "cu", + function() + require("vtsls").commands.remove_unused_imports(0) + end, + desc = "Remove unused imports", + }, { "cD", function() From 060f56d6d429c5ee3fd35f4fa0c152f4a42781ca Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Thu, 30 May 2024 17:08:34 +0300 Subject: [PATCH 449/526] fix(extras): `underline = false` for setting diagnostics (#3379) Similar to https://github.com/folke/lazy.nvim/commit/ea7b9c3c3fd9026e1a5ae27950585df9a42ccd5b# I only noticed this, because in my main config I have some Extras not managed by `LazyExtras`. --- lua/lazyvim/util/extras.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/extras.lua b/lua/lazyvim/util/extras.lua index aa8ea575..9cae88e4 100644 --- a/lua/lazyvim/util/extras.lua +++ b/lua/lazyvim/util/extras.lua @@ -200,7 +200,7 @@ function X:update() diag.lnum = diag.row - 1 return diag end, self.diag), - { signs = false, virtual_text = true } + { signs = false, virtual_text = true, underline = false } ) end From a474aea1f9fcf0c7601914b1e53260067f621799 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 31 May 2024 08:21:47 +0200 Subject: [PATCH 450/526] fix: rename `+a` which-key group to `ai`. Fixes #3392 --- lua/lazyvim/plugins/extras/coding/copilot-chat.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua index 8cd0e2d1..090ade0c 100644 --- a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua +++ b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua @@ -53,7 +53,7 @@ return { init = function() LazyVim.on_load("which-key.nvim", function() vim.schedule(function() - require("which-key").register({ a = { name = "+CopilotChat (AI)" } }, { prefix = "" }) + require("which-key").register({ a = { name = "+ai" } }, { prefix = "" }) end) end) end, From 7782affc9038d13c407709ff00ada4c2c121fa92 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 31 May 2024 06:22:30 +0000 Subject: [PATCH 451/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 569245db..f607d609 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 30 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 31 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 9f2cc302463e3be0ca3a42845c0fc34e49e75bca Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 31 May 2024 13:52:41 +0200 Subject: [PATCH 452/526] fix(lsp): better way of extending deeply nested lists. Fixes #3398 --- .../plugins/extras/lang/typescript.lua | 6 ------ lua/lazyvim/plugins/extras/lang/vue.lua | 20 ++++++------------- lua/lazyvim/util/init.lua | 13 ++++++++++++ 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua index f9e841a8..e4fbd8f0 100644 --- a/lua/lazyvim/plugins/extras/lang/typescript.lua +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -119,12 +119,6 @@ return { -- copy typescript settings to javascript opts.settings.javascript = vim.tbl_deep_extend("force", {}, opts.settings.typescript, opts.settings.javascript or {}) - local plugins = vim.tbl_get(opts.settings, "vtsls", "tsserver", "globalPlugins") - -- allow plugins to have a key for proper merging - -- remove the key here - if plugins then - opts.settings.vtsls.tsserver.globalPlugins = vim.tbl_values(plugins) - end end, }, }, diff --git a/lua/lazyvim/plugins/extras/lang/vue.lua b/lua/lazyvim/plugins/extras/lang/vue.lua index dfc1d2f7..edeead89 100644 --- a/lua/lazyvim/plugins/extras/lang/vue.lua +++ b/lua/lazyvim/plugins/extras/lang/vue.lua @@ -27,20 +27,6 @@ return { -- Volar 2.0 has discontinued their "take over mode" which in previous version provided support for typescript in vue files. -- The new approach to get typescript support involves using the typescript language server along side volar. vtsls = { - settings = { - vtsls = { - tsserver = { - globalPlugins = { - -- Use typescript language server along with vue typescript plugin - vue = { - name = "@vue/typescript-plugin", - location = vue_typescript_plugin, - languages = { "vue" }, - }, - }, - }, - }, - }, filetypes = { "javascript", "javascriptreact", @@ -52,6 +38,12 @@ return { }, }, }) + + LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", { + name = "@vue/typescript-plugin", + location = vue_typescript_plugin, + languages = { "vue" }, + }) end, }, } diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index c36ef101..1c677622 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -72,6 +72,19 @@ function M.on_very_lazy(fn) }) end +function M.extend(t, key, value) + local keys = vim.split(key, ".", { plain = true }) + for i = 1, #keys do + local k = keys[i] + t[k] = t[k] or {} + if type(t) ~= "table" then + return + end + t = t[k] + end + t[#t + 1] = value +end + ---@param name string function M.opts(name) local plugin = require("lazy.core.config").spec.plugins[name] From 3fadf6af8f4adc1788fb8adec1fd9850d12feaf8 Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 31 May 2024 13:56:40 +0200 Subject: [PATCH 453/526] fix(rust): let rustaceans.nvim setup rust_analyzer (#3389) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix this warning ```  Warn 11:52:45 PM notify.warn nvim-lspconfig.rust_analyzer has been setup. This will likely lead to conflicts with the rustaceanvim LSP client. See ':h rustaceanvim.mason' ``` fix taken from https://github.com/mrcjkb/rustaceanvim/blob/master/doc/mason.txt --- lua/lazyvim/plugins/extras/lang/rust.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/rust.lua b/lua/lazyvim/plugins/extras/lang/rust.lua index 5a3c59d7..55203e7d 100644 --- a/lua/lazyvim/plugins/extras/lang/rust.lua +++ b/lua/lazyvim/plugins/extras/lang/rust.lua @@ -103,6 +103,11 @@ return { { "neovim/nvim-lspconfig", opts = { + setup = { + rust_analyzer = function() + return true + end, + }, servers = { taplo = { keys = { From 6678af37ee3100882b4c08451fa8aaa37e37fd69 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 31 May 2024 13:59:51 +0200 Subject: [PATCH 454/526] fix(copilot-chat): no need to schedule which-key keys. just use default --- .../plugins/extras/coding/copilot-chat.lua | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua index 090ade0c..7e636b65 100644 --- a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua +++ b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua @@ -50,13 +50,6 @@ return { mode = { "n", "v" }, }, }, - init = function() - LazyVim.on_load("which-key.nvim", function() - vim.schedule(function() - require("which-key").register({ a = { name = "+ai" } }, { prefix = "" }) - end) - end) - end, config = function(_, opts) local chat = require("CopilotChat") require("CopilotChat.integrations.cmp").setup() @@ -73,6 +66,16 @@ return { end, }, + { + "folke/which-key.nvim", + optional = true, + opts = { + defaults = { + ["a"] = { name = "+ai" }, + }, + }, + }, + -- Telescope integration { "nvim-telescope/telescope.nvim", From d02b73d72a85d72a57c3bcf0cfaef0cd50c81c37 Mon Sep 17 00:00:00 2001 From: Spedon Date: Fri, 31 May 2024 20:07:55 +0800 Subject: [PATCH 455/526] fix(ui): allow to disable the trouble lualine component with `vim.g.trouble_lualine = false` (#3391) * fix(ui): do not add trouble to lualine when aerial is enabled * refactor: make trouble lualine an option --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/config/options.lua | 3 +++ lua/lazyvim/plugins/ui.lua | 37 +++++++++++++++++++--------------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/lua/lazyvim/config/options.lua b/lua/lazyvim/config/options.lua index a1150151..1531ef53 100644 --- a/lua/lazyvim/config/options.lua +++ b/lua/lazyvim/config/options.lua @@ -28,6 +28,9 @@ vim.g.lazygit_config = true -- Hide deprecation warnings vim.g.deprecation_warnings = false +-- Show the current document symbols location from Trouble in lualine +vim.g.trouble_lualine = true + local opt = vim.opt opt.autowrite = true -- Enable auto write diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 94d72a12..190544a2 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -128,18 +128,7 @@ return { vim.o.laststatus = vim.g.lualine_laststatus - local trouble = require("trouble") - local symbols = trouble.statusline - and trouble.statusline({ - mode = "symbols", - groups = {}, - title = false, - filter = { range = true }, - format = "{kind_icon}{symbol.name:Normal}", - hl_group = "lualine_c_normal", - }) - - return { + local opts = { options = { theme = "auto", globalstatus = true, @@ -162,10 +151,6 @@ return { }, { "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } }, { LazyVim.lualine.pretty_path() }, - { - symbols and symbols.get, - cond = symbols and symbols.has, - }, }, lualine_x = { -- stylua: ignore @@ -222,6 +207,26 @@ return { }, extensions = { "neo-tree", "lazy" }, } + + -- do not add trouble symbols if aerial is enabled + if vim.g.trouble_lualine then + local trouble = require("trouble") + local symbols = trouble.statusline + and trouble.statusline({ + mode = "symbols", + groups = {}, + title = false, + filter = { range = true }, + format = "{kind_icon}{symbol.name:Normal}", + hl_group = "lualine_c_normal", + }) + table.insert(opts.sections.lualine_c, { + symbols and symbols.get, + cond = symbols and symbols.has, + }) + end + + return opts end, }, From ae381c91a1ec420cce082443501bace1ac7aaa3f Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 31 May 2024 14:24:27 +0200 Subject: [PATCH 456/526] Revert "fix(rust): let rustaceans.nvim setup rust_analyzer (#3389)" This reverts commit 3fadf6af8f4adc1788fb8adec1fd9850d12feaf8. --- lua/lazyvim/plugins/extras/lang/rust.lua | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/rust.lua b/lua/lazyvim/plugins/extras/lang/rust.lua index 55203e7d..5a3c59d7 100644 --- a/lua/lazyvim/plugins/extras/lang/rust.lua +++ b/lua/lazyvim/plugins/extras/lang/rust.lua @@ -103,11 +103,6 @@ return { { "neovim/nvim-lspconfig", opts = { - setup = { - rust_analyzer = function() - return true - end, - }, servers = { taplo = { keys = { From abc6554e24ff97bfc630fe1d91827e02f826b1fa Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 31 May 2024 16:49:47 +0200 Subject: [PATCH 457/526] fix(ui): remove old alpha.nvim warning --- lua/lazyvim/plugins/ui.lua | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 190544a2..6f371351 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -320,20 +320,6 @@ return { -- ui components { "MunifTanjim/nui.nvim", lazy = true }, - { - "goolord/alpha-nvim", - optional = true, - enabled = function() - LazyVim.warn({ - "`dashboard.nvim` is now the default LazyVim starter plugin.", - "", - "To keep using `alpha.nvim`, please enable the `lazyvim.plugins.extras.ui.alpha` extra.", - "Or to hide this message, remove the alpha spec from your config.", - }) - return false - end, - }, - { "nvimdev/dashboard-nvim", lazy = false, -- As https://github.com/nvimdev/dashboard-nvim/pull/450, dashboard-nvim shouldn't be lazy-loaded to properly handle stdin. From 07ff12f5eb2be06b9783c334a08f90466a0bc776 Mon Sep 17 00:00:00 2001 From: Emma Eilefsen Glenna <95104378+eilefsen@users.noreply.github.com> Date: Fri, 31 May 2024 20:52:01 +0200 Subject: [PATCH 458/526] fix(extras.lang.vue) missing typescript autocomplete in .vue files (#3401) * Fix missing autocomplete in .vue files The existing Vue extra was not properly configuring vtsls to use the globalPlugin: '@vue/typescript-plugin' This commit fixes missing typescript autocomplete in .vue files. * move @vue/typescript-plugin back to extend function call * tidy LazyVim.extend() arguments --- lua/lazyvim/plugins/extras/lang/vue.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/vue.lua b/lua/lazyvim/plugins/extras/lang/vue.lua index edeead89..fc9fb59b 100644 --- a/lua/lazyvim/plugins/extras/lang/vue.lua +++ b/lua/lazyvim/plugins/extras/lang/vue.lua @@ -18,9 +18,9 @@ return { { "neovim/nvim-lspconfig", opts = function(_, opts) - local vue_typescript_plugin = require("mason-registry").get_package("vue-language-server"):get_install_path() - .. "/node_modules/@vue/language-server" - .. "/node_modules/@vue/typescript-plugin" + local vue_typescript_plugin = require("mason-registry") + .get_package("vue-language-server") + :get_install_path() .. "/node_modules/@vue/language-server" .. "/node_modules/@vue/typescript-plugin" opts.servers = vim.tbl_deep_extend("force", opts.servers, { volar = {}, @@ -38,12 +38,14 @@ return { }, }, }) - - LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", { + LazyVim.extend(opts.servers.vtsls.settings.vtsls.tsserver.globalPlugins, { name = "@vue/typescript-plugin", location = vue_typescript_plugin, languages = { "vue" }, + configNamespace = "typescript", }) end, + + }, } From e7430b0776c13e9ab3f42a1b9aee84561bd07c0a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 31 May 2024 20:53:44 +0200 Subject: [PATCH 459/526] fix(vue): correctly add plugins. See #3401 --- lua/lazyvim/plugins/extras/lang/vue.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/vue.lua b/lua/lazyvim/plugins/extras/lang/vue.lua index fc9fb59b..f3bd0926 100644 --- a/lua/lazyvim/plugins/extras/lang/vue.lua +++ b/lua/lazyvim/plugins/extras/lang/vue.lua @@ -18,9 +18,9 @@ return { { "neovim/nvim-lspconfig", opts = function(_, opts) - local vue_typescript_plugin = require("mason-registry") - .get_package("vue-language-server") - :get_install_path() .. "/node_modules/@vue/language-server" .. "/node_modules/@vue/typescript-plugin" + local vue_typescript_plugin = require("mason-registry").get_package("vue-language-server"):get_install_path() + .. "/node_modules/@vue/language-server" + .. "/node_modules/@vue/typescript-plugin" opts.servers = vim.tbl_deep_extend("force", opts.servers, { volar = {}, @@ -38,14 +38,12 @@ return { }, }, }) - LazyVim.extend(opts.servers.vtsls.settings.vtsls.tsserver.globalPlugins, { + LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", { name = "@vue/typescript-plugin", location = vue_typescript_plugin, languages = { "vue" }, configNamespace = "typescript", }) end, - - }, } From 146c87cd786854b9225ad49ad39acbcb4b7fff0b Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Sat, 1 Jun 2024 00:46:30 +0300 Subject: [PATCH 460/526] fix(trouble): don't enable symbols keymap when `outline.nvim` enabled (#3408) --- lua/lazyvim/plugins/extras/editor/outline.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/outline.lua b/lua/lazyvim/plugins/extras/editor/outline.lua index c571d789..07c46705 100644 --- a/lua/lazyvim/plugins/extras/editor/outline.lua +++ b/lua/lazyvim/plugins/extras/editor/outline.lua @@ -1,4 +1,12 @@ return { + -- Disable `cs` keymap so it doesn't conflict with `outline.nvim` + { + "folke/trouble.nvim", + optional = true, + keys = { + { "cs", false }, + }, + }, { "hedyhli/outline.nvim", keys = { { "cs", "Outline", desc = "Toggle Outline" } }, From 135150307b53a5b51f2f0c149ca7f426a67eb8f1 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 31 May 2024 23:47:48 +0200 Subject: [PATCH 461/526] fix(aerial): disable trouble leader-cs keymap when aerial extra is enabled --- lua/lazyvim/plugins/extras/editor/aerial.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/aerial.lua b/lua/lazyvim/plugins/extras/editor/aerial.lua index 15a209ba..afa2a602 100644 --- a/lua/lazyvim/plugins/extras/editor/aerial.lua +++ b/lua/lazyvim/plugins/extras/editor/aerial.lua @@ -49,6 +49,14 @@ return { }, }, + { + "folke/trouble.nvim", + optional = true, + keys = { + { "cs", false }, + }, + }, + -- Telescope integration { "nvim-telescope/telescope.nvim", From 9d999fa210065a9903634f1e1a2053627d529dec Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 1 Jun 2024 08:31:10 +0200 Subject: [PATCH 462/526] refactor: refactored mason/typescript/vue support --- lua/lazyvim/plugins/extras/lang/python.lua | 3 +- .../plugins/extras/lang/typescript.lua | 14 +++++- lua/lazyvim/plugins/extras/lang/vue.lua | 47 +++++++++---------- lua/lazyvim/plugins/lsp/init.lua | 10 ++-- lua/lazyvim/plugins/xtras.lua | 1 + lua/lazyvim/util/init.lua | 32 ++++++++++++- 6 files changed, 70 insertions(+), 37 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index ac59a543..7a716b3e 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -106,8 +106,7 @@ return { { "dPc", function() require('dap-python').test_class() end, desc = "Debug Class", ft = "python" }, }, config = function() - local path = require("mason-registry").get_package("debugpy"):get_install_path() - require("dap-python").setup(path .. "/venv/bin/python") + require("dap-python").setup(LazyVim.get_pkg_path("debugpy", "/venv/bin/python")) end, }, }, diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua index e4fbd8f0..482af408 100644 --- a/lua/lazyvim/plugins/extras/lang/typescript.lua +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -32,10 +32,21 @@ return { enabled = false, }, vtsls = { + -- explicitly add default filetypes, so that we can extend + -- them in related extras + filetypes = { + "javascript", + "javascriptreact", + "javascript.jsx", + "typescript", + "typescriptreact", + "typescript.tsx", + }, settings = { complete_function_calls = true, vtsls = { enableMoveToFileCodeAction = true, + autoUseWorkspaceTsdk = true, experimental = { completion = { enableServerSideFuzzyMatch = true, @@ -147,8 +158,7 @@ return { command = "node", -- 💀 Make sure to update this path to point to your installation args = { - require("mason-registry").get_package("js-debug-adapter"):get_install_path() - .. "/js-debug/src/dapDebugServer.js", + LazyVim.get_pkg_path("js-debug-adapter", "/js-debug/src/dapDebugServer.js"), "${port}", }, }, diff --git a/lua/lazyvim/plugins/extras/lang/vue.lua b/lua/lazyvim/plugins/extras/lang/vue.lua index f3bd0926..6c47d56e 100644 --- a/lua/lazyvim/plugins/extras/lang/vue.lua +++ b/lua/lazyvim/plugins/extras/lang/vue.lua @@ -6,6 +6,9 @@ return { }) end, + -- depends on the typescript extra + { import = "lazyvim.plugins.extras.lang.typescript" }, + { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) @@ -15,34 +18,30 @@ return { end, }, + -- Add LSP servers + { + "neovim/nvim-lspconfig", + opts = { + servers = { + volar = {}, + vtsls = {}, + }, + }, + }, + + -- Configure tsserver plugin { "neovim/nvim-lspconfig", opts = function(_, opts) - local vue_typescript_plugin = require("mason-registry").get_package("vue-language-server"):get_install_path() - .. "/node_modules/@vue/language-server" - .. "/node_modules/@vue/typescript-plugin" - - opts.servers = vim.tbl_deep_extend("force", opts.servers, { - volar = {}, - -- Volar 2.0 has discontinued their "take over mode" which in previous version provided support for typescript in vue files. - -- The new approach to get typescript support involves using the typescript language server along side volar. - vtsls = { - filetypes = { - "javascript", - "javascriptreact", - "javascript.jsx", - "typescript", - "typescriptreact", - "typescript.tsx", - "vue", - }, - }, - }) + table.insert(opts.servers.vtsls.filetypes, "vue") LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", { - name = "@vue/typescript-plugin", - location = vue_typescript_plugin, - languages = { "vue" }, - configNamespace = "typescript", + { + name = "@vue/typescript-plugin", + location = LazyVim.get_pkg_path("vue-language-server", "/node_modules/@vue/language-server"), + languages = { "vue" }, + configNamespace = "typescript", + enableForWorkspaceTypeScriptVersions = true, + }, }) end, }, diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 414bb655..ac84b743 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -284,19 +284,15 @@ return { }) end, 100) end) - local function ensure_installed() + + mr.refresh(function() for _, tool in ipairs(opts.ensure_installed) do local p = mr.get_package(tool) if not p:is_installed() then p:install() end end - end - if mr.refresh then - mr.refresh(ensure_installed) - else - ensure_installed() - end + end) end, }, } diff --git a/lua/lazyvim/plugins/xtras.lua b/lua/lazyvim/plugins/xtras.lua index 6c789b0f..87b11fb7 100644 --- a/lua/lazyvim/plugins/xtras.lua +++ b/lua/lazyvim/plugins/xtras.lua @@ -5,6 +5,7 @@ local prios = { ["lazyvim.plugins.extras.editor.aerial"] = 100, ["lazyvim.plugins.extras.editor.outline"] = 100, ["lazyvim.plugins.extras.editor.trouble-v3"] = 100, + ["lazyvim.plugins.extras.lang.typescript"] = 5, ["lazyvim.plugins.extras.ui.edgy"] = 2, ["lazyvim.plugins.extras.test.core"] = 1, ["lazyvim.plugins.extras.dap.core"] = 1, diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index 1c677622..9b2135f5 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -72,7 +72,12 @@ function M.on_very_lazy(fn) }) end -function M.extend(t, key, value) +---@generic T +---@param t T[] +---@param key string +---@param values T[] +---@return T[]? +function M.extend(t, key, values) local keys = vim.split(key, ".", { plain = true }) for i = 1, #keys do local k = keys[i] @@ -82,7 +87,7 @@ function M.extend(t, key, value) end t = t[k] end - t[#t + 1] = value + return vim.list_extend(t, values) end ---@param name string @@ -211,4 +216,27 @@ function M.create_undo() end end +--- Gets a path to a package in the Mason registry. +--- Prefer this to `get_package`, since the package might not always be +--- available yet and trigger errors. +---@param pkg string +---@param path? string +function M.get_pkg_path(pkg, path) + path = path or "" + local ret = vim.env.MASON .. "/packages/" .. pkg .. "/" .. path + if not vim.loop.fs_stat(ret) then + M.warn(("Mason package path not found for **%s**:\n- `%s`"):format(pkg, path)) + end + return ret +end + +--- Override the default title for notifications. +for _, level in ipairs({ "info", "warn", "error" }) do + M[level] = function(msg, opts) + opts = opts or {} + opts.title = opts.title or "LazyVim" + return LazyUtil[level](msg, opts) + end +end + return M From 683aaeb75b46f182f2a2dca3b8416151de296626 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 1 Jun 2024 08:33:24 +0200 Subject: [PATCH 463/526] feat(astro): added support for ts-plugin, but won't work till mason-registry PR is merged. See #3364 --- lua/lazyvim/plugins/extras/lang/astro.lua | 22 ++++++++++++++++++++++ lua/lazyvim/util/init.lua | 7 +++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/astro.lua b/lua/lazyvim/plugins/extras/lang/astro.lua index 67af3e4d..c4192e27 100644 --- a/lua/lazyvim/plugins/extras/lang/astro.lua +++ b/lua/lazyvim/plugins/extras/lang/astro.lua @@ -10,6 +10,9 @@ return { }) end, + -- depends on the typescript extra + { import = "lazyvim.plugins.extras.lang.typescript" }, + { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) @@ -19,6 +22,7 @@ return { end, }, + -- LSP Servers { "neovim/nvim-lspconfig", opts = { @@ -27,4 +31,22 @@ return { }, }, }, + + -- Configure tsserver plugin + { + "neovim/nvim-lspconfig", + opts = function(_, opts) + LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", { + { + name = "@astrojs/ts-plugin", + location = LazyVim.get_pkg_path( + "astro-language-server", + "/node_modules/@astrojs/ts-plugin", + { warn = false } + ), + enableForWorkspaceTypeScriptVersions = true, + }, + }) + end, + }, } diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index 9b2135f5..12c7abd4 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -221,10 +221,13 @@ end --- available yet and trigger errors. ---@param pkg string ---@param path? string -function M.get_pkg_path(pkg, path) +---@param opts? { warn?: boolean } +function M.get_pkg_path(pkg, path, opts) + opts = opts or {} + opts.warn = opts.warn == nil and true or opts.warn path = path or "" local ret = vim.env.MASON .. "/packages/" .. pkg .. "/" .. path - if not vim.loop.fs_stat(ret) then + if opts.warn and not vim.loop.fs_stat(ret) then M.warn(("Mason package path not found for **%s**:\n- `%s`"):format(pkg, path)) end return ret From 679c76a8f3566c091afc07302f27d52023949fc8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 1 Jun 2024 06:34:09 +0000 Subject: [PATCH 464/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index f607d609..39d95790 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 31 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 01 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 276b50e389054bd2314f03c7d4a16f855eed69ac Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 1 Jun 2024 08:42:00 +0200 Subject: [PATCH 465/526] style: docs for LazyVim.extend --- lua/lazyvim/util/init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index 12c7abd4..845fdd1b 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -72,6 +72,9 @@ function M.on_very_lazy(fn) }) end +--- This extends a deeply nested list with a key in a table +--- that is a dot-separated string. +--- The nested list will be created if it does not exist. ---@generic T ---@param t T[] ---@param key string From a6df15a63fdeaf25895fb2d97910e3e099a95d0c Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 1 Jun 2024 08:48:29 +0200 Subject: [PATCH 466/526] fix(util): make sure mason is loaded when getting package paths --- lua/lazyvim/util/init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index 845fdd1b..2dca92ba 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -226,6 +226,7 @@ end ---@param path? string ---@param opts? { warn?: boolean } function M.get_pkg_path(pkg, path, opts) + require("mason") -- make sure Mason is loaded opts = opts or {} opts.warn = opts.warn == nil and true or opts.warn path = path or "" From 4e62df4269a9300c17f6bf23acfcb9dd0729b6c3 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 1 Jun 2024 08:48:44 +0200 Subject: [PATCH 467/526] fix(health): remove old deprecated module checks --- lua/lazyvim/util/plugin.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lua/lazyvim/util/plugin.lua b/lua/lazyvim/util/plugin.lua index 084b2ff9..9886122b 100644 --- a/lua/lazyvim/util/plugin.lua +++ b/lua/lazyvim/util/plugin.lua @@ -17,11 +17,7 @@ M.deprecated_extras = { ["lazyvim.plugins.extras.editor.trouble-v3"] = "Trouble v3 has been merged in main", } -M.deprecated_modules = { - ["null-ls"] = "lsp.none-ls", - ["nvim-navic.lib"] = "editor.navic", - ["nvim-navic"] = "editor.navic", -} +M.deprecated_modules = {} ---@type table M.renames = { From 7598a7503df0fd7912e81fdc9a0eb7635795605b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 1 Jun 2024 09:08:09 +0200 Subject: [PATCH 468/526] feat(extras): added extra for svelte. Full support will be enabled once my mason PR gets merged --- lua/lazyvim/plugins/extras/lang/svelte.lua | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lang/svelte.lua diff --git a/lua/lazyvim/plugins/extras/lang/svelte.lua b/lua/lazyvim/plugins/extras/lang/svelte.lua new file mode 100644 index 00000000..7b0588d2 --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/svelte.lua @@ -0,0 +1,52 @@ +return { + recommended = function() + return LazyVim.extras.wants({ + ft = "svelte", + root = { + "svelte.config.js", + "svelte.config.mjs", + "svelte.config.cjs", + }, + }) + end, + + -- depends on the typescript extra + { import = "lazyvim.plugins.extras.lang.typescript" }, + + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + if type(opts.ensure_installed) == "table" then + vim.list_extend(opts.ensure_installed, { "svelte" }) + end + end, + }, + + -- LSP Servers + { + "neovim/nvim-lspconfig", + opts = { + servers = { + svelte = {}, + }, + }, + }, + + -- Configure tsserver plugin + { + "neovim/nvim-lspconfig", + opts = function(_, opts) + LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", { + { + name = "typescript-svelte-plugin", + location = LazyVim.get_pkg_path( + "svelte-language-server", + "/node_modules/typescript-svelte-plugin", + { warn = false } + ), + enableForWorkspaceTypeScriptVersions = true, + }, + }) + end, + }, +} From 2e9da7f41f826df5fcfff1897f18ebb277ec5f0c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 1 Jun 2024 09:52:43 +0200 Subject: [PATCH 469/526] chore(main): release 12.2.0 (#3377) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d09e9482..e5eb5ac9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,30 @@ # Changelog +## [12.2.0](https://github.com/LazyVim/LazyVim/compare/v12.1.0...v12.2.0) (2024-06-01) + + +### Features + +* **astro:** added support for ts-plugin, but won't work till mason-registry PR is merged. See [#3364](https://github.com/LazyVim/LazyVim/issues/3364) ([683aaeb](https://github.com/LazyVim/LazyVim/commit/683aaeb75b46f182f2a2dca3b8416151de296626)) +* **extras:** added extra for svelte. Full support will be enabled once my mason PR gets merged ([7598a75](https://github.com/LazyVim/LazyVim/commit/7598a7503df0fd7912e81fdc9a0eb7635795605b)) +* **typescript:** add keymap for remove unused imports ([#3376](https://github.com/LazyVim/LazyVim/issues/3376)) ([0a93737](https://github.com/LazyVim/LazyVim/commit/0a9373733f79be5edb4ccb8d9268a700c1e3faad)) + + +### Bug Fixes + +* **aerial:** disable trouble leader-cs keymap when aerial extra is enabled ([1351503](https://github.com/LazyVim/LazyVim/commit/135150307b53a5b51f2f0c149ca7f426a67eb8f1)) +* **copilot-chat:** no need to schedule which-key keys. just use default ([6678af3](https://github.com/LazyVim/LazyVim/commit/6678af37ee3100882b4c08451fa8aaa37e37fd69)) +* **extras:** `underline = false` for setting diagnostics ([#3379](https://github.com/LazyVim/LazyVim/issues/3379)) ([060f56d](https://github.com/LazyVim/LazyVim/commit/060f56d6d429c5ee3fd35f4fa0c152f4a42781ca)) +* **health:** remove old deprecated module checks ([4e62df4](https://github.com/LazyVim/LazyVim/commit/4e62df4269a9300c17f6bf23acfcb9dd0729b6c3)) +* **lsp:** better way of extending deeply nested lists. Fixes [#3398](https://github.com/LazyVim/LazyVim/issues/3398) ([9f2cc30](https://github.com/LazyVim/LazyVim/commit/9f2cc302463e3be0ca3a42845c0fc34e49e75bca)) +* rename `+a` which-key group to `ai`. Fixes [#3392](https://github.com/LazyVim/LazyVim/issues/3392) ([a474aea](https://github.com/LazyVim/LazyVim/commit/a474aea1f9fcf0c7601914b1e53260067f621799)) +* **rust:** let rustaceans.nvim setup rust_analyzer ([#3389](https://github.com/LazyVim/LazyVim/issues/3389)) ([3fadf6a](https://github.com/LazyVim/LazyVim/commit/3fadf6af8f4adc1788fb8adec1fd9850d12feaf8)) +* **trouble:** don't enable symbols keymap when `outline.nvim` enabled ([#3408](https://github.com/LazyVim/LazyVim/issues/3408)) ([146c87c](https://github.com/LazyVim/LazyVim/commit/146c87cd786854b9225ad49ad39acbcb4b7fff0b)) +* **ui:** allow to disable the trouble lualine component with `vim.g.trouble_lualine = false` ([#3391](https://github.com/LazyVim/LazyVim/issues/3391)) ([d02b73d](https://github.com/LazyVim/LazyVim/commit/d02b73d72a85d72a57c3bcf0cfaef0cd50c81c37)) +* **ui:** remove old alpha.nvim warning ([abc6554](https://github.com/LazyVim/LazyVim/commit/abc6554e24ff97bfc630fe1d91827e02f826b1fa)) +* **util:** make sure mason is loaded when getting package paths ([a6df15a](https://github.com/LazyVim/LazyVim/commit/a6df15a63fdeaf25895fb2d97910e3e099a95d0c)) +* **vue:** correctly add plugins. See [#3401](https://github.com/LazyVim/LazyVim/issues/3401) ([e7430b0](https://github.com/LazyVim/LazyVim/commit/e7430b0776c13e9ab3f42a1b9aee84561bd07c0a)) + ## [12.1.0](https://github.com/LazyVim/LazyVim/compare/v12.0.0...v12.1.0) (2024-05-30) From c33d6578a8b2ce03cab58d5952d717064125ef5d Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 1 Jun 2024 10:25:08 +0200 Subject: [PATCH 470/526] fix(util): make sure doc gen works --- lua/lazyvim/util/init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index 2dca92ba..05d96db5 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -226,11 +226,12 @@ end ---@param path? string ---@param opts? { warn?: boolean } function M.get_pkg_path(pkg, path, opts) - require("mason") -- make sure Mason is loaded + pcall(require, "mason") -- make sure Mason is loaded. Will fail when generating docs + local root = vim.env.MASON or (vim.fn.stdpath("data") .. "/mason") opts = opts or {} opts.warn = opts.warn == nil and true or opts.warn path = path or "" - local ret = vim.env.MASON .. "/packages/" .. pkg .. "/" .. path + local ret = root .. "/packages/" .. pkg .. "/" .. path if opts.warn and not vim.loop.fs_stat(ret) then M.warn(("Mason package path not found for **%s**:\n- `%s`"):format(pkg, path)) end From c98fbef3b56fe6ba709254cdc90c8c46c078d555 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 1 Jun 2024 11:20:50 +0200 Subject: [PATCH 471/526] fix(json): added *.json to recommended --- lua/lazyvim/plugins/extras/lang/json.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/lang/json.lua b/lua/lazyvim/plugins/extras/lang/json.lua index 5f94caf7..3f1de268 100644 --- a/lua/lazyvim/plugins/extras/lang/json.lua +++ b/lua/lazyvim/plugins/extras/lang/json.lua @@ -2,6 +2,7 @@ return { recommended = function() return LazyVim.extras.wants({ ft = { "json", "jsonc", "json5" }, + root = { "*.json" }, }) end, From c69553e1942a646917c92f3643a2ca78eeb19adf Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 1 Jun 2024 11:21:03 +0200 Subject: [PATCH 472/526] fix(dot): added dot to recommended --- lua/lazyvim/plugins/extras/util/dot.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/lazyvim/plugins/extras/util/dot.lua b/lua/lazyvim/plugins/extras/util/dot.lua index ad4e2278..8066d363 100644 --- a/lua/lazyvim/plugins/extras/util/dot.lua +++ b/lua/lazyvim/plugins/extras/util/dot.lua @@ -7,6 +7,8 @@ local function have(path) end return { + recommended = true, + desc = "Language support for dotfiles", { "neovim/nvim-lspconfig", opts = { From 45b92aa381243417462fb4aac92478ce50b4e126 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 1 Jun 2024 11:21:28 +0200 Subject: [PATCH 473/526] feat(extras): split enabled in enabled plugins/languages --- lua/lazyvim/util/extras.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/util/extras.lua b/lua/lazyvim/util/extras.lua index 9cae88e4..0a9d50c6 100644 --- a/lua/lazyvim/util/extras.lua +++ b/lua/lazyvim/util/extras.lua @@ -225,7 +225,8 @@ function X:render() title = "Recommended Languages", empty = false, }) - self:section({ enabled = true, title = "Enabled" }) + self:section({ enabled = true, exclude = "^lang%.", title = "Enabled Plugins" }) + self:section({ enabled = true, title = "Enabled Languages" }) self:section({ recommended = true, title = "Recommended Plugins", empty = false }) self:section({ title = "Plugins", exclude = "^lang%." }) self:section({ title = "Languages" }) From b2858a297a465546e9f34d5c3e9d42b9716048eb Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 1 Jun 2024 11:22:17 +0200 Subject: [PATCH 474/526] feat(extras): show extras imported in other extras --- lua/lazyvim/util/extras.lua | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/util/extras.lua b/lua/lazyvim/util/extras.lua index 0a9d50c6..9cd16a3e 100644 --- a/lua/lazyvim/util/extras.lua +++ b/lua/lazyvim/util/extras.lua @@ -17,6 +17,7 @@ local Text = require("lazy.view.text") ---@field enabled boolean ---@field managed boolean ---@field recommended? boolean +---@field imports string[] ---@field row? number ---@field section? string ---@field plugins string[] @@ -82,7 +83,16 @@ end ---@param source LazyExtraSource function M.get_extra(source, modname) local enabled = vim.tbl_contains(M.state, modname) - local spec = Plugin.Spec.new({ import = modname }, { optional = true }) + local spec = Plugin.Spec.new(nil, { optional = true }) + spec:parse({ import = modname }) + local imports = vim.tbl_filter(function(x) + return x ~= modname + end, spec.modules) + if #imports > 0 then + spec = Plugin.Spec.new(nil, { optional = true }) + spec.modules = vim.deepcopy(imports) + spec:parse({ import = modname }) + end local plugins = {} ---@type string[] local optional = {} ---@type string[] for _, p in pairs(spec.plugins) do @@ -107,6 +117,7 @@ function M.get_extra(source, modname) name = modname:sub(#source.module + 2), module = modname, enabled = enabled, + imports = imports, desc = require(modname).desc, recommended = recommended, managed = vim.tbl_contains(Config.json.data.extras, modname) or not enabled, @@ -254,6 +265,10 @@ function X:extra(extra) if extra.source.name ~= "LazyVim" then self.text:append(" "):append(LazyConfig.options.ui.icons.event .. " " .. extra.source.name, "LazyReasonEvent") end + for _, import in ipairs(extra.imports) do + import = import:gsub("^lazyvim.plugins.extras.", "") + self.text:append(" "):append(LazyConfig.options.ui.icons.plugin .. "" .. import, "LazyReasonStart") + end for _, plugin in ipairs(extra.plugins) do self.text:append(" "):append(LazyConfig.options.ui.icons.plugin .. "" .. plugin, "LazyReasonPlugin") end From 595069d50114e841935ac00e1d4d734ed1756341 Mon Sep 17 00:00:00 2001 From: Aman9das <39594914+Aman9das@users.noreply.github.com> Date: Sat, 1 Jun 2024 18:35:34 +0530 Subject: [PATCH 475/526] R.lua make R output themed by neovim theme (#3416) --- lua/lazyvim/plugins/extras/lang/r.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/lang/r.lua b/lua/lazyvim/plugins/extras/lang/r.lua index c89828c4..49b3dd9c 100644 --- a/lua/lazyvim/plugins/extras/lang/r.lua +++ b/lua/lazyvim/plugins/extras/lang/r.lua @@ -43,6 +43,7 @@ return { pdfviewer = "" }, config = function(_, opts) + vim.g.rout_follow_colorscheme = true require("r").setup(opts) require("r.pdf.generic").open = vim.ui.open end, From 8024201e75b471eac5e399dcb6c8ec4f3f55e2a2 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 1 Jun 2024 20:46:56 +0200 Subject: [PATCH 476/526] refactor: move 0.9 stuff to a compat layer. Cleaner this way --- lua/lazyvim/plugins/coding.lua | 81 +++++++++++-------------- lua/lazyvim/plugins/compat/nvim-0_9.lua | 8 +++ lua/lazyvim/plugins/lsp/init.lua | 2 +- lua/lazyvim/plugins/xtras.lua | 15 ++++- lua/lazyvim/types.lua | 3 + 5 files changed, 61 insertions(+), 48 deletions(-) create mode 100644 lua/lazyvim/plugins/compat/nvim-0_9.lua diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index d143852f..a3c91c3d 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -95,48 +95,46 @@ return { }, -- snippets - vim.fn.has("nvim-0.10") == 1 - and { - "nvim-cmp", - dependencies = { - { - "garymjr/nvim-snippets", - opts = { - friendly_snippets = true, - }, - dependencies = { "rafamadriz/friendly-snippets" }, - }, + { + "nvim-cmp", + dependencies = { + { + "garymjr/nvim-snippets", + opts = { + friendly_snippets = true, }, - opts = function(_, opts) - opts.snippet = { - expand = function(item) - return LazyVim.cmp.expand(item.body) - end, - } - table.insert(opts.sources, { name = "snippets" }) + dependencies = { "rafamadriz/friendly-snippets" }, + }, + }, + opts = function(_, opts) + opts.snippet = { + expand = function(item) + return LazyVim.cmp.expand(item.body) end, - keys = { - { - "", - function() - return vim.snippet.active({ direction = 1 }) and "lua vim.snippet.jump(1)" or "" - end, - expr = true, - silent = true, - mode = { "i", "s" }, - }, - { - "", - function() - return vim.snippet.active({ direction = -1 }) and "lua vim.snippet.jump(-1)" or "" - end, - expr = true, - silent = true, - mode = { "i", "s" }, - }, - }, } - or { import = "lazyvim.plugins.extras.coding.luasnip", enabled = vim.fn.has("nvim-0.10") == 0 }, + table.insert(opts.sources, { name = "snippets" }) + end, + keys = { + { + "", + function() + return vim.snippet.active({ direction = 1 }) and "lua vim.snippet.jump(1)" or "" + end, + expr = true, + silent = true, + mode = { "i", "s" }, + }, + { + "", + function() + return vim.snippet.active({ direction = -1 }) and "lua vim.snippet.jump(-1)" or "" + end, + expr = true, + silent = true, + mode = { "i", "s" }, + }, + }, + }, -- auto pairs { @@ -168,11 +166,6 @@ return { "folke/ts-comments.nvim", event = "VeryLazy", opts = {}, - enabled = vim.fn.has("nvim-0.10") == 1, - }, - { - import = "lazyvim.plugins.extras.coding.mini-comment", - enabled = vim.fn.has("nvim-0.10") == 0, }, -- Better text-objects diff --git a/lua/lazyvim/plugins/compat/nvim-0_9.lua b/lua/lazyvim/plugins/compat/nvim-0_9.lua new file mode 100644 index 00000000..2962c97c --- /dev/null +++ b/lua/lazyvim/plugins/compat/nvim-0_9.lua @@ -0,0 +1,8 @@ +return { + { import = "lazyvim.plugins.extras.coding.luasnip" }, + { + "folke/ts-comments.nvim", + enabled = false, + }, + { import = "lazyvim.plugins.extras.coding.mini-comment" }, +} diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index ac84b743..207fd7fa 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -75,7 +75,7 @@ return { -- mason = false, -- set to false if you don't want this server to be installed with mason -- Use this to add any additional keymaps -- for specific lsp servers - ---@type LazyKeysSpec[] + -- ---@type LazyKeysSpec[] -- keys = {}, settings = { Lua = { diff --git a/lua/lazyvim/plugins/xtras.lua b/lua/lazyvim/plugins/xtras.lua index 87b11fb7..8b4b2ec9 100644 --- a/lua/lazyvim/plugins/xtras.lua +++ b/lua/lazyvim/plugins/xtras.lua @@ -12,9 +12,18 @@ local prios = { } ---@type string[] -Config.json.data.extras = LazyVim.dedup(Config.json.data.extras) +local extras = LazyVim.dedup(Config.json.data.extras) -table.sort(Config.json.data.extras, function(a, b) +local version = vim.version() +local v = version.major .. "_" .. version.minor + +local compat = { "0_9" } + +if vim.tbl_contains(compat, v) then + extras[#extras + 1] = "lazyvim.plugins.compat.nvim-" .. v +end + +table.sort(extras, function(a, b) local pa = prios[a] or 10 local pb = prios[b] or 10 if pa == pb then @@ -26,4 +35,4 @@ end) ---@param extra string return vim.tbl_map(function(extra) return { import = extra } -end, Config.json.data.extras) +end, extras) diff --git a/lua/lazyvim/types.lua b/lua/lazyvim/types.lua index 73a5fe7b..52a340c9 100644 --- a/lua/lazyvim/types.lua +++ b/lua/lazyvim/types.lua @@ -1,4 +1,7 @@ +---@meta + ---@class LazyVimGlobals vim.g = {} _G.lazyvim_docs = true +_G.LazyVim = require("lazyvim.util") From c14d21ce7534ff302c1ccf0b22f46160ea98ccf1 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 2 Jun 2024 09:05:16 +0200 Subject: [PATCH 477/526] feat: moved neoconf.nvim to extras --- lua/lazyvim/plugins/extras/dap/core.lua | 5 ----- lua/lazyvim/plugins/extras/lsp/neoconf.lua | 12 ++++++++++++ lua/lazyvim/plugins/lsp/init.lua | 5 ----- 3 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 lua/lazyvim/plugins/extras/lsp/neoconf.lua diff --git a/lua/lazyvim/plugins/extras/dap/core.lua b/lua/lazyvim/plugins/extras/dap/core.lua index 77864460..06b8862d 100644 --- a/lua/lazyvim/plugins/extras/dap/core.lua +++ b/lua/lazyvim/plugins/extras/dap/core.lua @@ -81,11 +81,6 @@ return { }, }, }, - - -- VsCode launch.json parser - { - "folke/neoconf.nvim", - }, }, -- stylua: ignore diff --git a/lua/lazyvim/plugins/extras/lsp/neoconf.lua b/lua/lazyvim/plugins/extras/lsp/neoconf.lua new file mode 100644 index 00000000..4016816d --- /dev/null +++ b/lua/lazyvim/plugins/extras/lsp/neoconf.lua @@ -0,0 +1,12 @@ +return { + { + "neovim/nvim-lspconfig", + dependencies = { + { + "folke/neoconf.nvim", + cmd = "Neoconf", + opts = {}, + }, + }, + }, +} diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 207fd7fa..7e871a99 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -4,7 +4,6 @@ return { "neovim/nvim-lspconfig", event = "LazyFile", dependencies = { - { "folke/neoconf.nvim", cmd = "Neoconf", config = false, dependencies = { "nvim-lspconfig" } }, { "folke/neodev.nvim", opts = {} }, "mason.nvim", "williamboman/mason-lspconfig.nvim", @@ -119,10 +118,6 @@ return { end, ---@param opts PluginLspOpts config = function(_, opts) - if LazyVim.has("neoconf.nvim") then - require("neoconf").setup(LazyVim.opts("neoconf.nvim")) - end - -- setup autoformat LazyVim.format.register(LazyVim.lsp.formatter()) From 596c439db572c8b37c442a1f425b3f452607fd36 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 2 Jun 2024 09:33:19 +0200 Subject: [PATCH 478/526] feat(util): utility methods for lazy plugins --- lua/lazyvim/util/init.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index 05d96db5..2417b597 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -57,9 +57,22 @@ function M.is_win() return vim.uv.os_uname().sysname:find("Windows") ~= nil end +---@param name string +function M.get_plugin(name) + return require("lazy.core.config").spec.plugins[name] +end + +---@param name string +---@param path string? +function M.get_plugin_path(name, path) + local plugin = M.get_plugin(name) + path = path and "/" .. path or "" + return plugin and (plugin.dir .. path) +end + ---@param plugin string function M.has(plugin) - return require("lazy.core.config").spec.plugins[plugin] ~= nil + return M.get_plugin(plugin) ~= nil end ---@param fn fun() From 5e76948d58d3ccae57b1cc09474a1f8b36d100ce Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 2 Jun 2024 09:33:52 +0200 Subject: [PATCH 479/526] feat(coding): use `lazydev.nvim` instead of `neodev.nvim` --- NEWS.md | 6 ++++++ lua/lazyvim/plugins/coding.lua | 22 ++++++++++++++++++++++ lua/lazyvim/plugins/compat/nvim-0_9.lua | 18 ++++++++++++++---- lua/lazyvim/plugins/lsp/init.lua | 1 - 4 files changed, 42 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index 72882791..05a1ddce 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,12 @@ ## 11.x +- **Neovim >= 0.10** now uses the much faster [lazydev.nvim](https://github.com/folke/lazydev.nvim) + instead of `neodev.nvim` + +- moved `neoconf.nvim` to extras. Project specific LSP settings + can be done with a `.lazy.lua` file instead. + - `mini.ai` is back as a default plugin! Removing it was a mistake. It's a great plugin that enhances the native text objects. diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index a3c91c3d..1f2cd7ae 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -200,4 +200,26 @@ return { } end, }, + + { + "folke/lazydev.nvim", + ft = "lua", + opts = function() + return { + library = { + uv = LazyVim.get_plugin_path("luvit-meta", "library"), + lazyvim = LazyVim.get_plugin_path("LazyVim"), + }, + } + end, + }, + -- Manage libuv types with lazy. Plugin will never be loaded + { "Bilal2453/luvit-meta", lazy = true }, + -- Add lazydev source to cmp + { + "hrsh7th/nvim-cmp", + opts = function(_, opts) + table.insert(opts.sources, { name = "lazydev", group_index = 0 }) + end, + }, } diff --git a/lua/lazyvim/plugins/compat/nvim-0_9.lua b/lua/lazyvim/plugins/compat/nvim-0_9.lua index 2962c97c..36394a72 100644 --- a/lua/lazyvim/plugins/compat/nvim-0_9.lua +++ b/lua/lazyvim/plugins/compat/nvim-0_9.lua @@ -1,8 +1,18 @@ +-- Compatibility with Neovim 0.9 return { + -- Use LuaSnip instead of native snippets { import = "lazyvim.plugins.extras.coding.luasnip" }, - { - "folke/ts-comments.nvim", - enabled = false, - }, + + -- Use mini.comment instead of ts-comments + { "folke/ts-comments.nvim", enabled = false }, { import = "lazyvim.plugins.extras.coding.mini-comment" }, + + -- Use neodev instead of lazydev + { "folke/lazydev.nvim", enabled = false }, + { + "neovim/nvim-lspconfig", + dependencies = { + { "folke/neodev.nvim", opts = {} }, + }, + }, } diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 7e871a99..1df5f728 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -4,7 +4,6 @@ return { "neovim/nvim-lspconfig", event = "LazyFile", dependencies = { - { "folke/neodev.nvim", opts = {} }, "mason.nvim", "williamboman/mason-lspconfig.nvim", }, From 6ba62855e24861d0187556af601ed81643aef7c2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 2 Jun 2024 07:35:29 +0000 Subject: [PATCH 480/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 39d95790..63d911f6 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 01 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 02 ============================================================================== Table of Contents *LazyVim-table-of-contents* From b289fea1636eda08d82344dc32a114bca550e375 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 2 Jun 2024 10:03:48 +0200 Subject: [PATCH 481/526] chore(main): release 12.3.0 (#3415) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5eb5ac9..7dadeb09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## [12.3.0](https://github.com/LazyVim/LazyVim/compare/v12.2.0...v12.3.0) (2024-06-02) + + +### Features + +* **coding:** use `lazydev.nvim` instead of `neodev.nvim` ([5e76948](https://github.com/LazyVim/LazyVim/commit/5e76948d58d3ccae57b1cc09474a1f8b36d100ce)) +* **extras:** show extras imported in other extras ([b2858a2](https://github.com/LazyVim/LazyVim/commit/b2858a297a465546e9f34d5c3e9d42b9716048eb)) +* **extras:** split enabled in enabled plugins/languages ([45b92aa](https://github.com/LazyVim/LazyVim/commit/45b92aa381243417462fb4aac92478ce50b4e126)) +* moved neoconf.nvim to extras ([c14d21c](https://github.com/LazyVim/LazyVim/commit/c14d21ce7534ff302c1ccf0b22f46160ea98ccf1)) +* **util:** utility methods for lazy plugins ([596c439](https://github.com/LazyVim/LazyVim/commit/596c439db572c8b37c442a1f425b3f452607fd36)) + + +### Bug Fixes + +* **dot:** added dot to recommended ([c69553e](https://github.com/LazyVim/LazyVim/commit/c69553e1942a646917c92f3643a2ca78eeb19adf)) +* **json:** added *.json to recommended ([c98fbef](https://github.com/LazyVim/LazyVim/commit/c98fbef3b56fe6ba709254cdc90c8c46c078d555)) +* **util:** make sure doc gen works ([c33d657](https://github.com/LazyVim/LazyVim/commit/c33d6578a8b2ce03cab58d5952d717064125ef5d)) + ## [12.2.0](https://github.com/LazyVim/LazyVim/compare/v12.1.0...v12.2.0) (2024-06-01) From 6da95ee7d35f7eab4297c2229d8d79d43f5d12bc Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 2 Jun 2024 12:30:51 +0200 Subject: [PATCH 482/526] fix(todo-comments): use trouble filters for showing only todo/fix/fixmes --- lua/lazyvim/plugins/editor.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index bd59b52b..bfb05930 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -471,8 +471,8 @@ return { keys = { { "]t", function() require("todo-comments").jump_next() end, desc = "Next Todo Comment" }, { "[t", function() require("todo-comments").jump_prev() end, desc = "Previous Todo Comment" }, - { "xt", "TodoTrouble", desc = "Todo (Trouble)" }, - { "xT", "TodoTrouble keywords=TODO,FIX,FIXME", desc = "Todo/Fix/Fixme (Trouble)" }, + { "xt", "Trouble todo", desc = "Todo (Trouble)" }, + { "xT", "Trouble todo filter = {tag = {TODO,FIX,FIXME}}", desc = "Todo/Fix/Fixme (Trouble)" }, { "st", "TodoTelescope", desc = "Todo" }, { "sT", "TodoTelescope keywords=TODO,FIX,FIXME", desc = "Todo/Fix/Fixme" }, }, From bb66618f1fc265c7a702f3d13d704ffbb1066178 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 2 Jun 2024 14:24:14 +0200 Subject: [PATCH 483/526] fix(lazydev): easier way of defining library plugin paths --- lua/lazyvim/plugins/coding.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 1f2cd7ae..b39976e3 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -207,8 +207,8 @@ return { opts = function() return { library = { - uv = LazyVim.get_plugin_path("luvit-meta", "library"), - lazyvim = LazyVim.get_plugin_path("LazyVim"), + uv = "luvit-meta/library", + lazyvim = "LazyVim", }, } end, From 028d5bcac5b2a9b6ceb23e2df9c92bdc7d711674 Mon Sep 17 00:00:00 2001 From: Abhimanyu Sharma <71812498+0xN1nja@users.noreply.github.com> Date: Sun, 2 Jun 2024 18:23:58 +0530 Subject: [PATCH 484/526] fix(todo-comments): use toggle for Trouble todo commands (#3424) --- lua/lazyvim/plugins/editor.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index bfb05930..b434ded1 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -471,8 +471,8 @@ return { keys = { { "]t", function() require("todo-comments").jump_next() end, desc = "Next Todo Comment" }, { "[t", function() require("todo-comments").jump_prev() end, desc = "Previous Todo Comment" }, - { "xt", "Trouble todo", desc = "Todo (Trouble)" }, - { "xT", "Trouble todo filter = {tag = {TODO,FIX,FIXME}}", desc = "Todo/Fix/Fixme (Trouble)" }, + { "xt", "Trouble todo toggle", desc = "Todo (Trouble)" }, + { "xT", "Trouble todo toggle filter = {tag = {TODO,FIX,FIXME}}", desc = "Todo/Fix/Fixme (Trouble)" }, { "st", "TodoTelescope", desc = "Todo" }, { "sT", "TodoTelescope keywords=TODO,FIX,FIXME", desc = "Todo/Fix/Fixme" }, }, From 83c0c9405acf4682d473188dd2ce3126c1261ea9 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 2 Jun 2024 17:47:25 +0200 Subject: [PATCH 485/526] fix: fixup for nvim-snippets compat on 0.9. Fixes #3426 --- lua/lazyvim/plugins/compat/nvim-0_9.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/compat/nvim-0_9.lua b/lua/lazyvim/plugins/compat/nvim-0_9.lua index 36394a72..fc56b925 100644 --- a/lua/lazyvim/plugins/compat/nvim-0_9.lua +++ b/lua/lazyvim/plugins/compat/nvim-0_9.lua @@ -1,6 +1,7 @@ -- Compatibility with Neovim 0.9 return { -- Use LuaSnip instead of native snippets + { "garymjr/nvim-snippets", enabled = false }, { import = "lazyvim.plugins.extras.coding.luasnip" }, -- Use mini.comment instead of ts-comments From da7b7738eb84b00c949f48afabebd39266e61d75 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 2 Jun 2024 18:43:44 +0200 Subject: [PATCH 486/526] fix(luasnip): move mappings to cmp spec so that they dont conflict with native snippets --- lua/lazyvim/plugins/extras/coding/luasnip.lua | 59 ++++++++++--------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/lua/lazyvim/plugins/extras/coding/luasnip.lua b/lua/lazyvim/plugins/extras/coding/luasnip.lua index 3a12f9db..bf0b3ea0 100644 --- a/lua/lazyvim/plugins/extras/coding/luasnip.lua +++ b/lua/lazyvim/plugins/extras/coding/luasnip.lua @@ -1,34 +1,38 @@ return { - "L3MON4D3/LuaSnip", - build = (not LazyVim.is_win()) - and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp" - or nil, - dependencies = { - { - "rafamadriz/friendly-snippets", - config = function() - require("luasnip.loaders.from_vscode").lazy_load() - end, - }, - { - "nvim-cmp", - dependencies = { - "saadparwaiz1/cmp_luasnip", + { + "L3MON4D3/LuaSnip", + build = (not LazyVim.is_win()) + and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp" + or nil, + dependencies = { + { + "rafamadriz/friendly-snippets", + config = function() + require("luasnip.loaders.from_vscode").lazy_load() + end, }, - opts = function(_, opts) - opts.snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - } - table.insert(opts.sources, { name = "luasnip" }) - end, + { + "nvim-cmp", + dependencies = { + "saadparwaiz1/cmp_luasnip", + }, + opts = function(_, opts) + opts.snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + } + table.insert(opts.sources, { name = "luasnip" }) + end, + }, + }, + opts = { + history = true, + delete_check_events = "TextChanged", }, }, - opts = { - history = true, - delete_check_events = "TextChanged", - }, + { + "nvim-cmp", -- stylua: ignore keys = { { @@ -41,4 +45,5 @@ return { { "", function() require("luasnip").jump(1) end, mode = "s" }, { "", function() require("luasnip").jump(-1) end, mode = { "i", "s" } }, }, + }, } From 6c3fd9fedfa83bac9e63c04d24ff2760569b845e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 3 Jun 2024 07:12:17 +0200 Subject: [PATCH 487/526] fix: hack for dashboard.nvim so that it shows errors when exiting --- lua/lazyvim/plugins/ui.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 6f371351..468e7c4f 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -354,7 +354,7 @@ return { { action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" }, { action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" }, { action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" }, - { action = "qa", desc = " Quit", icon = " ", key = "q" }, + { action = function() vim.api.nvim_input("qa") end, desc = " Quit", icon = " ", key = "q" }, }, footer = function() local stats = require("lazy").stats() From 40df5896d5009dad210f91a767dfcdd673bc7e0f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 3 Jun 2024 07:12:58 +0000 Subject: [PATCH 488/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 63d911f6..7e1d818e 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 02 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 03 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 1731e455d41a9baa6c80bbc9e89e23c104479431 Mon Sep 17 00:00:00 2001 From: Victor Batarse <80638470+Alt-iOS@users.noreply.github.com> Date: Mon, 3 Jun 2024 01:22:23 -0600 Subject: [PATCH 489/526] fix(hipatterns): update mini-hipatterns.lua config to add support for heex, rust and svelte files (#3430) * Update mini-hipatterns.lua added support for heex, rust and svelte to hipatterns * Update mini-hipatterns.lua --- .../plugins/extras/util/mini-hipatterns.lua | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/util/mini-hipatterns.lua b/lua/lazyvim/plugins/extras/util/mini-hipatterns.lua index 7c887088..5e4f5c43 100644 --- a/lua/lazyvim/plugins/extras/util/mini-hipatterns.lua +++ b/lua/lazyvim/plugins/extras/util/mini-hipatterns.lua @@ -14,7 +14,18 @@ M.plugin = { -- custom LazyVim option to enable the tailwind integration tailwind = { enabled = true, - ft = { "typescriptreact", "javascriptreact", "css", "javascript", "typescript", "html" }, + ft = { + "typescriptreact", + "javascriptreact", + "css", + "javascript", + "typescript", + "html", + "svelte", + "rust", + "html-eex", + "heex", + }, -- full: the whole css class will be highlighted -- compact: only the color will be highlighted style = "full", @@ -41,7 +52,18 @@ M.plugin = { if opts.tailwind == true then opts.tailwind = { enabled = true, - ft = { "typescriptreact", "javascriptreact", "css", "javascript", "typescript", "html" }, + ft = { + "typescriptreact", + "javascriptreact", + "css", + "javascript", + "typescript", + "html", + "svelte", + "rust", + "html-eex", + "heex", + }, style = "full", } end From d6c59d9a411a96fab22df03368b16740ea19da04 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 3 Jun 2024 09:24:19 +0200 Subject: [PATCH 490/526] feat(hipatterns): added vue/astro --- .../plugins/extras/util/mini-hipatterns.lua | 37 +++++-------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/lua/lazyvim/plugins/extras/util/mini-hipatterns.lua b/lua/lazyvim/plugins/extras/util/mini-hipatterns.lua index 5e4f5c43..287c0d77 100644 --- a/lua/lazyvim/plugins/extras/util/mini-hipatterns.lua +++ b/lua/lazyvim/plugins/extras/util/mini-hipatterns.lua @@ -14,17 +14,19 @@ M.plugin = { -- custom LazyVim option to enable the tailwind integration tailwind = { enabled = true, - ft = { - "typescriptreact", - "javascriptreact", + ft = { + "astro", "css", - "javascript", - "typescript", + "heex", "html", - "svelte", - "rust", "html-eex", - "heex", + "javascript", + "javascriptreact", + "rust", + "svelte", + "typescript", + "typescriptreact", + "vue", }, -- full: the whole css class will be highlighted -- compact: only the color will be highlighted @@ -48,25 +50,6 @@ M.plugin = { } end, config = function(_, opts) - -- backward compatibility - if opts.tailwind == true then - opts.tailwind = { - enabled = true, - ft = { - "typescriptreact", - "javascriptreact", - "css", - "javascript", - "typescript", - "html", - "svelte", - "rust", - "html-eex", - "heex", - }, - style = "full", - } - end if type(opts.tailwind) == "table" and opts.tailwind.enabled then -- reset hl groups when colorscheme changes vim.api.nvim_create_autocmd("ColorScheme", { From 4d706f1bdc687f1d4d4cd962ec166c65c453633e Mon Sep 17 00:00:00 2001 From: Aleksey Imuzov Date: Mon, 3 Jun 2024 12:30:57 +0400 Subject: [PATCH 491/526] fix(ui): fix incorrect colors on change colorscheme (lualine) (#3431) --- lua/lazyvim/plugins/ui.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 468e7c4f..e46faf51 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -157,24 +157,25 @@ return { { function() return require("noice").api.status.command.get() end, cond = function() return package.loaded["noice"] and require("noice").api.status.command.has() end, - color = LazyVim.ui.fg("Statement"), + color = function() return LazyVim.ui.fg("Statement") end, }, -- stylua: ignore { function() return require("noice").api.status.mode.get() end, cond = function() return package.loaded["noice"] and require("noice").api.status.mode.has() end, - color = LazyVim.ui.fg("Constant"), + color = function() return LazyVim.ui.fg("Constant") end, }, -- stylua: ignore { function() return " " .. require("dap").status() end, - cond = function () return package.loaded["dap"] and require("dap").status() ~= "" end, - color = LazyVim.ui.fg("Debug"), + cond = function() return package.loaded["dap"] and require("dap").status() ~= "" end, + color = function() return LazyVim.ui.fg("Debug") end, }, + -- stylua: ignore { require("lazy.status").updates, cond = require("lazy.status").has_updates, - color = LazyVim.ui.fg("Special"), + color = function() return LazyVim.ui.fg("Special") end, }, { "diff", From 39da8514d32c9eba40efa045c2d12d2170e206cf Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 4 Jun 2024 08:43:31 +0200 Subject: [PATCH 492/526] feat(lazydev): new lazydev config based on trigger words --- lua/lazyvim/plugins/coding.lua | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index b39976e3..289d82f5 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -204,14 +204,13 @@ return { { "folke/lazydev.nvim", ft = "lua", - opts = function() - return { - library = { - uv = "luvit-meta/library", - lazyvim = "LazyVim", - }, - } - end, + opts = { + library = { + { path = "luvit-meta/library", words = { "vim%.uv" } }, + { path = "LazyVim", words = { "LazyVim" } }, + { path = "lazy.nvim", words = { "LazyVim" } }, + }, + }, }, -- Manage libuv types with lazy. Plugin will never be loaded { "Bilal2453/luvit-meta", lazy = true }, From 2c6dbd9b896aa19094242dbb69d78fc92f04ad0f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 4 Jun 2024 06:44:06 +0000 Subject: [PATCH 493/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 7e1d818e..c6b65661 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 03 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 04 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 0c396e298a3fb9e405651288b260779d67f79956 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 4 Jun 2024 08:49:37 +0200 Subject: [PATCH 494/526] chore(main): release 12.4.0 (#3422) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dadeb09..4e2899c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [12.4.0](https://github.com/LazyVim/LazyVim/compare/v12.3.0...v12.4.0) (2024-06-04) + + +### Features + +* **hipatterns:** added vue/astro ([d6c59d9](https://github.com/LazyVim/LazyVim/commit/d6c59d9a411a96fab22df03368b16740ea19da04)) +* **lazydev:** new lazydev config based on trigger words ([39da851](https://github.com/LazyVim/LazyVim/commit/39da8514d32c9eba40efa045c2d12d2170e206cf)) + + +### Bug Fixes + +* fixup for nvim-snippets compat on 0.9. Fixes [#3426](https://github.com/LazyVim/LazyVim/issues/3426) ([83c0c94](https://github.com/LazyVim/LazyVim/commit/83c0c9405acf4682d473188dd2ce3126c1261ea9)) +* hack for dashboard.nvim so that it shows errors when exiting ([6c3fd9f](https://github.com/LazyVim/LazyVim/commit/6c3fd9fedfa83bac9e63c04d24ff2760569b845e)) +* **hipatterns:** update mini-hipatterns.lua config to add support for heex, rust and svelte files ([#3430](https://github.com/LazyVim/LazyVim/issues/3430)) ([1731e45](https://github.com/LazyVim/LazyVim/commit/1731e455d41a9baa6c80bbc9e89e23c104479431)) +* **lazydev:** easier way of defining library plugin paths ([bb66618](https://github.com/LazyVim/LazyVim/commit/bb66618f1fc265c7a702f3d13d704ffbb1066178)) +* **luasnip:** move mappings to cmp spec so that they dont conflict with native snippets ([da7b773](https://github.com/LazyVim/LazyVim/commit/da7b7738eb84b00c949f48afabebd39266e61d75)) +* **todo-comments:** use toggle for Trouble todo commands ([#3424](https://github.com/LazyVim/LazyVim/issues/3424)) ([028d5bc](https://github.com/LazyVim/LazyVim/commit/028d5bcac5b2a9b6ceb23e2df9c92bdc7d711674)) +* **todo-comments:** use trouble filters for showing only todo/fix/fixmes ([6da95ee](https://github.com/LazyVim/LazyVim/commit/6da95ee7d35f7eab4297c2229d8d79d43f5d12bc)) +* **ui:** fix incorrect colors on change colorscheme (lualine) ([#3431](https://github.com/LazyVim/LazyVim/issues/3431)) ([4d706f1](https://github.com/LazyVim/LazyVim/commit/4d706f1bdc687f1d4d4cd962ec166c65c453633e)) + ## [12.3.0](https://github.com/LazyVim/LazyVim/compare/v12.2.0...v12.3.0) (2024-06-02) From 3df8af369c49e13763a7c8962a005aef7604d018 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 4 Jun 2024 09:39:25 +0200 Subject: [PATCH 495/526] fix(tex): remove latex treesitter support since it's not needed with vimtex and it needs treesitter-cli --- lua/lazyvim/plugins/extras/lang/tex.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/tex.lua b/lua/lazyvim/plugins/extras/lang/tex.lua index 2d1bca56..5d667b40 100644 --- a/lua/lazyvim/plugins/extras/lang/tex.lua +++ b/lua/lazyvim/plugins/extras/lang/tex.lua @@ -20,7 +20,7 @@ return { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) if type(opts.ensure_installed) == "table" then - vim.list_extend(opts.ensure_installed, { "bibtex", "latex" }) + vim.list_extend(opts.ensure_installed, { "bibtex" }) end if type(opts.highlight.disable) == "table" then vim.list_extend(opts.highlight.disable, { "latex" }) From ae0d94e048423903743b657be3a827d9685761c3 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 4 Jun 2024 09:39:35 +0200 Subject: [PATCH 496/526] fix(lazydev): add cmd --- lua/lazyvim/plugins/coding.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 289d82f5..0e903ba0 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -204,6 +204,7 @@ return { { "folke/lazydev.nvim", ft = "lua", + cmd = "LazyDev", opts = { library = { { path = "luvit-meta/library", words = { "vim%.uv" } }, From c50018b791a6295fb0f3219fe637209a381db4c4 Mon Sep 17 00:00:00 2001 From: Brian Di Palma <1597820+briandipalma@users.noreply.github.com> Date: Tue, 4 Jun 2024 08:51:36 +0100 Subject: [PATCH 497/526] feat(editor): added extra for inc-rename.nvim (#3432) * feat(editor-extra): Add inc-rename * fix: refactor and moved noice integration --------- Co-authored-by: Folke Lemaitre --- .../plugins/extras/editor/inc-rename.lua | 38 +++++++++++++++++++ lua/lazyvim/plugins/lsp/keymaps.lua | 16 +------- lua/lazyvim/plugins/ui.lua | 1 - 3 files changed, 40 insertions(+), 15 deletions(-) create mode 100644 lua/lazyvim/plugins/extras/editor/inc-rename.lua diff --git a/lua/lazyvim/plugins/extras/editor/inc-rename.lua b/lua/lazyvim/plugins/extras/editor/inc-rename.lua new file mode 100644 index 00000000..a7c65243 --- /dev/null +++ b/lua/lazyvim/plugins/extras/editor/inc-rename.lua @@ -0,0 +1,38 @@ +return { + + -- Rename with cmdpreview + recommended = true, + desc = "Incremental LSP renaming based on Neovim's command-preview feature", + { + "smjonas/inc-rename.nvim", + cmd = "IncRename", + opts = {}, + }, + + -- LSP Keymaps + { + "neovim/nvim-lspconfig", + opts = function() + local keys = require("lazyvim.plugins.lsp.keymaps").get() + keys[#keys + 1] = { + "cr", + function() + local inc_rename = require("inc_rename") + return ":" .. inc_rename.config.cmd_name .. " " .. vim.fn.expand("") + end, + expr = true, + desc = "Rename (inc-rename.nvim)", + has = "rename", + } + end, + }, + + --- Noice integration + { + "folke/noice.nvim", + optional = true, + opts = { + presets = { inc_rename = true }, + }, + }, +} diff --git a/lua/lazyvim/plugins/lsp/keymaps.lua b/lua/lazyvim/plugins/lsp/keymaps.lua index d56cee08..3f2bd690 100644 --- a/lua/lazyvim/plugins/lsp/keymaps.lua +++ b/lua/lazyvim/plugins/lsp/keymaps.lua @@ -26,6 +26,7 @@ function M.get() { "cc", vim.lsp.codelens.run, desc = "Run Codelens", mode = { "n", "v" }, has = "codeLens" }, { "cC", vim.lsp.codelens.refresh, desc = "Refresh & Display Codelens", mode = { "n" }, has = "codeLens" }, { "cR", LazyVim.lsp.rename_file, desc = "Rename File", mode ={"n"}, has = { "workspace/didRenameFiles", "workspace/willRenameFiles" } }, + { "cr", vim.lsp.buf.rename, desc = "Rename", has = "rename" }, { "cA", function() @@ -50,20 +51,7 @@ function M.get() { "", function() LazyVim.lsp.words.jump(-vim.v.count1, true) end, has = "documentHighlight", desc = "Prev Reference", cond = function() return LazyVim.lsp.words.enabled end }, } - if LazyVim.has("inc-rename.nvim") then - M._keys[#M._keys + 1] = { - "cr", - function() - local inc_rename = require("inc_rename") - return ":" .. inc_rename.config.cmd_name .. " " .. vim.fn.expand("") - end, - expr = true, - desc = "Rename", - has = "rename", - } - else - M._keys[#M._keys + 1] = { "cr", vim.lsp.buf.rename, desc = "Rename", has = "rename" } - end + return M._keys end diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index e46faf51..18aa5200 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -299,7 +299,6 @@ return { bottom_search = true, command_palette = true, long_message_to_split = true, - inc_rename = true, }, }, -- stylua: ignore From 1677b3b84f53d410d50c5a2aca32ca7c5e900917 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 4 Jun 2024 11:14:48 +0200 Subject: [PATCH 498/526] feat(lazydev): use lazydev with neodev types (not the plugin) on Neovim 0.9.x --- lua/lazyvim/plugins/compat/nvim-0_9.lua | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/plugins/compat/nvim-0_9.lua b/lua/lazyvim/plugins/compat/nvim-0_9.lua index fc56b925..6488952b 100644 --- a/lua/lazyvim/plugins/compat/nvim-0_9.lua +++ b/lua/lazyvim/plugins/compat/nvim-0_9.lua @@ -8,12 +8,22 @@ return { { "folke/ts-comments.nvim", enabled = false }, { import = "lazyvim.plugins.extras.coding.mini-comment" }, - -- Use neodev instead of lazydev - { "folke/lazydev.nvim", enabled = false }, + -- Use neodev-types with lazydev + { "folke/neodev.nvim", config = function() end }, + { + "folke/lazydev.nvim", + opts = function(_, opts) + opts.library = opts.library or {} + table.insert(opts.library, { "neodev.nvim/types/stable" }) + end, + config = function(_, opts) + -- force lazydev to load on Neovim 0.9 + require("lazydev.config").have_0_10 = true + require("lazydev").setup(opts) + end, + }, { "neovim/nvim-lspconfig", - dependencies = { - { "folke/neodev.nvim", opts = {} }, - }, + dependencies = {}, }, } From 9a635ef8d690a3cfcf6d3bf54e8ad61156b9d150 Mon Sep 17 00:00:00 2001 From: Erik Lindebratt Date: Tue, 4 Jun 2024 11:31:29 +0200 Subject: [PATCH 499/526] fix(lsp): Enable using `deno.enablePaths` in denols settings (#3446) --- lua/lazyvim/plugins/lsp/init.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 1df5f728..5066d393 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -244,8 +244,11 @@ return { if LazyVim.lsp.is_enabled("denols") and LazyVim.lsp.is_enabled("vtsls") then local is_deno = require("lspconfig.util").root_pattern("deno.json", "deno.jsonc") LazyVim.lsp.disable("vtsls", is_deno) - LazyVim.lsp.disable("denols", function(root_dir) - return not is_deno(root_dir) + LazyVim.lsp.disable("denols", function(root_dir, config) + if not is_deno(root_dir) then + config.settings.deno.enable = false + end + return false end) end end, From 987bd2207f7f2f7f72f65b0e7e811ec04c03aa32 Mon Sep 17 00:00:00 2001 From: Radvil <36059968+radvil@users.noreply.github.com> Date: Wed, 5 Jun 2024 01:03:16 +0800 Subject: [PATCH 500/526] feat(extras): Add extra for angular lspconfig (#2806) * feat(extras): Add extra for angular lspconfig Since treesitter has better support for angular parser recently that works for the legacy and the latest version of it, I am happy to suggest this extra configuration that works for well for me without any issue. And since lack of references about how to config the angular lsp inside of neovim out there, this will work fine as a starting point. * feat(extras): Added `angularls` lsp configuration * feat(extras.lang): update `angularls` configuration --------- Co-authored-by: Radvil --- lua/lazyvim/plugins/extras/lang/angular.lua | 56 +++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lang/angular.lua diff --git a/lua/lazyvim/plugins/extras/lang/angular.lua b/lua/lazyvim/plugins/extras/lang/angular.lua new file mode 100644 index 00000000..ce8a62e4 --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/angular.lua @@ -0,0 +1,56 @@ +return { + recommended = function() + return LazyVim.extras.wants({ + root = { + "angular.json", + "nx.json", --support for nx workspace + }, + }) + end, + + { + "nvim-treesitter", + opts = function(_, opts) + if type(opts.ensure_installed) == "table" then + vim.list_extend(opts.ensure_installed, { "angular", "scss" }) + end + end, + }, + + -- angularls depends on typescript + { import = "lazyvim.plugins.extras.lang.typescript" }, + + -- LSP Servers + { + "neovim/nvim-lspconfig", + opts = { + servers = { + angularls = {}, + }, + setup = { + angularls = function() + LazyVim.lsp.on_attach(function(client) + if client.name == "angularls" then + --HACK: disable angular renaming capability due to duplicate rename popping up + client.server_capabilities.renameProvider = false + end + end) + end, + }, + }, + }, + + -- Configure tsserver plugin + { + "neovim/nvim-lspconfig", + opts = function(_, opts) + LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", { + { + name = "@angular/language-server", + location = LazyVim.get_pkg_path("angular-language-server", "/node_modules/@angular/language-server"), + enableForWorkspaceTypeScriptVersions = false, + }, + }) + end, + }, +} From 8971ea25f953f778c8db999da4de240a07713aaa Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Wed, 5 Jun 2024 07:54:52 +0300 Subject: [PATCH 501/526] fix(toggle): Restore width/height values when closing while maximized is toggled on (#3453) --- lua/lazyvim/util/toggle.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index b001798f..c0dce716 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -88,6 +88,17 @@ function M.maximize() vim.o.winwidth = 999 vim.o.winheight = 999 end + -- `QuitPre` seems to be executed even if we quit a normal window, so we don't want that + -- `VimLeavePre` might be another consideration? Not sure about differences between the 2 + vim.api.nvim_create_autocmd("ExitPre", { + once = true, + group = vim.api.nvim_create_augroup("lazyvim_restore_max_exit_pre", { clear = true }), + desc = "Restore width/height when close Neovim while maximized", + callback = function() + vim.o.winwidth = M._maximized.width + vim.o.winheight = M._maximized.height + end, + }) end setmetatable(M, { From 90e68edfe70c665a7f5a6f783f47a847a148ef1b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 5 Jun 2024 04:55:23 +0000 Subject: [PATCH 502/526] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index c6b65661..c8522a17 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 04 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 05 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 1c583650e66b6f468e8ece4292bfe8bd3f7e1c94 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 07:02:16 +0200 Subject: [PATCH 503/526] fix(toggle): un-maximize when quiting Neovim --- lua/lazyvim/util/toggle.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index c0dce716..be915046 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -73,8 +73,13 @@ function M.inlay_hints(buf, value) end end +---@type {width:number, height:number}? M._maximized = nil -function M.maximize() +---@param state boolean? +function M.maximize(state) + if state == (M._maximized ~= nil) then + return + end if M._maximized then vim.o.winwidth = M._maximized.width vim.o.winheight = M._maximized.height @@ -95,8 +100,7 @@ function M.maximize() group = vim.api.nvim_create_augroup("lazyvim_restore_max_exit_pre", { clear = true }), desc = "Restore width/height when close Neovim while maximized", callback = function() - vim.o.winwidth = M._maximized.width - vim.o.winheight = M._maximized.height + M.maximize(false) end, }) end From 452b70ad15714593a91bed90448313228dd5135a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 07:40:28 +0200 Subject: [PATCH 504/526] fix(toggle): slightly better maximize --- lua/lazyvim/util/toggle.lua | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index be915046..95bb3e76 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -73,7 +73,7 @@ function M.inlay_hints(buf, value) end end ----@type {width:number, height:number}? +---@type {k:string, v:any}[] M._maximized = nil ---@param state boolean? function M.maximize(state) @@ -81,17 +81,22 @@ function M.maximize(state) return end if M._maximized then - vim.o.winwidth = M._maximized.width - vim.o.winheight = M._maximized.height + for _, opt in ipairs(M._maximized) do + vim.o[opt.k] = opt.v + end M._maximized = nil vim.cmd("wincmd =") else - M._maximized = { - width = vim.o.winwidth, - height = vim.o.winheight, - } - vim.o.winwidth = 999 - vim.o.winheight = 999 + M._maximized = {} + local function set(k, v) + table.insert(M._maximized, 1, { k = k, v = vim.o[k] }) + vim.o[k] = v + end + set("winwidth", 999) + set("winheight", 999) + set("winminwidth", 10) + set("winminheight", 4) + vim.cmd("wincmd =") end -- `QuitPre` seems to be executed even if we quit a normal window, so we don't want that -- `VimLeavePre` might be another consideration? Not sure about differences between the 2 From c1f5fcf9c7ed2659c9d5ac41b3bb8a93e0a3c6a0 Mon Sep 17 00:00:00 2001 From: HJK <79628639+gpwns3717@users.noreply.github.com> Date: Wed, 5 Jun 2024 15:07:13 +0900 Subject: [PATCH 505/526] =?UTF-8?q?fix(extra.lang.scala):=20Fix=20the=20al?= =?UTF-8?q?ways=20initializing=20regardless=20of=20file=E2=80=A6=20(#3455)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(extra.lang.scala): Fix the always initializing regardless of filetype * fix typo --- lua/lazyvim/plugins/extras/lang/scala.lua | 120 +++++++++++----------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/scala.lua b/lua/lazyvim/plugins/extras/lang/scala.lua index 0722b8d6..2092b15c 100644 --- a/lua/lazyvim/plugins/extras/lang/scala.lua +++ b/lua/lazyvim/plugins/extras/lang/scala.lua @@ -1,7 +1,3 @@ --- NOTE: This setup does not define any lsp or dap specific key bindings --- It is recommended that the LazyVim extras dap-core is imported "lazyvim.plugins.extras.dap.core" --- If you like you can setup your own key bindings. --- For minimalistic setup have a look at https://github.com/scalameta/nvim-metals/discussions/39 return { recommended = function() return LazyVim.extras.wants({ @@ -10,44 +6,72 @@ return { }) end, { - "hrsh7th/nvim-cmp", - requires = { - { "hrsh7th/cmp-nvim-lsp" }, - { "hrsh7th/cmp-vsnip" }, - { "hrsh7th/vim-vsnip" }, - }, + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + if type(opts.ensure_installed) == "table" then + vim.list_extend(opts.ensure_installed, { "scala" }) + end + end, }, { "scalameta/nvim-metals", - dependencies = { - "nvim-lua/plenary.nvim", - "mfussenegger/nvim-dap", - }, - ft = { "scala", "sbt", "java" }, - init = function() - local metals_config = require("metals").bare_config() - metals_config.init_options.statusBarProvider = "off" - metals_config.settings = { - showImplicitArguments = true, - excludedPackages = { "akka.actor.typed.javadsl", "com.github.swagger.akka.javadsl" }, - } - metals_config.capabilities = require("cmp_nvim_lsp").default_capabilities() - metals_config.on_attach = function(client, bufnr) - require("metals").setup_dap() - end + ft = { "scala", "sbt" }, + config = function() end, + }, + { + "neovim/nvim-lspconfig", + opts = { + servers = { + metals = { + keys = { + { + "me", + function() + require("telescope").extensions.metals.commands() + end, + desc = "Metals commands", + }, + { + "mc", + function() + require("metals").compile_cascade() + end, + desc = "Metals compile cascade", + }, + }, + init_options = { + statusBarProvider = "off", + }, + settings = { + showImplicitArguments = true, + excludedPackages = { "akka.actor.typed.javadsl", "com.github.swagger.akka.javadsl" }, + }, + }, + }, + setup = { + metals = function(_, opts) + local metals = require("metals") + local metals_config = vim.tbl_deep_extend("force", metals.bare_config(), opts) + metals_config.on_attach = LazyVim.has("nvim-dap") and metals.setup_dap or nil - local nvim_metals_group = vim.api.nvim_create_augroup("nvim-metals", { clear = true }) - vim.api.nvim_create_autocmd("FileType", { - -- NOTE: You may or may not want java included here. You will need it if you - -- want basic Java support but it may also conflict if you are using - -- something like nvim-jdtls which also works on a java filetype autocmd. - pattern = { "scala", "sbt", "java" }, - callback = function() - require("metals").initialize_or_attach(metals_config) + local nvim_metals_group = vim.api.nvim_create_augroup("nvim-metals", { clear = true }) + vim.api.nvim_create_autocmd("FileType", { + pattern = { "scala", "sbt" }, + callback = function() + metals.initialize_or_attach(metals_config) + end, + group = nvim_metals_group, + }) + return true end, - group = nvim_metals_group, - }) + }, + }, + }, + { + "mfussenegger/nvim-dap", + optional = true, + opts = function() -- Debug settings local dap = require("dap") dap.configurations.scala = { @@ -70,29 +94,5 @@ return { }, } end, - keys = { - { - "me", - function() - require("telescope").extensions.metals.commands() - end, - desc = "Metals commands", - ft = { "scala", "sbt", "java" }, - }, - { - "mc", - function() - require("metals").compile_cascade() - end, - desc = "Metals compile cascade", - ft = { "scala", "sbt", "java" }, - }, - }, - }, - { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - vim.list_extend(opts.ensure_installed, { "scala" }) - end, }, } From e32d1918ae676dbab3f5f121a9fa623cb4ee20bd Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 11:01:10 +0200 Subject: [PATCH 506/526] fix(python): removed the `python-semshi` extra --- .../plugins/extras/lang/python-semshi.lua | 33 ------------------- lua/lazyvim/util/plugin.lua | 4 +++ 2 files changed, 4 insertions(+), 33 deletions(-) delete mode 100644 lua/lazyvim/plugins/extras/lang/python-semshi.lua diff --git a/lua/lazyvim/plugins/extras/lang/python-semshi.lua b/lua/lazyvim/plugins/extras/lang/python-semshi.lua deleted file mode 100644 index 2e6df6f9..00000000 --- a/lua/lazyvim/plugins/extras/lang/python-semshi.lua +++ /dev/null @@ -1,33 +0,0 @@ -return { - -- "numiras/semshi", - "wookayin/semshi", -- use a maintained fork - ft = "python", - build = ":UpdateRemotePlugins", - init = function() - -- Disabled these features better provided by LSP or other more general plugins - vim.g["semshi#error_sign"] = false - vim.g["semshi#simplify_markup"] = false - vim.g["semshi#mark_selected_nodes"] = false - vim.g["semshi#update_delay_factor"] = 0.001 - - -- This autocmd must be defined in init to take effect - vim.api.nvim_create_autocmd({ "VimEnter", "ColorScheme" }, { - group = vim.api.nvim_create_augroup("SemanticHighlight", {}), - callback = function() - -- Only add style, inherit or link to the LSP's colors - vim.cmd([[ - highlight! link semshiGlobal @none - highlight! link semshiImported @none - highlight! link semshiParameter @lsp.type.parameter - highlight! link semshiBuiltin @function.builtin - highlight! link semshiAttribute @field - highlight! link semshiSelf @lsp.type.selfKeyword - highlight! link semshiUnresolved @none - highlight! link semshiFree @none - highlight! link semshiAttribute @none - highlight! link semshiParameterUnused @none - ]]) - end, - }) - end, -} diff --git a/lua/lazyvim/util/plugin.lua b/lua/lazyvim/util/plugin.lua index 9886122b..f34527ac 100644 --- a/lua/lazyvim/util/plugin.lua +++ b/lua/lazyvim/util/plugin.lua @@ -15,6 +15,10 @@ M.deprecated_extras = { ["lazyvim.plugins.extras.coding.mini-ai"] = "`mini.ai` is now a core LazyVim plugin (again)", ["lazyvim.plugins.extras.lazyrc"] = "local spec files are now a lazy.nvim feature", ["lazyvim.plugins.extras.editor.trouble-v3"] = "Trouble v3 has been merged in main", + ["lazyvim.plugins.extras.lang.python-semshi"] = [[The python-semshi extra has been removed, + because it's causing too many issues. + Either use `basedpyright`, or copy the [old extra](https://github.com/LazyVim/LazyVim/blob/c1f5fcf9c7ed2659c9d5ac41b3bb8a93e0a3c6a0/lua/lazyvim/plugins/extras/lang/python-semshi.lua#L1) to your own config. + ]], } M.deprecated_modules = {} From d64d7615392d70c2ca1957f66725856d0a306b87 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 11:09:12 +0200 Subject: [PATCH 507/526] feat: enabled `ts-plugin` support for `astro` and `svelte` --- lua/lazyvim/plugins/extras/lang/astro.lua | 6 +----- lua/lazyvim/plugins/extras/lang/svelte.lua | 6 +----- lua/lazyvim/util/init.lua | 4 +++- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/astro.lua b/lua/lazyvim/plugins/extras/lang/astro.lua index c4192e27..c0e8cfc0 100644 --- a/lua/lazyvim/plugins/extras/lang/astro.lua +++ b/lua/lazyvim/plugins/extras/lang/astro.lua @@ -39,11 +39,7 @@ return { LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", { { name = "@astrojs/ts-plugin", - location = LazyVim.get_pkg_path( - "astro-language-server", - "/node_modules/@astrojs/ts-plugin", - { warn = false } - ), + location = LazyVim.get_pkg_path("astro-language-server", "/node_modules/@astrojs/ts-plugin"), enableForWorkspaceTypeScriptVersions = true, }, }) diff --git a/lua/lazyvim/plugins/extras/lang/svelte.lua b/lua/lazyvim/plugins/extras/lang/svelte.lua index 7b0588d2..4319b509 100644 --- a/lua/lazyvim/plugins/extras/lang/svelte.lua +++ b/lua/lazyvim/plugins/extras/lang/svelte.lua @@ -39,11 +39,7 @@ return { LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", { { name = "typescript-svelte-plugin", - location = LazyVim.get_pkg_path( - "svelte-language-server", - "/node_modules/typescript-svelte-plugin", - { warn = false } - ), + location = LazyVim.get_pkg_path("svelte-language-server", "/node_modules/typescript-svelte-plugin"), enableForWorkspaceTypeScriptVersions = true, }, }) diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index 2417b597..e6927069 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -246,7 +246,9 @@ function M.get_pkg_path(pkg, path, opts) path = path or "" local ret = root .. "/packages/" .. pkg .. "/" .. path if opts.warn and not vim.loop.fs_stat(ret) then - M.warn(("Mason package path not found for **%s**:\n- `%s`"):format(pkg, path)) + M.warn( + ("Mason package path not found for **%s**:\n- `%s`\nYou may need to force update the package."):format(pkg, path) + ) end return ret end From fa706b320b4c94da28136bdbab2ee1841974707c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ph=C3=BAc=20H=2E=20L=C3=AA=20Kh=E1=BA=AFc?= Date: Wed, 5 Jun 2024 13:23:19 +0400 Subject: [PATCH 508/526] feat(statuscol): statuscolumn options for open fold indicator and fold hl (#2923) * feat(statuscol): fold open indicator * fix: make it configurable --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/config/options.lua | 6 ++++++ lua/lazyvim/util/ui.lua | 17 +++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/config/options.lua b/lua/lazyvim/config/options.lua index 1531ef53..4480d5c5 100644 --- a/lua/lazyvim/config/options.lua +++ b/lua/lazyvim/config/options.lua @@ -19,6 +19,12 @@ vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" } -- Set to false to disable. vim.g.lazygit_config = true +-- Options for the LazyVim statuscolumn +vim.g.lazyvim_statuscolumn = { + folds_open = false, -- show fold sign when fold is open + folds_githl = false, -- highlight fold sign with git sign color +} + -- Optionally setup the terminal to use -- This sets `vim.o.shell` and does some additional configuration for: -- * pwsh diff --git a/lua/lazyvim/util/ui.lua b/lua/lazyvim/util/ui.lua index a7bdc700..5877fd7f 100644 --- a/lua/lazyvim/util/ui.lua +++ b/lua/lazyvim/util/ui.lua @@ -99,12 +99,18 @@ function M.statuscolumn() local components = { "", "", "" } -- left, middle, right + local show_open_folds = vim.g.lazyvim_statuscolumn and vim.g.lazyvim_statuscolumn.folds_open + local use_githl = vim.g.lazyvim_statuscolumn and vim.g.lazyvim_statuscolumn.folds_githl + if show_signs then ---@type Sign?,Sign?,Sign? - local left, right, fold + local left, right, fold, githl for _, s in ipairs(M.get_signs(buf, vim.v.lnum)) do if s.name and (s.name:find("GitSign") or s.name:find("MiniDiffSign")) then right = s + if use_githl then + githl = s["texthl"] + end else left = s end @@ -112,9 +118,16 @@ function M.statuscolumn() if vim.v.virtnum ~= 0 then left = nil end + vim.api.nvim_win_call(win, function() if vim.fn.foldclosed(vim.v.lnum) >= 0 then - fold = { text = vim.opt.fillchars:get().foldclose or "", texthl = "Folded" } + fold = { text = vim.opt.fillchars:get().foldclose or "", texthl = githl or "Folded" } + elseif + show_open_folds + and not LazyVim.ui.skip_foldexpr[buf] + and vim.treesitter.foldexpr(vim.v.lnum):sub(1, 1) == ">" + then -- fold start + fold = { text = vim.opt.fillchars:get().foldopen or "", texthl = githl } end end) -- Left: mark or non-git sign From 662e2ffe0ff8f43e15cf97029a5e1ec84bb1e376 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 13:41:59 +0200 Subject: [PATCH 509/526] fix(keymaps): use root dir for git log --- lua/lazyvim/config/keymaps.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 2bb782fc..5bd13527 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -141,8 +141,11 @@ map("n", "gf", function() end, { desc = "Lazygit Current File History" }) map("n", "gl", function() - LazyVim.lazygit({ args = { "log" } }) + LazyVim.lazygit({ args = { "log" }, cwd = LazyVim.root.git() }) end, { desc = "Lazygit Log" }) +map("n", "gL", function() + LazyVim.lazygit({ args = { "log" } }) +end, { desc = "Lazygit Log (cwd)" }) -- quit map("n", "qq", "qa", { desc = "Quit All" }) From c52242b05b96b24fd0630e854086aab1cf8e7ae7 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 13:42:15 +0200 Subject: [PATCH 510/526] style: format --- lua/lazyvim/plugins/ui.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 18aa5200..adecc5eb 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -346,15 +346,15 @@ return { header = vim.split(logo, "\n"), -- stylua: ignore center = { - { action = LazyVim.telescope("files"), desc = " Find File", icon = " ", key = "f" }, - { action = "ene | startinsert", desc = " New File", icon = " ", key = "n" }, - { action = "Telescope oldfiles", desc = " Recent Files", icon = " ", key = "r" }, - { action = "Telescope live_grep", desc = " Find Text", icon = " ", key = "g" }, - { action = [[lua LazyVim.telescope.config_files()()]], desc = " Config", icon = " ", key = "c" }, - { action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" }, - { action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" }, - { action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" }, - { action = function() vim.api.nvim_input("qa") end, desc = " Quit", icon = " ", key = "q" }, + { action = LazyVim.telescope("files"), desc = " Find File", icon = " ", key = "f" }, + { action = "ene | startinsert", desc = " New File", icon = " ", key = "n" }, + { action = "Telescope oldfiles", desc = " Recent Files", icon = " ", key = "r" }, + { action = "Telescope live_grep", desc = " Find Text", icon = " ", key = "g" }, + { action = [[lua LazyVim.telescope.config_files()()]], desc = " Config", icon = " ", key = "c" }, + { action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" }, + { action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" }, + { action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" }, + { action = function() vim.api.nvim_input("qa") end, desc = " Quit", icon = " ", key = "q" }, }, footer = function() local stats = require("lazy").stats() From 1faa5629642d650f31c6cfecbbbe33b429175884 Mon Sep 17 00:00:00 2001 From: Rubin Bhandari Date: Wed, 5 Jun 2024 18:34:33 +0545 Subject: [PATCH 511/526] ci: change the release please action name to new (#3259) * ci: change the release please action name to new * Update ci.yml * Create release-please-config.json * fix: add release manifest * fix: release-please --------- Co-authored-by: Folke Lemaitre --- .github/workflows/ci.yml | 5 +---- release-please-config.json | 5 +++++ 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 release-please-config.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b36e4c7..7b6f6478 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,13 +54,10 @@ jobs: - tests runs-on: ubuntu-latest steps: - - uses: google-github-actions/release-please-action@v4 + - uses: googleapis/release-please-action@v4 id: release with: release-type: simple - package-name: LazyVim - extra-files: | - lua/lazyvim/config/init.lua - uses: actions/checkout@v4 - name: tag stable versions if: ${{ steps.release.outputs.release_created }} diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..1d1b8b1d --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "release-type": "simple", + "extra-files": ["lua/lazyvim/config/init.lua"] +} From 75dcce02dce58618d401f1bc4213a6e77e759cce Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 15:03:08 +0200 Subject: [PATCH 512/526] ci: added PR labeler --- .github/labeler.yml | 19 +++++++++++++++++++ .github/workflows/labeler.yml | 13 +++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 00000000..bbe691b2 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,19 @@ +core: + - all: + - changed-files: + - any-glob-to-any-file: "lua/lazyvim/**" + - all-globs-to-all-files: "!lua/lazyvim/plugins/*" + +core-plugins: + - all: + - changed-files: + - any-glob-to-any-file: "lua/lazyvim/plugins/**" + - all-globs-to-all-files: "!lua/lazyvim/plugins/extras/*" + +extras: + - changed-files: + - any-glob-to-any-file: "lua/lazyvim/plugins/extras/**" + +extras-lang: + - changed-files: + - any-glob-to-any-file: "lua/lazyvim/plugins/extras/lang/**" diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 00000000..d045889e --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,13 @@ +name: "Pull Request Labeler" +on: + - workflow_dispatch + - pull_request_target + +jobs: + labeler: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v5 From b7649470617a89f5dddcea84b9299ce02064e3c4 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 15:08:20 +0200 Subject: [PATCH 513/526] ci: run labeler on existing PRs --- .github/workflows/labeler.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index d045889e..61f13c89 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -11,3 +11,35 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/labeler@v5 + with: + pr-number: | + 3444 + 3428 + 3403 + 3402 + 3353 + 3303 + 3301 + 3293 + 3291 + 3235 + 3212 + 3169 + 3148 + 3131 + 3128 + 3073 + 3023 + 2975 + 2960 + 2956 + 2910 + 2909 + 2907 + 2881 + 2878 + 2859 + 2858 + 2853 + 2837 + 2804 From cf2870cce0873debb8d4bec7c3d64af9f78ff21c Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 15:10:46 +0200 Subject: [PATCH 514/526] ci: fix labels --- .github/labeler.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index bbe691b2..9e3f87b8 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -2,13 +2,13 @@ core: - all: - changed-files: - any-glob-to-any-file: "lua/lazyvim/**" - - all-globs-to-all-files: "!lua/lazyvim/plugins/*" + - all-globs-to-all-files: "!lua/lazyvim/plugins/**" core-plugins: - all: - changed-files: - any-glob-to-any-file: "lua/lazyvim/plugins/**" - - all-globs-to-all-files: "!lua/lazyvim/plugins/extras/*" + - all-globs-to-all-files: "!lua/lazyvim/plugins/extras/**" extras: - changed-files: From 39c10b2b813308abf56293cc2cdfe9ebbc14fa21 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 15:16:39 +0200 Subject: [PATCH 515/526] ci: remove custom pr-numbers --- .github/workflows/labeler.yml | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 61f13c89..52474c6a 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,6 +1,5 @@ name: "Pull Request Labeler" on: - - workflow_dispatch - pull_request_target jobs: @@ -11,35 +10,3 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/labeler@v5 - with: - pr-number: | - 3444 - 3428 - 3403 - 3402 - 3353 - 3303 - 3301 - 3293 - 3291 - 3235 - 3212 - 3169 - 3148 - 3131 - 3128 - 3073 - 3023 - 2975 - 2960 - 2956 - 2910 - 2909 - 2907 - 2881 - 2878 - 2859 - 2858 - 2853 - 2837 - 2804 From 71165ac52a707350b67600c9c939b0c78a8f5c07 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 15:19:04 +0200 Subject: [PATCH 516/526] ci: label more PRs --- .github/workflows/labeler.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 52474c6a..992dc1d9 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,5 +1,6 @@ name: "Pull Request Labeler" on: + - workflow_dispatch - pull_request_target jobs: @@ -10,3 +11,31 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/labeler@v5 + with: + pr-number: | + 2802 + 2797 + 2795 + 2695 + 2519 + 2495 + 2450 + 2449 + 2421 + 2416 + 2285 + 2282 + 2242 + 2232 + 2179 + 1958 + 1956 + 1949 + 1935 + 1884 + 1849 + 1815 + 1750 + 1740 + 1484 + 1450 From 7ed5a6c371e334938eec5ad4e9193993470eee64 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 15:20:32 +0200 Subject: [PATCH 517/526] ci: remove custom pr-numbers again --- .github/workflows/labeler.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 992dc1d9..52474c6a 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,6 +1,5 @@ name: "Pull Request Labeler" on: - - workflow_dispatch - pull_request_target jobs: @@ -11,31 +10,3 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/labeler@v5 - with: - pr-number: | - 2802 - 2797 - 2795 - 2695 - 2519 - 2495 - 2450 - 2449 - 2421 - 2416 - 2285 - 2282 - 2242 - 2232 - 2179 - 1958 - 1956 - 1949 - 1935 - 1884 - 1849 - 1815 - 1750 - 1740 - 1484 - 1450 From a2cf7d9a11862997e54fa2ddfd56f364d349dd8c Mon Sep 17 00:00:00 2001 From: Seol So Date: Wed, 5 Jun 2024 09:22:30 -0400 Subject: [PATCH 518/526] docs: add the Korean version of README (#2495) --- README-KO.md | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 README-KO.md diff --git a/README-KO.md b/README-KO.md new file mode 100644 index 00000000..eb5cdb1d --- /dev/null +++ b/README-KO.md @@ -0,0 +1,139 @@ +
+ +
+ +
+ +

+ 설치하기 + · + 설정하기 + · + 문서 +

+ + + +LazyVim은 [💤 lazy.nvim](https://github.com/folke/lazy.nvim)를 기반으로 작동하는 Neovim 셋업입니다. 더 커스터마이징 가능하고, 설정들을 바꾸는 것을 쉽게 만들기위해 시작되었죠. 그저 처음부터 모든 설정들을 만지고 시작하는 방법, 또는 이미 만들어진 배포용 설정을 사용하는 방법이 있지만, LazyVIM은 이미 잘 설정된 환경과, 필요에 따라 쉽게 바꿀 수 있는 유연성을 모두 포괄합니다. 이를 통해 훨신 쉽고 편리한, 전에는 만나보실 수 없었던 새로운 Nvim의 세계를 경험하실 수 있으실 겁니다. + +![image](https://user-images.githubusercontent.com/292349/211285846-0b7bb3bf-0462-4029-b64c-4ee1d037fc1c.png) + +![image](https://user-images.githubusercontent.com/292349/213447056-92290767-ea16-430c-8727-ce994c93e9cc.png) + +## ✨ 기능 + +- 🔥 Neovim을 완벽한 IDE로 바꾸어보세요. +- 💤 lazy.vim과 함께 쉽게 커스터마이징하고, 확장하세요. +- 🚀 완전히 빠른 속도를 경험해보세요. +- 🧹 기본적으로 만져져있는 옵션, 자동커멘드, 그리고 단축키들을 아무런 추가적인 설정없이 사용해보세요. +- 📦 안정적이고 미리 설정되어져있는 플러그인들과 함게 코딩하세요. + +## ⚡️ 요구사항 + +- **0.9.0**이상의 Neovim (LuaJIT과 함께 개발이 되어져있어야함니다.) +- **2.19.0**이상의 Git (이것은 부분적인 클론기능을 지원하기 위함입니다.) +- [Nerd Font](https://www.nerdfonts.com/) **_(옵션)_** +- `nvim-treesitter`를 위한 **C** 컴파일러. [이 문서](https://github.com/nvim-treesitter/nvim-treesitter#requirements)를 확인해주시기바랍니다. + +## 🚀 시작하기 + +[이 깃헙 레파지토리](https://github.com/LazyVim/starter)에서 스타터 템플릿을 찾으실 수 있습니다. + +
도커와 함께 시작해보기 + +```sh +docker run -w /root -it --rm alpine:edge sh -uelic ' + apk add git lazygit neovim ripgrep alpine-sdk --update + git clone https://github.com/LazyVim/starter ~/.config/nvim + cd ~/.config/nvim + nvim +' +``` + +
+ +
LazyVim 스타터와 함께 시작해보기 + +- 현재 Neovim 파일들을 미리 백업: + + ```sh + mv ~/.config/nvim ~/.config/nvim.bak + mv ~/.local/share/nvim ~/.local/share/nvim.bak + ``` + +- Lazyvim 스타터 깃헙 레파지토리 복제: + + ```sh + git clone https://github.com/LazyVim/starter ~/.config/nvim + ``` + +- 나중에 본인의 레파지토리에 저장할 경우를 대비해 .git 폴더 지우기 + + ```sh + rm -rf ~/.config/nvim/.git + ``` + +- Neovim! + + ```sh + nvim + ``` + + LazyVim를 커스터마이징 하는 법에 대해 다룬 설명을 참조해주시기 바랍니다. + +
+ +--- + +유튜브에 LazyVim시작하기에 대해 [@elijahmanor](https://github.com/elijahmanor)에 의해 만들어진 영상이 있으니, 시청해 보시는 것을 추천드립니다. + +[![Watch the video](https://img.youtube.com/vi/N93cTbtLCIM/hqdefault.jpg)](https://www.youtube.com/watch?v=N93cTbtLCIM) + +## 📂 파일 구조 + +config 폴더 안에 있는 모든 파일들은 적절한 시간내에 자동으로 로드가 되기에, 아무 파일도 require를 하지 않아도 됩니다. **LazyVim**은 config폴더 안에 있는 모든 기본 파일들을 당신의 config 파일들 **전**에 불어옵니다. 이것에 대해서는, [이 문서](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config)를 확인해 보시기 바랍니다. + +추가적인 플러그인을 설치하시거나, 미리 설치되고 설정된 플러그인들을 또 덮어서 설정을 바꾸거나, 지우거나, 추가하고 싶으실 경우에는, 그에 해당하는 lua 파일들을 `lua/plugins` 폴더 안에 추가하시면, lazy.nvim이 자동적으로 그 파일들을 로드 할 것입니다. + +
+~/.config/nvim
+├── lua
+│   ├── config
+│   │   ├── autocmds.lua
+│   │   ├── keymaps.lua
+│   │   ├── lazy.lua
+│   │   └── options.lua
+│   └── plugins
+│       ├── spec1.lua
+│       ├── **
+│       └── spec2.lua
+└── init.lua
+
+ +## ⚙️ 설정 + +[Lazyvim 공식문서](https://lazyvim.github.io)를 확인해 주시기 바랍니다. + +LazyVim 공식문서의 한국어 지원은 현재 번역 중에 있습니다. From ea62195fe5e5f89beb37ca90f7bf974508bbba07 Mon Sep 17 00:00:00 2001 From: Takeshi Ooka <74577802+t-ooka@users.noreply.github.com> Date: Wed, 5 Jun 2024 22:22:50 +0900 Subject: [PATCH 519/526] docs: Added Japanese Translation of the README (#2232) * add Japanese README file * fix some typo --- README-JP.md | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 README-JP.md diff --git a/README-JP.md b/README-JP.md new file mode 100644 index 00000000..316ede80 --- /dev/null +++ b/README-JP.md @@ -0,0 +1,139 @@ +
+ +
+ +
+ +

+ インストール + · + 設定 + · + ドキュメント +

+ + + +LazyVimは、設定の拡張と変更を容易にするために[💤 lazy.nvim](https://github.com/folke/lazy.nvim)によって提供されるNeovimセットアップです。 +LazyVimは、ゼロから始めるか、あらかじめ作成されたディストリビューションを使用するかの選択を迫ることなく、 +必要に応じて設定を調整する柔軟性と、事前に設定されたセットアップの利便性を両方叶える最高の世界を提供します。 + +![image](https://user-images.githubusercontent.com/292349/211285846-0b7bb3bf-0462-4029-b64c-4ee1d037fc1c.png) + +![image](https://user-images.githubusercontent.com/292349/213447056-92290767-ea16-430c-8727-ce994c93e9cc.png) + +## ✨ 機能 + +- 🔥 Neovimを本格的なIDEへと変身させます +- 💤 [lazy.nvim](https://github.com/folke/lazy.nvim)で簡単にカスタマイズと拡張が可能 +- 🚀 驚くほどの高速さ +- 🧹 Options, autocmds, そしてkeymapsのための合理的なデフォルト設定 +- 📦 事前に設定がされ、使用可能なプラグインが豊富についてきます + +## ⚡️ 必要要件 + +- Neovim >= **0.9.0** (**LuaJIT**でビルドされている必要があります) +- Git >= **2.19.0** (部分的なcloneサポートのため) +- [Nerd Font](https://www.nerdfonts.com/) **_(任意)_** +- `nvim-treesitter`用の**C**コンパイラ。詳細は[こちら](https://github.com/nvim-treesitter/nvim-treesitter#requirements) + +## 🚀 Getting Started + +**lazyvim**のスターターテンプレートは[こちら](https://github.com/lazyvim/starter)。 + +
Dockerで試す + +```sh +docker run -w /root -it --rm alpine:edge sh -uelic ' + apk add git lazygit neovim ripgrep alpine-sdk --update + git clone https://github.com/LazyVim/starter ~/.config/nvim + cd ~/.config/nvim + nvim +' +``` + +
+ +
LazyVim Starterをインストール + +- 既存のNeovimファイルのバックアップを作成します。 + + ```sh + mv ~/.config/nvim ~/.config/nvim.bak + mv ~/.local/share/nvim ~/.local/share/nvim.bak + ``` + +- スターターをcloneします。 + + ```sh + git clone https://github.com/LazyVim/starter ~/.config/nvim + ``` + +- 後ほど自分のリポジトリに加えられるように、`.git`フォルダを削除します。 + ```sh + rm -rf ~/.config/nvim/.git + ``` + +- Neovimを起動します! + + ```sh + nvim + ``` + + **LazyVim**をカスタマイズするために、ファイルのコメントを参照してください。 + +
+ +--- + +[@elijahmanor](https://github.com/elijahmanor)氏によって作成された始めるにあたっての概要動画があります。 + +[![動画を見る](https://img.youtube.com/vi/N93cTbtLCIM/hqdefault.jpg)](https://www.youtube.com/watch?v=N93cTbtLCIM) + +## 📂 ファイル構造 + +config配下にあるファイルは適切なタイミングで自動的にロードされる為、 +手動でそれらのファイルをrequireする必要はありません。 +LazyVimには、自分で設定したものより先にロードされるデフォルトの設定ファイルが付属しています。詳しくは[こちら](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config)。 +カスタムプラグインをlua/plugins/の下に追加することができます。lua/plugins/配下の全てのファイルは[lazy.nvim](https://github.com/folke/lazy.nvim)によって自動的にロードされます。 + +
+~/.config/nvim
+├── lua
+│   ├── config
+│   │   ├── autocmds.lua
+│   │   ├── keymaps.lua
+│   │   ├── lazy.lua
+│   │   └── options.lua
+│   └── plugins
+│       ├── spec1.lua
+│       ├── **
+│       └── spec2.lua
+└── init.lua
+
+ +## ⚙️ 設定 + +こちらの[ドキュメント](https://lazyvim.github.io)を参照してください。 From cdadb59ee347bf5dfed3f13d19782268a6e2449e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Freitas?= Date: Wed, 5 Jun 2024 13:23:09 +0000 Subject: [PATCH 520/526] docs(pt): add readme in portuguese (#1958) --- README-PT.md | 146 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 README-PT.md diff --git a/README-PT.md b/README-PT.md new file mode 100644 index 00000000..7fb8572e --- /dev/null +++ b/README-PT.md @@ -0,0 +1,146 @@ +
+ +
+ +
+ +

+ Instalar + · + Configurar + · + Documentação +

+ + + +LazyVim é uma configuração de Neovim potenciada por [💤 lazy.nvim](https://github.com/folke/lazy.nvim) +para tornar fácil customizar e extender a tua configuração. +Em vez de ter de escolher entre começar de raiz ou usar +uma distribuição pré-feita, LazyVim oferece o melhor +dos dois mundos - a flexibilidade de alterar a tua configuração +como necessário, junto com a conveniência de um setup pré-configurado. + +![imagem](https://user-images.githubusercontent.com/292349/211285846-0b7bb3bf-0462-4029-b64c-4ee1d037fc1c.png) + +![imagem](https://user-images.githubusercontent.com/292349/213447056-92290767-ea16-430c-8727-ce994c93e9cc.png) + +## ✨ Características + +- 🔥 Transforma o teu Neovim num IDE completo. +- 💤 Customiza e extende a tua configuração facilmente com [lazy.nvim](https://github.com/folke/lazy.nvim) +- 🚀 Super rápido +- 🧹 Definições comuns para options, autocms e keymaps +- 📦 Contém uma variedade de plugins pré-configurados e preparados a usar + +## ⚡️ Requesitos + +- Neovim >= **0.9.0** (preciso fazer build com **LuaJIT**) +- Git >= **2.19.0** (para suporte parcial de clones) +- uma [Nerd Font](https://www.nerdfonts.com/) **_(opcional)_** +- um compilador de **C** para `nvim-treesitter`. Mais informações [aqui](https://github.com/nvim-treesitter/nvim-treesitter#requirements) + +## 🚀 Como Começar + +Podes encontrar uma template **LazyVim** starter para começar, [aqui](https://github.com/LazyVim/starter) + +
Experimenta com docker + +```sh +docker run -w /root -it --rm alpine:edge sh -uelic ' + apk add git lazygit neovim ripgrep alpine-sdk --update + git clone https://github.com/LazyVim/starter ~/.config/nvim + cd ~/.config/nvim + nvim +' +``` + +
+ +
Instala a template LazyVim Starter + +- Faz um backup da tua configuração atual de Neovim: + + ```sh + mv ~/.config/nvim ~/.config/nvim.bak + mv ~/.local/share/nvim ~/.local/share/nvim.bak + ``` + +- Clona a template + + ```sh + git clone https://github.com/LazyVim/starter ~/.config/nvim + ``` + +- Remove o diretório `.git`, para poderes adicionar ao teu próprio repositório mais tarde + + ```sh + rm -rf ~/.config/nvim/.git + ``` + +- Inicia o Neovim! + + ```sh + nvim + ``` + + Consulta os comentários nos ficheiros sobre como customizar **LazyVim**. + +
+ +--- + +Existe um excelente video criado por [@elijahmanor](https://github.com/elijahmanor) com um passo a passo para começar. + +[![Vê o video](https://img.youtube.com/vi/N93cTbtLCIM/hqdefault.jpg)](https://www.youtube.com/watch?v=N93cTbtLCIM) + +## 📂 Extrutura de ficheiros + +Os ficheiros no diretório **config** serão carregados automaticamente +no momento apropriado, por isso não é necessário carregar os plugins manualmente. +**LazyVim** vem com um conjunto de ficheiros +que serão carregados **_antes_** dos teus. Lẽ mais [aqui](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config) + +Tu podes acrescentar a tua configuração em `lua/plugins`. Todos os ficheiros +neste diretório serão carregados automaticamente por [lazy.nvim](https://github.com/folke/lazy.nvim) + +
+~/.config/nvim
+├── lua
+│   ├── config
+│   │   ├── autocmds.lua
+│   │   ├── keymaps.lua
+│   │   ├── lazy.lua
+│   │   └── options.lua
+│   └── plugins
+│       ├── spec1.lua
+│       ├── **
+│       └── spec2.lua
+└── init.lua
+
+ +## ⚙️ Configuração + +Consulta a [documentação](https://lazyvim.github.io) From ff9ca808e0f35f8bcf3284652970937aae44ec61 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 15:36:46 +0200 Subject: [PATCH 521/526] ci: added stylua / stale / conventional commits --- .github/workflows/ci.yml | 17 +++++++++++++++++ .github/workflows/stale.yml | 21 +++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b6f6478..e3d580f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,23 @@ on: pull_request: jobs: + commit_msg: + name: Conventional Commit Messages + runs-on: ubuntu-latest + if: ${{ github.ref != 'refs/heads/main' }} + steps: + - uses: actions/checkout@v4 + - uses: webiny/action-conventional-commits@v1.3.0 + stylua: + name: Stylua Formatting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: JohnnyMorganz/stylua-action@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: latest + args: --check . tests: strategy: matrix: diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 00000000..5199c7ec --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,21 @@ +name: Close stale issues and PRs + +on: + workflow_call: + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v9 + with: + # default stale time + days-before-stale: 30 + days-before-close: 7 + # never stale pull requests + # days-before-pr-stale: -1 + days-before-pr-close: -1 + # exclude issues with certain labels + exempt-issue-labels: pinned,wip,security,notice + # never stale issues attached to a milestone + exempt-all-milestones: true From 7f65b2411389dba1ab0b7a2186d949ed98bf8ae5 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 15:38:04 +0200 Subject: [PATCH 522/526] style: r.lua --- lua/lazyvim/plugins/extras/lang/r.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/r.lua b/lua/lazyvim/plugins/extras/lang/r.lua index 49b3dd9c..eee57149 100644 --- a/lua/lazyvim/plugins/extras/lang/r.lua +++ b/lua/lazyvim/plugins/extras/lang/r.lua @@ -40,7 +40,7 @@ return { }) end, }, - pdfviewer = "" + pdfviewer = "", }, config = function(_, opts) vim.g.rout_follow_colorscheme = true From d6dea2247cd84fbe859dd27ba548a066c1fec9cb Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 15:41:32 +0200 Subject: [PATCH 523/526] ci: enable conventional commit linter on main --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3d580f5..a1c6670f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,6 @@ jobs: commit_msg: name: Conventional Commit Messages runs-on: ubuntu-latest - if: ${{ github.ref != 'refs/heads/main' }} steps: - uses: actions/checkout@v4 - uses: webiny/action-conventional-commits@v1.3.0 From 90d8ff27d2c60183a194e36fc5da643ad1036472 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 15:43:22 +0200 Subject: [PATCH 524/526] ci: fix stale workflow --- .github/workflows/stale.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 5199c7ec..e4e03b57 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,7 +1,9 @@ name: Close stale issues and PRs on: - workflow_call: + workflow_dispatch: + schedule: + - cron: "30 1 * * *" jobs: stale: From 99c06952a012f0270b8837c5f60bbc8aa83ccb6a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 15:53:22 +0200 Subject: [PATCH 525/526] ci: stale --- .github/workflows/stale.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index e4e03b57..9ebbb312 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -11,6 +11,7 @@ jobs: steps: - uses: actions/stale@v9 with: + operations-per-run: 300 # default stale time days-before-stale: 30 days-before-close: 7 @@ -20,4 +21,7 @@ jobs: # exclude issues with certain labels exempt-issue-labels: pinned,wip,security,notice # never stale issues attached to a milestone - exempt-all-milestones: true + # exempt-all-milestones: true + stale-issue-message: "This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days." + stale-pr-message: "This PR is stale because it has been open 60 days with no activity." + close-issue-message: "This issue was closed because it has been stalled for 7 days with no activity." From de9e337f0dcd27a7621f6ab741ad3a5d769dbd7c Mon Sep 17 00:00:00 2001 From: Kevin Traver Date: Wed, 5 Jun 2024 08:04:17 -0600 Subject: [PATCH 526/526] feat(keymaps): add keymap to close all tab pages except the current one (#2975) * feat(keymaps): add keymap to close all tab pages except the current one * fix: use o --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/config/keymaps.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 5bd13527..768a41b8 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -185,6 +185,7 @@ map("n", "m", function() LazyVim.toggle.maximize() end, { desc = "Maximi -- tabs map("n", "l", "tablast", { desc = "Last Tab" }) +map("n", "o", "tabonly", { desc = "Close Other Tabs" }) map("n", "f", "tabfirst", { desc = "First Tab" }) map("n", "", "tabnew", { desc = "New Tab" }) map("n", "]", "tabnext", { desc = "Next Tab" })