Merge branch 'LazyVim:main' into main

This commit is contained in:
Kemboi Elvis 2025-10-19 14:22:14 +03:00 committed by GitHub
commit 584148104d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
44 changed files with 378 additions and 173 deletions

View file

@ -1,3 +1,3 @@
{ {
".": "15.7.1" ".": "15.9.0"
} }

View file

@ -1,5 +1,73 @@
# Changelog # Changelog
## [15.9.0](https://github.com/LazyVim/LazyVim/compare/v15.8.1...v15.9.0) (2025-10-19)
### Features
* **docker:** associate 'Containerfile' with 'dockerfile' filetype ([#5974](https://github.com/LazyVim/LazyVim/issues/5974)) ([97af4a2](https://github.com/LazyVim/LazyVim/commit/97af4a23bccac85eb02e489f573db68863d6ed33))
* **extras.rest:** add keymap for changing environment ([#5678](https://github.com/LazyVim/LazyVim/issues/5678)) ([1da659d](https://github.com/LazyVim/LazyVim/commit/1da659db4a3fbcd6d171f3b38d0092ced0887e61))
* **java:** enable `blink.cmp` capabilities to show signature documentation ([#5218](https://github.com/LazyVim/LazyVim/issues/5218)) ([9618e32](https://github.com/LazyVim/LazyVim/commit/9618e327edfb79d9cbb037a2039c4315a95df63f))
* **lang/omnisharp:** switch neotest adapter to vstest ([#6540](https://github.com/LazyVim/LazyVim/issues/6540)) ([4086d44](https://github.com/LazyVim/LazyVim/commit/4086d44a0b5c576630c603c7b71c6be5198d9eaf))
* **neotest:** extra keymap to attach to a test ([#6198](https://github.com/LazyVim/LazyVim/issues/6198)) ([66e927f](https://github.com/LazyVim/LazyVim/commit/66e927fd9d0b0ff2886b9fe1465d9396461a2665))
### Bug Fixes
* **blink:** remove snippet expand override (no longer needed). Closes [#6044](https://github.com/LazyVim/LazyVim/issues/6044) ([336e2c3](https://github.com/LazyVim/LazyVim/commit/336e2c3ea67636c4eea3cf8f7538feb86b5a0610))
* **chezmoi:** add `hidden=false` to fzf picker ([#6095](https://github.com/LazyVim/LazyVim/issues/6095)) ([1aa1b59](https://github.com/LazyVim/LazyVim/commit/1aa1b59a7ec7cab61fa7b096db53df15ec5008e7))
* **copilot-chat:** use up to date config for chat headers ([#6543](https://github.com/LazyVim/LazyVim/issues/6543)) ([2c5eef7](https://github.com/LazyVim/LazyVim/commit/2c5eef7df7520fbc6fe0d90150cd26ac9e4f325b))
* **extras/rust:** fix config key for files.exclude ([#5664](https://github.com/LazyVim/LazyVim/issues/5664)) ([762a34d](https://github.com/LazyVim/LazyVim/commit/762a34d5ad95447b241287e8d540b657a699d141))
* **extras:** adjust switch source/header shortcut ([#6567](https://github.com/LazyVim/LazyVim/issues/6567)) ([b36b858](https://github.com/LazyVim/LazyVim/commit/b36b8589b62f55b181367afe954606c73233c0a1))
* **extras:** remove procMacro ignored ([#6117](https://github.com/LazyVim/LazyVim/issues/6117)) ([4a3702e](https://github.com/LazyVim/LazyVim/commit/4a3702e050881fea262ccae980ae1ff9e849d275))
* **lang.omnisharp:** update CSharpier command and arguments for Mason compatibility ([#6156](https://github.com/LazyVim/LazyVim/issues/6156)) ([dfebe70](https://github.com/LazyVim/LazyVim/commit/dfebe70b8d09514dd3ee85e12463f266f93c5dd7))
* **lang.rust:** rust-analyzer hanging on root scanned ([#6178](https://github.com/LazyVim/LazyVim/issues/6178)) ([7bf8c22](https://github.com/LazyVim/LazyVim/commit/7bf8c22c56283fa6d5d35246dcd0f49d37a5c709))
* **latex:** ensure tex extra installs latex tree-sitter parser ([#6357](https://github.com/LazyVim/LazyVim/issues/6357)) ([ae74622](https://github.com/LazyVim/LazyVim/commit/ae74622e6666ea4c3e6c58c4ef2d3f313d8e8f20))
* **mini.animate:** schedule the toggle mapping to correctly take effect ([#6483](https://github.com/LazyVim/LazyVim/issues/6483)) ([bd23357](https://github.com/LazyVim/LazyVim/commit/bd233579a66018f526b6b0970e33afde4cde399e))
* **sql:** fix autocomplete when `omni` is used as a `blink.cmp` source ([#5652](https://github.com/LazyVim/LazyVim/issues/5652)) ([f6f72b9](https://github.com/LazyVim/LazyVim/commit/f6f72b90d41d9347b93a07d0b680195541f64c55))
* **treesitter:** attach textobject keymaps to existing buffers on load. Closes [#6642](https://github.com/LazyVim/LazyVim/issues/6642). Closes [#6639](https://github.com/LazyVim/LazyVim/issues/6639) ([92a7728](https://github.com/LazyVim/LazyVim/commit/92a77287321236f52ff38648a38cf314ab223137))
* **typescript:** make_position_params with offset encoding. ([#6277](https://github.com/LazyVim/LazyVim/issues/6277)) ([22152e9](https://github.com/LazyVim/LazyVim/commit/22152e958f3f7c2b732cb6429ccc90541e0ad17f))
* **ui:** ignore sidekick_terminal in mini-indentscope ([#6619](https://github.com/LazyVim/LazyVim/issues/6619)) ([f0b32b5](https://github.com/LazyVim/LazyVim/commit/f0b32b5955889d4d2d3636a52d2ddf5d113646df))
* **util:** add some kulala keymaps back to global ([#5960](https://github.com/LazyVim/LazyVim/issues/5960)) ([a16739e](https://github.com/LazyVim/LazyVim/commit/a16739e3328c2687d96f868839c575765c49baad))
* **vscode:** don't sync undo/redo with vscode ([#5957](https://github.com/LazyVim/LazyVim/issues/5957)) ([706ec44](https://github.com/LazyVim/LazyVim/commit/706ec4443a33ec474f2329b5b806e9cdb85cce43))
## [15.8.1](https://github.com/LazyVim/LazyVim/compare/v15.8.0...v15.8.1) (2025-10-18)
### Bug Fixes
* **treesitter:** reload lazyvim.tresitter.util to prevent issues with stale modules when upgrading ([62ce8a2](https://github.com/LazyVim/LazyVim/commit/62ce8a23d89fa766956447a3df01d9f3448e9a66))
## [15.8.0](https://github.com/LazyVim/LazyVim/compare/v15.7.1...v15.8.0) (2025-10-17)
### Features
* **gleam:** add conform ([#5640](https://github.com/LazyVim/LazyVim/issues/5640)) ([02b8dd3](https://github.com/LazyVim/LazyVim/commit/02b8dd3f4bd55f06be133471fad027f3131238f4))
* **sidekick:** added `<leader>ad` to close/detach a terminal/session ([f8b062b](https://github.com/LazyVim/LazyVim/commit/f8b062b130177f07d3c1c13b642402d42e980df5))
* **sidekick:** changed default keymaps for sidekick. Please check updated docs at sidekick.nvim ([a3e52dd](https://github.com/LazyVim/LazyVim/commit/a3e52dd346ea35db5521b66e46dca95d32f00cb4))
* **sidekick:** use `<a-a>` in any snacks picker to send the (selected) results to an AI tool ([26c43a9](https://github.com/LazyVim/LazyVim/commit/26c43a9b931f3ab04a8c449671250182ac9ddca6))
* **treesitter:** add installation instructions to get a C compiler on windows ([37032da](https://github.com/LazyVim/LazyVim/commit/37032dabd657ae567011e7ab4f881ecbf476eb76))
* **treesitter:** added support for `disable` langs to indent/highlight/folds. Closes [#6608](https://github.com/LazyVim/LazyVim/issues/6608) ([0e8069c](https://github.com/LazyVim/LazyVim/commit/0e8069c78ee92279055236388df8c2019476767a))
* **treesitter:** better health checks for treesitter requirements ([413b9d5](https://github.com/LazyVim/LazyVim/commit/413b9d5fa91c5bd5088b28c6d1764caa88542cb1))
* **treesitter:** on windows, use `gcc` if available and `cl.exe` is not available for building parsers ([2a1f3c3](https://github.com/LazyVim/LazyVim/commit/2a1f3c370145c3465c0142deade3e3b2660ce829))
### Bug Fixes
* **blink:** disable blink left/right key in the cmdline ([94c4603](https://github.com/LazyVim/LazyVim/commit/94c4603b6838fbe75343b6e3342b4343744157dc))
* **keymaps:** update deprecated diagnostic keymap to latest api change ([#6574](https://github.com/LazyVim/LazyVim/issues/6574)) ([b9d38f6](https://github.com/LazyVim/LazyVim/commit/b9d38f692015fecaa72d55282b74a3d601e4c9fa))
* **sidekick:** only add copilot to lspconfig when `opts.nes.enabled ~= false` ([049db39](https://github.com/LazyVim/LazyVim/commit/049db39de0f272e8368a4b3881ac5a13f0d04b09))
* **terminal:** term toggle keymaps now only work for snacks terminals. Closes [#6573](https://github.com/LazyVim/LazyVim/issues/6573) ([4efd0e2](https://github.com/LazyVim/LazyVim/commit/4efd0e2bea2a387d6fcdea8cf36a62049e8bafed))
* **treesiter:** check that `disable` options are tables ([e8c5fa7](https://github.com/LazyVim/LazyVim/commit/e8c5fa7eae06539c883699507caeadb46d74f401))
* **treesitter:** better check on windows if microsoft build tools is installed ([5effc77](https://github.com/LazyVim/LazyVim/commit/5effc77185f94f557809375b5650d427e7171c32))
* **xtras:** load `copilot-native` before `blink` ([#6588](https://github.com/LazyVim/LazyVim/issues/6588)) ([aa2c436](https://github.com/LazyVim/LazyVim/commit/aa2c43633adee0f80faf8d743d6476ea4f8ba5ca))
### Performance Improvements
* **ansible:** load on ft=yaml and run should only be mapped on ft=yaml.ansible ([ebdcf1b](https://github.com/LazyVim/LazyVim/commit/ebdcf1ba7ef18daa8c897c8922a5ef770e8bcffb))
## [15.7.1](https://github.com/LazyVim/LazyVim/compare/v15.7.0...v15.7.1) (2025-10-02) ## [15.7.1](https://github.com/LazyVim/LazyVim/compare/v15.7.0...v15.7.1) (2025-10-02)

View file

@ -54,7 +54,7 @@ LazyVim 是一个基于 [💤 lazy.nvim](https://github.com/folke/lazy.nvim) 的
## ⚡️ 环境要求 ## ⚡️ 环境要求
- Neovim >= **0.9.0** (需要用 **LuaJIT** 构建) - Neovim >= **0.11.2** (需要用 **LuaJIT** 构建)
- Git >= **2.19.0** (用于部分克隆支持) - Git >= **2.19.0** (用于部分克隆支持)
- 一个 [Nerd Font](https://www.nerdfonts.com/) 字体 **_(可选)_** - 一个 [Nerd Font](https://www.nerdfonts.com/) 字体 **_(可选)_**
- 一个用于 `nvim-treesitter`**C** 编译器。看 [这里](https://github.com/nvim-treesitter/nvim-treesitter#requirements) - 一个用于 `nvim-treesitter`**C** 编译器。看 [这里](https://github.com/nvim-treesitter/nvim-treesitter#requirements)

View file

@ -56,7 +56,7 @@ und die Einfachheit von einem vorgefertigten Setup.
## ⚡️ Vorraussetzungen ## ⚡️ Vorraussetzungen
- Neovim >= **0.8.0** (gebraucht um mit **LuaJIT** zu bauen) - Neovim >= **0.11.2** (gebraucht um mit **LuaJIT** zu bauen)
- Git >= **2.19.0** (um Teil-Klone zu unterstützen) - Git >= **2.19.0** (um Teil-Klone zu unterstützen)
- eine [Nerd Font](https://www.nerdfonts.com/) **_(optional)_** - eine [Nerd Font](https://www.nerdfonts.com/) **_(optional)_**

View file

@ -52,7 +52,7 @@ LazyVim es una configuración de Neovim impulsada por [💤 lazy.nvim](https://g
## ⚡️ Requisitos ## ⚡️ Requisitos
- Neovim >= **0.9.0** (debe ser compilado con **LuaJIT**) - Neovim >= **0.11.2** (debe ser compilado con **LuaJIT**)
- Git >= **2.19.0** (para soporte de clones parciales) - Git >= **2.19.0** (para soporte de clones parciales)
- una [Fuente Nerd](https://www.nerdfonts.com/) **_(opcional)_** - una [Fuente Nerd](https://www.nerdfonts.com/) **_(opcional)_**
- un compilador **C** para `nvim-treesitter`. Consulta [aquí](https://github.com/nvim-treesitter/nvim-treesitter#requirements) - un compilador **C** para `nvim-treesitter`. Consulta [aquí](https://github.com/nvim-treesitter/nvim-treesitter#requirements)

View file

@ -57,7 +57,7 @@ insieme alla comodità di un setup preconfigurato.
## ⚡️ Requisiti ## ⚡️ Requisiti
- Neovim >= **0.9.0** (deve essere compilato con **LuaJIT**) - Neovim >= **0.11.2** (deve essere compilato con **LuaJIT**)
- Git >= **2.19.0** (per supportare cloni parziali) - Git >= **2.19.0** (per supportare cloni parziali)
- a [Nerd Font](https://www.nerdfonts.com/) **_(opzionale)_** - a [Nerd Font](https://www.nerdfonts.com/) **_(opzionale)_**
- un compilatore **C** per `nvim-treesitter`. Leggi [qui](https://github.com/nvim-treesitter/nvim-treesitter#requirements) - un compilatore **C** per `nvim-treesitter`. Leggi [qui](https://github.com/nvim-treesitter/nvim-treesitter#requirements)

View file

@ -54,7 +54,7 @@ LazyVimは、ゼロから始めるか、あらかじめ作成されたディス
## ⚡️ 必要要件 ## ⚡️ 必要要件
- Neovim >= **0.9.0** (**LuaJIT**でビルドされている必要があります) - Neovim >= **0.11.2** (**LuaJIT**でビルドされている必要があります)
- Git >= **2.19.0** (部分的なcloneサポートのため) - Git >= **2.19.0** (部分的なcloneサポートのため)
- [Nerd Font](https://www.nerdfonts.com/) **_(任意)_** - [Nerd Font](https://www.nerdfonts.com/) **_(任意)_**
- `nvim-treesitter`用の**C**コンパイラ。詳細は[こちら](https://github.com/nvim-treesitter/nvim-treesitter#requirements) - `nvim-treesitter`用の**C**コンパイラ。詳細は[こちら](https://github.com/nvim-treesitter/nvim-treesitter#requirements)

View file

@ -52,7 +52,7 @@ LazyVim은 [💤 lazy.nvim](https://github.com/folke/lazy.nvim)를 기반으로
## ⚡️ 요구사항 ## ⚡️ 요구사항
- **0.9.0**이상의 Neovim (LuaJIT과 함께 개발이 되어져있어야함니다.) - **0.11.2**이상의 Neovim (LuaJIT과 함께 개발이 되어져있어야함니다.)
- **2.19.0**이상의 Git (이것은 부분적인 클론기능을 지원하기 위함입니다.) - **2.19.0**이상의 Git (이것은 부분적인 클론기능을 지원하기 위함입니다.)
- [Nerd Font](https://www.nerdfonts.com/) **_(옵션)_** - [Nerd Font](https://www.nerdfonts.com/) **_(옵션)_**
- `nvim-treesitter`를 위한 **C** 컴파일러. [이 문서](https://github.com/nvim-treesitter/nvim-treesitter#requirements)를 확인해주시기바랍니다. - `nvim-treesitter`를 위한 **C** 컴파일러. [이 문서](https://github.com/nvim-treesitter/nvim-treesitter#requirements)를 확인해주시기바랍니다.

View file

@ -57,7 +57,7 @@ como necessário, junto com a conveniência de um setup pré-configurado.
## ⚡️ Requesitos ## ⚡️ Requesitos
- Neovim >= **0.9.0** (preciso fazer build com **LuaJIT**) - Neovim >= **0.11.2** (preciso fazer build com **LuaJIT**)
- Git >= **2.19.0** (para suporte parcial de clones) - Git >= **2.19.0** (para suporte parcial de clones)
- uma [Nerd Font](https://www.nerdfonts.com/) **_(opcional)_** - uma [Nerd Font](https://www.nerdfonts.com/) **_(opcional)_**
- um compilador de **C** para `nvim-treesitter`. Mais informações [aqui](https://github.com/nvim-treesitter/nvim-treesitter#requirements) - um compilador de **C** para `nvim-treesitter`. Mais informações [aqui](https://github.com/nvim-treesitter/nvim-treesitter#requirements)

View file

@ -1,4 +1,4 @@
*LazyVim.txt* For Neovim Last change: 2025 October 02 *LazyVim.txt* For Neovim Last change: 2025 October 19
============================================================================== ==============================================================================
Table of Contents *LazyVim-table-of-contents* Table of Contents *LazyVim-table-of-contents*

View file

@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util")
---@class LazyVimConfig: LazyVimOptions ---@class LazyVimConfig: LazyVimOptions
local M = {} local M = {}
M.version = "15.7.1" -- x-release-please-version M.version = "15.9.0" -- x-release-please-version
LazyVim.config = M LazyVim.config = M
---@class LazyVimOptions ---@class LazyVimOptions

View file

@ -120,10 +120,12 @@ end, { desc = "Format" })
-- diagnostic -- diagnostic
local diagnostic_goto = function(next, severity) local diagnostic_goto = function(next, severity)
local go = next and vim.diagnostic.goto_next or vim.diagnostic.goto_prev
severity = severity and vim.diagnostic.severity[severity] or nil
return function() return function()
go({ severity = severity }) vim.diagnostic.jump({
count = (next and 1 or -1) * vim.v.count1,
severity = severity and vim.diagnostic.severity[severity] or nil,
float = true,
})
end end
end end
map("n", "<leader>cd", vim.diagnostic.open_float, { desc = "Line Diagnostics" }) map("n", "<leader>cd", vim.diagnostic.open_float, { desc = "Line Diagnostics" })
@ -187,12 +189,8 @@ map("n", "<leader>L", function() LazyVim.news.changelog() end, { desc = "LazyVim
-- floating terminal -- floating terminal
map("n", "<leader>fT", function() Snacks.terminal() end, { desc = "Terminal (cwd)" }) map("n", "<leader>fT", function() Snacks.terminal() end, { desc = "Terminal (cwd)" })
map("n", "<leader>ft", function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "Terminal (Root Dir)" }) map("n", "<leader>ft", function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "Terminal (Root Dir)" })
map("n", "<c-/>", function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "Terminal (Root Dir)" }) map({"n","t"}, "<c-/>",function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "Terminal (Root Dir)" })
map("n", "<c-_>", function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "which_key_ignore" }) map({"n","t"}, "<c-_>",function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "which_key_ignore" })
-- Terminal Mappings
map("t", "<C-/>", "<cmd>close<cr>", { desc = "Hide Terminal" })
map("t", "<c-_>", "<cmd>close<cr>", { desc = "which_key_ignore" })
-- windows -- windows
map("n", "<leader>-", "<C-W>s", { desc = "Split Window Below", remap = true }) map("n", "<leader>-", "<C-W>s", { desc = "Split Window Below", remap = true })

View file

@ -4,6 +4,7 @@ local start = vim.health.start or vim.health.report_start
local ok = vim.health.ok or vim.health.report_ok local ok = vim.health.ok or vim.health.report_ok
local warn = vim.health.warn or vim.health.report_warn local warn = vim.health.warn or vim.health.report_warn
local error = vim.health.error or vim.health.report_error local error = vim.health.error or vim.health.report_error
local info = vim.health.info or vim.health.report_info
function M.check() function M.check()
start("LazyVim") start("LazyVim")
@ -33,6 +34,23 @@ function M.check()
warn(("`%s` is not installed"):format(name)) warn(("`%s` is not installed"):format(name))
end end
end end
start("LazyVim nvim-treesitter")
local tsok, health = LazyVim.treesitter.check()
local keys = vim.tbl_keys(health) ---@type string[]
table.sort(keys)
for _, k in pairs(keys) do
(health[k] and ok or error)(("`%s` is %s"):format(k, health[k] and "installed" or "not installed"))
end
if not tsok then
info(
"See the requirements at [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter/tree/main?tab=readme-ov-file#requirements)"
)
info("Run `:checkhealth nvim-treesitter` for more information.")
if vim.fn.has("win32") == 1 and not health["C compiler"] then
info("Install a C compiler with `winget install --id=BrechtSanders.WinLibs.POSIX.UCRT -e`")
end
end
end end
return M return M

View file

@ -8,8 +8,11 @@ return {
user = user:sub(1, 1):upper() .. user:sub(2) user = user:sub(1, 1):upper() .. user:sub(2)
return { return {
auto_insert_mode = true, auto_insert_mode = true,
question_header = "" .. user .. " ", headers = {
answer_header = " Copilot ", user = "" .. user .. " ",
assistant = " Copilot ",
tool = "󰊳 Tool ",
},
window = { window = {
width = 0.4, width = 0.4,
}, },

View file

@ -4,11 +4,13 @@ return {
-- copilot-language-server -- copilot-language-server
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
opts = { opts = function(_, opts)
servers = { local sk = LazyVim.opts("sidekick.nvim") ---@type sidekick.Config|{}
copilot = {}, if vim.tbl_get(sk, "nes", "enabled") ~= false then
}, opts.servers = opts.servers or {}
}, opts.servers.copilot = opts.servers.copilot or {}
end
end,
}, },
-- lualine -- lualine
@ -56,6 +58,12 @@ return {
-- nes is also useful in normal mode -- nes is also useful in normal mode
{ "<tab>", LazyVim.cmp.map({ "ai_nes" }, "<tab>"), mode = { "n" }, expr = true }, { "<tab>", LazyVim.cmp.map({ "ai_nes" }, "<tab>"), mode = { "n" }, expr = true },
{ "<leader>a", "", desc = "+ai", mode = { "n", "v" } }, { "<leader>a", "", desc = "+ai", mode = { "n", "v" } },
{
"<c-.>",
function() require("sidekick.cli").toggle() end,
desc = "Sidekick Toggle",
mode = { "n", "t", "i", "x" },
},
{ {
"<leader>aa", "<leader>aa",
function() require("sidekick.cli").toggle() end, function() require("sidekick.cli").toggle() end,
@ -68,12 +76,22 @@ return {
-- require("sidekick.cli").select({ filter = { installed = true } }) -- require("sidekick.cli").select({ filter = { installed = true } })
desc = "Select CLI", desc = "Select CLI",
}, },
{
"<leader>ad",
function() require("sidekick.cli").close() end,
desc = "Detach a CLI Session",
},
{ {
"<leader>at", "<leader>at",
function() require("sidekick.cli").send({ msg = "{this}" }) end, function() require("sidekick.cli").send({ msg = "{this}" }) end,
mode = { "x", "n" }, mode = { "x", "n" },
desc = "Send This", desc = "Send This",
}, },
{
"<leader>af",
function() require("sidekick.cli").send({ msg = "{file}" }) end,
desc = "Send File",
},
{ {
"<leader>av", "<leader>av",
function() require("sidekick.cli").send({ msg = "{selection}" }) end, function() require("sidekick.cli").send({ msg = "{selection}" }) end,
@ -86,17 +104,29 @@ return {
mode = { "n", "x" }, mode = { "n", "x" },
desc = "Sidekick Select Prompt", desc = "Sidekick Select Prompt",
}, },
{ },
"<c-.>", },
function() require("sidekick.cli").focus() end,
mode = { "n", "x", "i", "t" }, {
desc = "Sidekick Switch Focus", "folke/snacks.nvim",
}, optional = true,
-- Example of a keybinding to open Claude directly opts = {
{ picker = {
"<leader>ac", actions = {
function() require("sidekick.cli").toggle({ name = "claude", focus = true }) end, sidekick_send = function(...)
desc = "Sidekick Claude Toggle", return require("sidekick.cli.snacks").send(...)
end,
},
win = {
input = {
keys = {
["<a-a>"] = {
"sidekick_send",
mode = { "n", "i" },
},
},
},
},
}, },
}, },
}, },

View file

@ -37,9 +37,7 @@ return {
---@type blink.cmp.Config ---@type blink.cmp.Config
opts = { opts = {
snippets = { snippets = {
expand = function(snippet, _) preset = "default",
return LazyVim.cmp.expand(snippet)
end,
}, },
appearance = { appearance = {
@ -85,7 +83,11 @@ return {
cmdline = { cmdline = {
enabled = true, enabled = true,
keymap = { preset = "cmdline" }, keymap = {
preset = "cmdline",
["<Right>"] = false,
["<Left>"] = false,
},
completion = { completion = {
list = { selection = { preselect = false } }, list = { selection = { preselect = false } },
menu = { menu = {

View file

@ -1,6 +1,6 @@
if lazyvim_docs then if lazyvim_docs then
-- Set to `false` to prevent "non-lsp snippets"" from appearing inside completion windows -- Set to `false` to prevent "non-lsp snippets"" from appearing inside completion windows
-- Motivation: Less clutter in completion windows and a more direct usage of snippits -- Motivation: Less clutter in completion windows and a more direct usage of snippets
vim.g.lazyvim_mini_snippets_in_completion = true vim.g.lazyvim_mini_snippets_in_completion = true
-- NOTE: Please also read: -- NOTE: Please also read:

View file

@ -19,13 +19,14 @@ return {
}, },
{ {
"mfussenegger/nvim-ansible", "mfussenegger/nvim-ansible",
ft = {}, ft = { "yaml" },
keys = { keys = {
{ {
"<leader>ta", "<leader>ta",
function() function()
require("ansible").run() require("ansible").run()
end, end,
ft = "yaml.ansible",
desc = "Ansible Run Playbook/Role", desc = "Ansible Run Playbook/Role",
silent = true, silent = true,
}, },

View file

@ -60,7 +60,7 @@ return {
-- Ensure mason installs the server -- Ensure mason installs the server
clangd = { clangd = {
keys = { keys = {
{ "<leader>ch", "<cmd>ClangdSwitchSourceHeader<cr>", desc = "Switch Source/Header (C/C++)" }, { "<leader>ch", "<cmd>LspClangdSwitchSourceHeader<cr>", desc = "Switch Source/Header (C/C++)" },
}, },
root_markers = { root_markers = {
"compile_commands.json", "compile_commands.json",

View file

@ -2,7 +2,14 @@ return {
recommended = function() recommended = function()
return LazyVim.extras.wants({ return LazyVim.extras.wants({
ft = "dockerfile", ft = "dockerfile",
root = { "Dockerfile", "docker-compose.yml", "compose.yml", "docker-compose.yaml", "compose.yaml" }, root = {
"Dockerfile",
"Containerfile",
"docker-compose.yml",
"compose.yml",
"docker-compose.yaml",
"compose.yaml",
},
}) })
end, end,
{ {

View file

@ -17,4 +17,13 @@ return {
}, },
}, },
}, },
{
"conform.nvim",
optional = true,
opts = {
formatters_by_ft = {
gleam = { "gleam" },
},
},
},
} }

View file

@ -169,7 +169,9 @@ return {
}, },
settings = opts.settings, settings = opts.settings,
-- enable CMP capabilities -- enable CMP capabilities
capabilities = LazyVim.has("cmp-nvim-lsp") and require("cmp_nvim_lsp").default_capabilities() or nil, capabilities = LazyVim.has("blink.cmp") and require("blink.cmp").get_lsp_capabilities() or LazyVim.has(
"cmp-nvim-lsp"
) and require("cmp_nvim_lsp").default_capabilities() or nil,
}, opts.jdtls) }, opts.jdtls)
-- Existing server will be reused if the root_dir matches. -- Existing server will be reused if the root_dir matches.

View file

@ -108,7 +108,7 @@ return {
priority = 10, priority = 10,
}, },
-- Redirect Lean's stderr messages somehwere (to a buffer by default) -- Redirect Lean's stderr messages somewhere (to a buffer by default)
stderr = { stderr = {
enable = true, enable = true,
-- height of the window -- height of the window

View file

@ -113,17 +113,8 @@ return {
require("render-markdown").setup(opts) require("render-markdown").setup(opts)
Snacks.toggle({ Snacks.toggle({
name = "Render Markdown", name = "Render Markdown",
get = function() get = require("render-markdown").get,
return require("render-markdown.state").enabled set = require("render-markdown").set,
end,
set = function(enabled)
local m = require("render-markdown")
if enabled then
m.enable()
else
m.disable()
end
end,
}):map("<leader>um") }):map("<leader>um")
end, end,
}, },

View file

@ -27,12 +27,6 @@ return {
formatters_by_ft = { formatters_by_ft = {
cs = { "csharpier" }, cs = { "csharpier" },
}, },
formatters = {
csharpier = {
command = "dotnet-csharpier",
args = { "--write-stdout" },
},
},
}, },
}, },
{ {
@ -109,12 +103,12 @@ return {
"nvim-neotest/neotest", "nvim-neotest/neotest",
optional = true, optional = true,
dependencies = { dependencies = {
"Issafalcon/neotest-dotnet", "Nsidorenco/neotest-vstest",
}, },
opts = { opts = {
adapters = { adapters = {
["neotest-dotnet"] = { ["neotest-vstest"] = {
-- Here we can set options for neotest-dotnet -- Here we can set options for neotest-vstest
}, },
}, },
}, },

View file

@ -103,11 +103,7 @@ return {
{ "<leader>dPc", function() require('dap-python').test_class() end, desc = "Debug Class", ft = "python" }, { "<leader>dPc", function() require('dap-python').test_class() end, desc = "Debug Class", ft = "python" },
}, },
config = function() config = function()
if vim.fn.has("win32") == 1 then require("dap-python").setup("debugpy-adapter")
require("dap-python").setup(LazyVim.get_pkg_path("debugpy", "/venv/Scripts/pythonw.exe"))
else
require("dap-python").setup(LazyVim.get_pkg_path("debugpy", "/venv/bin/python"))
end
end, end,
}, },
}, },

View file

@ -85,16 +85,12 @@ return {
}, },
procMacro = { procMacro = {
enable = true, enable = true,
ignored = {
["async-trait"] = { "async_trait" },
["napi-derive"] = { "napi" },
["async-recursion"] = { "async_recursion" },
},
}, },
files = { files = {
excludeDirs = { exclude = {
".direnv", ".direnv",
".git", ".git",
".jj",
".github", ".github",
".gitlab", ".gitlab",
"bin", "bin",
@ -103,6 +99,8 @@ return {
"venv", "venv",
".venv", ".venv",
}, },
-- Avoid Roots Scanned hanging, see https://github.com/rust-lang/rust-analyzer/issues/12613#issuecomment-2096386344
watcher = "client",
}, },
}, },
}, },

View file

@ -28,6 +28,11 @@ end
local sql_ft = { "sql", "mysql", "plsql" } local sql_ft = { "sql", "mysql", "plsql" }
-- disable nvim default `sql_completion` plugin to be compatible with blink.cmp's omni
-- while still showing some keywords from the syntax autocomplete sources
vim.g.omni_sql_default_compl_type = "syntax"
vim.g.loaded_sql_completion = true
return { return {
recommended = function() recommended = function()
return LazyVim.extras.wants({ return LazyVim.extras.wants({

View file

@ -12,7 +12,7 @@ return {
opts = function(_, opts) opts = function(_, opts)
opts.highlight = opts.highlight or {} opts.highlight = opts.highlight or {}
if type(opts.ensure_installed) == "table" then if type(opts.ensure_installed) == "table" then
vim.list_extend(opts.ensure_installed, { "bibtex" }) vim.list_extend(opts.ensure_installed, { "bibtex", "latex" })
end end
if type(opts.highlight.disable) == "table" then if type(opts.highlight.disable) == "table" then
vim.list_extend(opts.highlight.disable, { "latex" }) vim.list_extend(opts.highlight.disable, { "latex" })

View file

@ -86,7 +86,8 @@ return {
{ {
"gD", "gD",
function() function()
local params = vim.lsp.util.make_position_params() local win = vim.api.nvim_get_current_win()
local params = vim.lsp.util.make_position_params(win, "utf-16")
LazyVim.lsp.execute({ LazyVim.lsp.execute({
command = "typescript.goToSourceDefinition", command = "typescript.goToSourceDefinition",
arguments = { params.textDocument.uri, params.position }, arguments = { params.textDocument.uri, params.position },

View file

@ -106,6 +106,7 @@ return {
-- stylua: ignore -- stylua: ignore
keys = { keys = {
{"<leader>t", "", desc = "+test"}, {"<leader>t", "", desc = "+test"},
{ "<leader>ta", function() require("neotest").run.attach() end, desc = "Attach to Test (Neotest)" },
{ "<leader>tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File (Neotest)" }, { "<leader>tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File (Neotest)" },
{ "<leader>tT", function() require("neotest").run.run(vim.uv.cwd()) end, desc = "Run All Test Files (Neotest)" }, { "<leader>tT", function() require("neotest").run.run(vim.uv.cwd()) end, desc = "Run All Test Files (Neotest)" },
{ "<leader>tr", function() require("neotest").run.run() end, desc = "Run Nearest (Neotest)" }, { "<leader>tr", function() require("neotest").run.run() end, desc = "Run Nearest (Neotest)" },

View file

@ -32,15 +32,19 @@ return {
end, end,
}) })
Snacks.toggle({ -- schedule setting the mapping to override the default mapping from `keymaps.lua`
name = "Mini Animate", -- seems `keymaps.lua` is the last event to execute on `VeryLazy` and it overwrites it
get = function() vim.schedule(function()
return not vim.g.minianimate_disable Snacks.toggle({
end, name = "Mini Animate",
set = function(state) get = function()
vim.g.minianimate_disable = not state return not vim.g.minianimate_disable
end, end,
}):map("<leader>ua") set = function(state)
vim.g.minianimate_disable = not state
end,
}):map("<leader>ua")
end)
local animate = require("mini.animate") local animate = require("mini.animate")
return vim.tbl_deep_extend("force", opts, { return vim.tbl_deep_extend("force", opts, {

View file

@ -23,6 +23,7 @@ return {
"mason", "mason",
"neo-tree", "neo-tree",
"notify", "notify",
"sidekick_terminal",
"snacks_dashboard", "snacks_dashboard",
"snacks_notif", "snacks_notif",
"snacks_terminal", "snacks_terminal",
@ -44,7 +45,7 @@ return {
end, end,
}, },
-- disable inent-blankline scope when mini-indentscope is enabled -- disable indent-blankline scope when mini-indentscope is enabled
{ {
"lukas-reineke/indent-blankline.nvim", "lukas-reineke/indent-blankline.nvim",
optional = true, optional = true,

View file

@ -8,7 +8,7 @@ local pick_chezmoi = function()
fzf_lua.actions.vimcmd_entry("ChezmoiEdit", selected, { cwd = os.getenv("HOME") }) fzf_lua.actions.vimcmd_entry("ChezmoiEdit", selected, { cwd = os.getenv("HOME") })
end, end,
} }
fzf_lua.files({ cmd = "chezmoi managed --include=files,symlinks", actions = actions }) fzf_lua.files({ cmd = "chezmoi managed --include=files,symlinks", actions = actions, hidden = false })
elseif LazyVim.pick.picker.name == "snacks" then elseif LazyVim.pick.picker.name == "snacks" then
local results = require("chezmoi.commands").list({ local results = require("chezmoi.commands").list({
args = { args = {

View file

@ -8,10 +8,11 @@ return {
"mistweaverco/kulala.nvim", "mistweaverco/kulala.nvim",
ft = "http", ft = "http",
keys = { keys = {
{ "<leader>R", "", desc = "+Rest", ft = "http" }, { "<leader>R", "", desc = "+Rest" },
{ "<leader>Rb", "<cmd>lua require('kulala').scratchpad()<cr>", desc = "Open scratchpad", ft = "http" }, { "<leader>Rb", "<cmd>lua require('kulala').scratchpad()<cr>", desc = "Open scratchpad" },
{ "<leader>Rc", "<cmd>lua require('kulala').copy()<cr>", desc = "Copy as cURL", ft = "http" }, { "<leader>Rc", "<cmd>lua require('kulala').copy()<cr>", desc = "Copy as cURL", ft = "http" },
{ "<leader>RC", "<cmd>lua require('kulala').from_curl()<cr>", desc = "Paste from curl", ft = "http" }, { "<leader>RC", "<cmd>lua require('kulala').from_curl()<cr>", desc = "Paste from curl", ft = "http" },
{ "<leader>Re", "<cmd>lua require('kulala').set_selected_env()<cr>", desc = "Set environment", ft = "http" },
{ {
"<leader>Rg", "<leader>Rg",
"<cmd>lua require('kulala').download_graphql_schema()<cr>", "<cmd>lua require('kulala').download_graphql_schema()<cr>",
@ -22,7 +23,7 @@ return {
{ "<leader>Rn", "<cmd>lua require('kulala').jump_next()<cr>", desc = "Jump to next request", ft = "http" }, { "<leader>Rn", "<cmd>lua require('kulala').jump_next()<cr>", desc = "Jump to next request", ft = "http" },
{ "<leader>Rp", "<cmd>lua require('kulala').jump_prev()<cr>", desc = "Jump to previous request", ft = "http" }, { "<leader>Rp", "<cmd>lua require('kulala').jump_prev()<cr>", desc = "Jump to previous request", ft = "http" },
{ "<leader>Rq", "<cmd>lua require('kulala').close()<cr>", desc = "Close window", ft = "http" }, { "<leader>Rq", "<cmd>lua require('kulala').close()<cr>", desc = "Close window", ft = "http" },
{ "<leader>Rr", "<cmd>lua require('kulala').replay()<cr>", desc = "Replay the last request", ft = "http" }, { "<leader>Rr", "<cmd>lua require('kulala').replay()<cr>", desc = "Replay the last request" },
{ "<leader>Rs", "<cmd>lua require('kulala').run()<cr>", desc = "Send the request", ft = "http" }, { "<leader>Rs", "<cmd>lua require('kulala').run()<cr>", desc = "Send the request", ft = "http" },
{ "<leader>RS", "<cmd>lua require('kulala').show_stats()<cr>", desc = "Show stats", ft = "http" }, { "<leader>RS", "<cmd>lua require('kulala').show_stats()<cr>", desc = "Show stats", ft = "http" },
{ "<leader>Rt", "<cmd>lua require('kulala').toggle_view()<cr>", desc = "Toggle headers/body", ft = "http" }, { "<leader>Rt", "<cmd>lua require('kulala').toggle_view()<cr>", desc = "Toggle headers/body", ft = "http" },

View file

@ -39,10 +39,6 @@ vim.api.nvim_create_autocmd("User", {
vim.keymap.set("n", "<leader>/", [[<cmd>lua require('vscode').action('workbench.action.findInFiles')<cr>]]) vim.keymap.set("n", "<leader>/", [[<cmd>lua require('vscode').action('workbench.action.findInFiles')<cr>]])
vim.keymap.set("n", "<leader>ss", [[<cmd>lua require('vscode').action('workbench.action.gotoSymbol')<cr>]]) vim.keymap.set("n", "<leader>ss", [[<cmd>lua require('vscode').action('workbench.action.gotoSymbol')<cr>]])
-- Keep undo/redo lists in sync with VsCode
vim.keymap.set("n", "u", "<Cmd>call VSCodeNotify('undo')<CR>")
vim.keymap.set("n", "<C-r>", "<Cmd>call VSCodeNotify('redo')<CR>")
-- Navigate VSCode tabs like lazyvim buffers -- Navigate VSCode tabs like lazyvim buffers
vim.keymap.set("n", "<S-h>", "<Cmd>call VSCodeNotify('workbench.action.previousEditor')<CR>") vim.keymap.set("n", "<S-h>", "<Cmd>call VSCodeNotify('workbench.action.previousEditor')<CR>")
vim.keymap.set("n", "<S-l>", "<Cmd>call VSCodeNotify('workbench.action.nextEditor')<CR>") vim.keymap.set("n", "<S-l>", "<Cmd>call VSCodeNotify('workbench.action.nextEditor')<CR>")

View file

@ -13,20 +13,22 @@ return {
LazyVim.error("Please restart Neovim and run `:TSUpdate` to use the `nvim-treesitter` **main** branch.") LazyVim.error("Please restart Neovim and run `:TSUpdate` to use the `nvim-treesitter` **main** branch.")
return return
end end
LazyVim.treesitter.ensure_treesitter_cli(function() -- make sure we're using the latest treesitter util
package.loaded["lazyvim.util.treesitter"] = nil
LazyVim.treesitter.build(function()
TS.update(nil, { summary = true }) TS.update(nil, { summary = true })
end) end)
end, end,
lazy = vim.fn.argc(-1) == 0, -- load treesitter early when opening a file from the cmdline
event = { "LazyFile", "VeryLazy" }, event = { "LazyFile", "VeryLazy" },
cmd = { "TSUpdate", "TSInstall", "TSLog", "TSUninstall" }, cmd = { "TSUpdate", "TSInstall", "TSLog", "TSUninstall" },
opts_extend = { "ensure_installed" }, opts_extend = { "ensure_installed" },
---@alias lazyvim.TSFeat { enable?: boolean, disable?: string[] }
---@class lazyvim.TSConfig: TSConfig ---@class lazyvim.TSConfig: TSConfig
opts = { opts = {
-- LazyVim config for treesitter -- LazyVim config for treesitter
indent = { enable = true }, indent = { enable = true }, ---@type lazyvim.TSFeat
highlight = { enable = true }, highlight = { enable = true }, ---@type lazyvim.TSFeat
folds = { enable = true }, folds = { enable = true }, ---@type lazyvim.TSFeat
ensure_installed = { ensure_installed = {
"bash", "bash",
"c", "c",
@ -89,7 +91,7 @@ return {
return not LazyVim.treesitter.have(lang) return not LazyVim.treesitter.have(lang)
end, opts.ensure_installed or {}) end, opts.ensure_installed or {})
if #install > 0 then if #install > 0 then
LazyVim.treesitter.ensure_treesitter_cli(function() LazyVim.treesitter.build(function()
TS.install(install, { summary = true }):await(function() TS.install(install, { summary = true }):await(function()
LazyVim.treesitter.get_installed(true) -- refresh the installed langs LazyVim.treesitter.get_installed(true) -- refresh the installed langs
end) end)
@ -99,22 +101,32 @@ return {
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
group = vim.api.nvim_create_augroup("lazyvim_treesitter", { clear = true }), group = vim.api.nvim_create_augroup("lazyvim_treesitter", { clear = true }),
callback = function(ev) callback = function(ev)
if not LazyVim.treesitter.have(ev.match) then local ft, lang = ev.match, vim.treesitter.language.get_lang(ev.match)
if not LazyVim.treesitter.have(ft) then
return return
end end
---@param feat string
---@param query string
local function enabled(feat, query)
local f = opts[feat] or {} ---@type lazyvim.TSFeat
return f.enable ~= false
and not (type(f.disable) == "table" and vim.tbl_contains(f.disable, lang))
and LazyVim.treesitter.have(ft, query)
end
-- highlighting -- highlighting
if vim.tbl_get(opts, "highlight", "enable") ~= false then if enabled("highlight", "highlights") then
pcall(vim.treesitter.start) pcall(vim.treesitter.start)
end end
-- indents -- indents
if vim.tbl_get(opts, "indent", "enable") ~= false and LazyVim.treesitter.have(ev.match, "indents") then if enabled("indent", "indents") then
LazyVim.set_default("indentexpr", "v:lua.LazyVim.treesitter.indentexpr()") LazyVim.set_default("indentexpr", "v:lua.LazyVim.treesitter.indentexpr()")
end end
-- folds -- folds
if vim.tbl_get(opts, "folds", "enable") ~= false and LazyVim.treesitter.have(ev.match, "folds") then if enabled("folds", "folds") then
if LazyVim.set_default("foldmethod", "expr") then if LazyVim.set_default("foldmethod", "expr") then
LazyVim.set_default("foldexpr", "v:lua.LazyVim.treesitter.foldexpr()") LazyVim.set_default("foldexpr", "v:lua.LazyVim.treesitter.foldexpr()")
end end
@ -149,34 +161,40 @@ return {
end end
TS.setup(opts) TS.setup(opts)
local function attach(buf)
local ft = vim.bo[buf].filetype
if not (vim.tbl_get(opts, "move", "enable") and LazyVim.treesitter.have(ft, "textobjects")) then
return
end
---@type table<string, table<string, string>>
local moves = vim.tbl_get(opts, "move", "keys") or {}
for method, keymaps in pairs(moves) do
for key, query in pairs(keymaps) do
local desc = query:gsub("@", ""):gsub("%..*", "")
desc = desc:sub(1, 1):upper() .. desc:sub(2)
desc = (key:sub(1, 1) == "[" and "Prev " or "Next ") .. desc
desc = desc .. (key:sub(2, 2) == key:sub(2, 2):upper() and " End" or " Start")
if not (vim.wo.diff and key:find("[cC]")) then
vim.keymap.set({ "n", "x", "o" }, key, function()
require("nvim-treesitter-textobjects.move")[method](query, "textobjects")
end, {
buffer = buf,
desc = desc,
silent = true,
})
end
end
end
end
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
group = vim.api.nvim_create_augroup("lazyvim_treesitter_textobjects", { clear = true }), group = vim.api.nvim_create_augroup("lazyvim_treesitter_textobjects", { clear = true }),
callback = function(ev) callback = function(ev)
if not (vim.tbl_get(opts, "move", "enable") and LazyVim.treesitter.have(ev.match, "textobjects")) then attach(ev.buf)
return
end
---@type table<string, table<string, string>>
local moves = vim.tbl_get(opts, "move", "keys") or {}
for method, keymaps in pairs(moves) do
for key, query in pairs(keymaps) do
local desc = query:gsub("@", ""):gsub("%..*", "")
desc = desc:sub(1, 1):upper() .. desc:sub(2)
desc = (key:sub(1, 1) == "[" and "Prev " or "Next ") .. desc
desc = desc .. (key:sub(2, 2) == key:sub(2, 2):upper() and " End" or " Start")
if not (vim.wo.diff and key:find("[cC]")) then
vim.keymap.set({ "n", "x", "o" }, key, function()
require("nvim-treesitter-textobjects.move")[method](query, "textobjects")
end, {
buffer = ev.buf,
desc = desc,
silent = true,
})
end
end
end
end, end,
}) })
vim.tbl_map(attach, vim.api.nvim_list_bufs())
end, end,
}, },

View file

@ -23,6 +23,8 @@ return {
nav_j = { "<C-j>", term_nav("j"), desc = "Go to Lower Window", expr = true, mode = "t" }, nav_j = { "<C-j>", term_nav("j"), desc = "Go to Lower Window", expr = true, mode = "t" },
nav_k = { "<C-k>", term_nav("k"), desc = "Go to Upper Window", expr = true, mode = "t" }, nav_k = { "<C-k>", term_nav("k"), desc = "Go to Upper Window", expr = true, mode = "t" },
nav_l = { "<C-l>", term_nav("l"), desc = "Go to Right Window", expr = true, mode = "t" }, nav_l = { "<C-l>", term_nav("l"), desc = "Go to Right Window", expr = true, mode = "t" },
hide_slash = { "<C-/>", "hide", desc = "Hide Terminal", mode = { "t", "n" } },
hide_underscore = { "<c-_>", "hide", desc = "which_key_ignore", mode = { "t", "n" } },
}, },
}, },
}, },

View file

@ -5,8 +5,9 @@ local prios = {
["lazyvim.plugins.extras.coding.nvim-cmp"] = 2, ["lazyvim.plugins.extras.coding.nvim-cmp"] = 2,
["lazyvim.plugins.extras.editor.neo-tree"] = 2, ["lazyvim.plugins.extras.editor.neo-tree"] = 2,
["lazyvim.plugins.extras.ui.edgy"] = 3, ["lazyvim.plugins.extras.ui.edgy"] = 3,
["lazyvim.plugins.extras.lang.typescript"] = 5, ["lazyvim.plugins.extras.ai.copilot-native"] = 4,
["lazyvim.plugins.extras.coding.blink"] = 5, ["lazyvim.plugins.extras.coding.blink"] = 5,
["lazyvim.plugins.extras.lang.typescript"] = 5,
["lazyvim.plugins.extras.formatting.prettier"] = 10, ["lazyvim.plugins.extras.formatting.prettier"] = 10,
-- default core extra priority is 20 -- default core extra priority is 20
-- default priority is 50 -- default priority is 50

View file

@ -51,31 +51,85 @@ function M.indentexpr()
return M.have(nil, "indents") and require("nvim-treesitter").indentexpr() or -1 return M.have(nil, "indents") and require("nvim-treesitter").indentexpr() or -1
end end
---@param cb fun() ---@return string?
function M.ensure_treesitter_cli(cb) local function win_find_cl()
if vim.fn.executable("tree-sitter") == 1 then local path = "C:/Program Files (x86)/Microsoft Visual Studio"
return cb() local pattern = "*/*/VC/Tools/MSVC/*/bin/Hostx64/x64/cl.exe"
return vim.fn.globpath(path, pattern, true, true)[1]
end
---@return boolean ok, lazyvim.util.treesitter.Health health
function M.check()
local is_win = vim.fn.has("win32") == 1
---@param tool string
---@param win boolean?
local function have(tool, win)
return (win == nil or is_win == win) and vim.fn.executable(tool) == 1
end end
---@param msg? string local have_cc = vim.env.CC ~= nil or have("cc", false) or have("cl", true) or (is_win and win_find_cl() ~= nil)
local function fail(msg)
return LazyVim.error({ if not have_cc and is_win and vim.fn.executable("gcc") == 1 then
"**treesitter-nvim** `main` requires the `tree-sitter` CLI executable to be installed.", vim.env.CC = "gcc"
"Please install it manually from https://github.com/tree-sitter/tree-sitter/tree/master/crates/cli or", have_cc = true
"use your system package manager.", end
"Run `:checkhealth nvim-treesitter` for more information.",
msg, ---@class lazyvim.util.treesitter.Health: table<string,boolean>
}) local ret = {
["tree-sitter (CLI)"] = have("tree-sitter"),
["C compiler"] = have_cc,
tar = have("tar"),
curl = have("curl"),
node = have("node"),
}
local ok = true
for _, v in pairs(ret) do
ok = ok and v
end
return ok, ret
end
---@param cb fun()
function M.build(cb)
M.ensure_treesitter_cli(function(_, err)
local ok, health = M.check()
if ok then
return cb()
else
local lines = { "Unmet requirements for **nvim-treesitter** `main`:" }
local keys = vim.tbl_keys(health) ---@type string[]
table.sort(keys)
for _, k in pairs(keys) do
lines[#lines + 1] = ("- %s `%s`"):format(health[k] and "" or "", k)
end
vim.list_extend(lines, {
"",
"See the requirements at [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter/tree/main?tab=readme-ov-file#requirements)",
"Run `:checkhealth nvim-treesitter` for more information.",
})
if vim.fn.has("win32") == 1 and not health["C compiler"] then
lines[#lines + 1] = "Install a C compiler with `winget install --id=BrechtSanders.WinLibs.POSIX.UCRT -e`"
end
vim.list_extend(lines, err and { "", err } or {})
LazyVim.error(lines, { title = "LazyVim Treesitter" })
end
end)
end
---@param cb fun(ok:boolean, err?:string)
function M.ensure_treesitter_cli(cb)
if vim.fn.executable("tree-sitter") == 1 then
return cb(true)
end end
-- try installing with mason -- try installing with mason
if not pcall(require, "mason") then if not pcall(require, "mason") then
return fail("`mason.nvim` is disabled in your config, so we cannot install it automatically.") return cb(false, "`mason.nvim` is disabled in your config, so we cannot install it automatically.")
end end
-- check again since we might have installed it already -- check again since we might have installed it already
if vim.fn.executable("tree-sitter") == 1 then if vim.fn.executable("tree-sitter") == 1 then
return cb() return cb(true)
end end
local mr = require("mason-registry") local mr = require("mason-registry")
@ -88,9 +142,9 @@ function M.ensure_treesitter_cli(cb)
vim.schedule_wrap(function(success) vim.schedule_wrap(function(success)
if success then if success then
LazyVim.info("Installed `tree-sitter-cli` with `mason.nvim`.") LazyVim.info("Installed `tree-sitter-cli` with `mason.nvim`.")
cb() cb(true)
else else
fail("Failed to install `tree-sitter-cli` with `mason.nvim`.") cb(false, "Failed to install `tree-sitter-cli` with `mason.nvim`.")
end end
end) end)
) )

View file

@ -1,3 +1,3 @@
#!/bin/env bash #!/usr/bin/env bash
nvim -l tests/minit.lua --minitest nvim -l tests/minit.lua --minitest "$@"

View file

@ -1,7 +1,13 @@
#!/usr/bin/env -S nvim -l #!/usr/bin/env -S nvim -l
vim.env.LAZY_STDPATH = ".tests" vim.env.LAZY_STDPATH = ".tests"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))() vim.env.LAZY_PATH = vim.fs.normalize("~/projects/lazy.nvim")
if vim.fn.isdirectory(vim.env.LAZY_PATH) == 1 then
loadfile(vim.env.LAZY_PATH .. "/bootstrap.lua")()
else
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"), "bootstrap.lua")()
end
-- Setup lazy.nvim -- Setup lazy.nvim
require("lazy.minit").setup({ require("lazy.minit").setup({

View file

@ -1,21 +0,0 @@
[selene]
base = "lua51"
name = "vim"
[vim]
any = true
[jit]
any = true
[assert]
any = true
[describe]
any = true
[it]
any = true
[before_each.args]
any = true

19
vim.yml Normal file
View file

@ -0,0 +1,19 @@
base: lua51
lua_versions:
- luajit
globals:
Snacks:
any: true
vim:
any: true
jit:
any: true
assert:
any: true
describe:
any: true
it:
any: true
before_each:
any: true