diff options
| author | Sergii Tykhomyrov <sergii@tykhomyrov.net> | 2026-08-05 17:48:59 +0200 |
|---|---|---|
| committer | Sergii Tykhomyrov <sergii@tykhomyrov.net> | 2026-08-05 17:48:59 +0200 |
| commit | fbc989f6353bcf7a503d387fd563a2dd5329c9ba (patch) | |
| tree | 0506b7c19ab6cfc7120dabd46c389fe3d60f0cb6 /nvim | |
| parent | 634ec6a09ce5744252a6d89291f747c0b490d6e1 (diff) | |
| download | dotfiles-fbc989f6353bcf7a503d387fd563a2dd5329c9ba.tar.gz dotfiles-fbc989f6353bcf7a503d387fd563a2dd5329c9ba.zip | |
Migrate nvim-treesitter to the main branch
The archived master branch is not compatible with Neovim 0.12.
Its set-lang-from-info-string! directive expects one node from
match[capture_id], but the API now returns a list. This broke
every Markdown file with a tagged code fence:
"attempt to call method 'range' (a nil value)".
The main branch has a new API. Parsers now install through the
tree-sitter CLI, and highlighting starts from a FileType autocmd.
The Lazy sync also updated nvim-lspconfig.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015wSc17AA47J3LVZCoKfpZa
Diffstat (limited to 'nvim')
| -rw-r--r-- | nvim/dot-config/nvim/lazy-lock.json | 4 | ||||
| -rw-r--r-- | nvim/dot-config/nvim/lua/plugins/treesitter.lua | 21 |
2 files changed, 16 insertions, 9 deletions
diff --git a/nvim/dot-config/nvim/lazy-lock.json b/nvim/dot-config/nvim/lazy-lock.json index c2c2f1a..7eef574 100644 --- a/nvim/dot-config/nvim/lazy-lock.json +++ b/nvim/dot-config/nvim/lazy-lock.json @@ -4,8 +4,8 @@ "mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "ebd66767191714e008ce73b769518a763ff31bdc" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, - "nvim-lspconfig": { "branch": "master", "commit": "1c0d8f70dbc8827263eedc3cf7021ceba0f68689" }, - "nvim-treesitter": { "branch": "master", "commit": "cf12346a3414fa1b06af75c79faebe7f76df080a" }, + "nvim-lspconfig": { "branch": "master", "commit": "43ed3797b266e1ee8d222e491379ad471c9d3146" }, + "nvim-treesitter": { "branch": "main", "commit": "7b6cc8949f9999c5ed91436cbe24aa5f99c42025" }, "nvim-web-devicons": { "branch": "master", "commit": "2ae6958df7ced50baac5035cec0c15799eedfbf7" }, "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, "telescope.nvim": { "branch": "master", "commit": "427b576c16792edad01a92b89721d923c19ad60f" } diff --git a/nvim/dot-config/nvim/lua/plugins/treesitter.lua b/nvim/dot-config/nvim/lua/plugins/treesitter.lua index 9809d84..3c904f1 100644 --- a/nvim/dot-config/nvim/lua/plugins/treesitter.lua +++ b/nvim/dot-config/nvim/lua/plugins/treesitter.lua @@ -1,16 +1,23 @@ return { "nvim-treesitter/nvim-treesitter", - branch = "master", + branch = "main", + lazy = false, build = ":TSUpdate", config = function() - require("nvim-treesitter.configs").setup({ - ensure_installed = { + require("nvim-treesitter").install({ + "python", "go", "gomod", "gosum", "gotmpl", "html", + "lua", "vim", "vimdoc", + "markdown", "markdown_inline", "yaml", + }) + vim.api.nvim_create_autocmd("FileType", { + pattern = { "python", "go", "gomod", "gosum", "gotmpl", "html", - "lua", "vim", "vimdoc", - "markdown", "markdown_inline", "yaml", + "lua", "vim", "markdown", "yaml", }, - highlight = { enable = true }, - indent = { enable = true }, + callback = function() + vim.treesitter.start() + vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" + end, }) end, } |
