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 01/54] 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 02/54] 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 03/54] 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 04/54] 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 05/54] 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 06/54] 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 07/54] 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 08/54] 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 09/54] 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 10/54] 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 11/54] 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 12/54] 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 13/54] 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 14/54] 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 15/54] 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 16/54] 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 17/54] 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 18/54] 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 19/54] 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 20/54] 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 21/54] 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 22/54] 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 23/54] 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 24/54] 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 25/54] 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 26/54] 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 27/54] 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 28/54] 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 29/54] 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 30/54] 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 31/54] 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 32/54] 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 33/54] 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 34/54] 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 35/54] 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 36/54] 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 37/54] 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 38/54] 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 39/54] 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 40/54] 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 41/54] 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 42/54] 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 43/54] 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 44/54] 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 45/54] 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 46/54] 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 47/54] 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 48/54] 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 49/54] 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 50/54] 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 51/54] 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 52/54] 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 53/54] 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 54/54] 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 + }, + }, + }, + }, }