From f601c02caddc613647eda6f6707ee02bcb3d45d8 Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Thu, 9 Apr 2026 11:31:42 +0500 Subject: [PATCH] migrate to new treesitter --- .config/nvim/lua/user/plugins/treesitter.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lua/user/plugins/treesitter.lua b/.config/nvim/lua/user/plugins/treesitter.lua index a768567..7fc5969 100644 --- a/.config/nvim/lua/user/plugins/treesitter.lua +++ b/.config/nvim/lua/user/plugins/treesitter.lua @@ -3,9 +3,11 @@ return { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", lazy = false, + branch = 'main', -- init = function(plugin) -- require("nvim-treesitter") -- end, + -- TODO: old options format, need to reconfigure opts = { ensure_installed = { "python", "rust", "javascript" }, -- one of "all" or a list of languages ignore_install = { "phpdoc", "comment", "rst" }, -- List of parsers to ignore installing @@ -34,8 +36,13 @@ return { }, }, }, - config = function (_, opts) - require("nvim-treesitter.configs").setup(opts) + config = function(_, opts) + -- enable treesitter highlighting + vim.api.nvim_create_autocmd("FileType", { + callback = function(args) + pcall(vim.treesitter.start, args.buf) + end, + }) end }, }