nvim: drop nvim-treesitter (archived, broken on 0.12), replace with mini.ai

This commit is contained in:
2026-04-10 00:06:05 +02:00
parent 07839d9c20
commit 198a173b4d
5 changed files with 18 additions and 106 deletions

View File

@@ -3,7 +3,6 @@ return {
"nvim-neotest/neotest",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
"nvim-neotest/nvim-nio",
"rouge8/neotest-rust",
"rcasia/neotest-java",

View File

@@ -1,10 +1,2 @@
-- Ensure Treesitter knows about LaTeX (nabla benefits, and some plugins use it)
return {
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
if type(opts.ensure_installed) == "table" then
if not vim.tbl_contains(opts.ensure_installed, "latex") then table.insert(opts.ensure_installed, "latex") end
end
end,
}
-- nvim-treesitter dropped; latex parser available via system package or tree-sitter-cli
return {}

View File

@@ -1,70 +1,20 @@
-- nvim-treesitter dropped: archived, incompatible with Neovim 0.12 API.
-- Neovim 0.12 handles treesitter natively (highlighting, folding, injections).
-- Bundled parsers: bash, c, lua, markdown, markdown_inline, python, query,
-- regex, vim, vimdoc.
-- Additional parsers (rust, ts, java, etc.): install via AUR tree-sitter-* or
-- tree-sitter-cli: https://github.com/tree-sitter/tree-sitter
return {
-- Textobjects: pairs, quotes, args, brackets — no treesitter dependency
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
event = { "BufReadPost", "BufNewFile" },
dependencies = {
"nvim-treesitter/nvim-treesitter-textobjects",
},
"echasnovski/mini.ai",
event = "VeryLazy",
opts = {
ensure_installed = {
"lua", "rust", "typescript", "javascript", "svelte",
"java", "latex", "markdown", "markdown_inline",
"yaml", "toml", "bash", "html", "css", "jinja",
"json", "vim", "vimdoc", "regex",
},
auto_install = true,
highlight = {
enable = true,
additional_vim_regex_highlighting = { "latex" }, -- needed for vimtex
},
indent = { enable = true },
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<C-space>",
node_incremental = "<C-space>",
scope_incremental = false,
node_decremental = "<bs>",
},
},
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
["am"] = "@function.outer",
["im"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
["a,"] = "@parameter.outer",
["i,"] = "@parameter.inner",
},
},
move = {
enable = true,
set_jumps = true,
goto_next_start = {
["]m"] = "@function.outer",
["]c"] = "@class.outer",
},
goto_next_end = {
["]M"] = "@function.outer",
["]C"] = "@class.outer",
},
goto_previous_start = {
["[m"] = "@function.outer",
["[c"] = "@class.outer",
},
goto_previous_end = {
["[M"] = "@function.outer",
["[C"] = "@class.outer",
},
},
},
n_lines = 500,
-- Extend the default textobjects with mini.extra
-- a( i( a[ i[ a{ i{ a< i< a" i" a' i' a` i` — built-in
-- af if — function call args (built-in)
},
config = function(_, opts)
require("nvim-treesitter.configs").setup(opts)
end,
},
}

View File

@@ -168,7 +168,7 @@ return {
{
"MeanderingProgrammer/render-markdown.nvim",
ft = { "markdown" },
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" },
dependencies = { "nvim-tree/nvim-web-devicons" },
opts = {
heading = { enabled = true },
code = { enabled = true, style = "full" },
@@ -194,7 +194,7 @@ return {
-- Symbols outline panel
{
"stevearc/aerial.nvim",
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" },
dependencies = { "nvim-tree/nvim-web-devicons" },
keys = {
{ "<leader>uo", "<cmd>AerialToggle!<cr>", desc = "Symbols outline" },
},

View File

@@ -1,29 +0,0 @@
; Override nvim-treesitter's markdown injections to avoid #set-lang-from-info-string!
; which crashes on Neovim 0.12 due to changed match table API (captures are now lists).
; Uses Neovim's native @injection.language capture instead.
(fenced_code_block
(info_string
(language) @injection.language)
(code_fence_content) @injection.content)
((html_block) @injection.content
(#set! injection.language "html")
(#set! injection.combined)
(#set! injection.include-children))
((minus_metadata) @injection.content
(#set! injection.language "yaml")
(#offset! @injection.content 1 0 -1 0)
(#set! injection.include-children))
((plus_metadata) @injection.content
(#set! injection.language "toml")
(#offset! @injection.content 1 0 -1 0)
(#set! injection.include-children))
([
(inline)
(pipe_table_cell)
] @injection.content
(#set! injection.language "markdown_inline"))