From 6c3fd9fedfa83bac9e63c04d24ff2760569b845e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 3 Jun 2024 07:12:17 +0200 Subject: [PATCH 01/22] 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 02/22] 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 03/22] 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 04/22] 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 05/22] 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 06/22] 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 07/22] 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 08/22] 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 09/22] 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 10/22] 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 11/22] 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 12/22] 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 13/22] 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 14/22] 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 15/22] 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 16/22] 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 17/22] 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 18/22] 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 19/22] =?UTF-8?q?fix(extra.lang.scala):=20Fix=20the=20alwa?= =?UTF-8?q?ys=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 20/22] 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 21/22] 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 22/22] 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