From 099ab02b376ca00316f1cedb15948189687d8364 Mon Sep 17 00:00:00 2001 From: Miroito Date: Fri, 1 May 2026 15:21:41 +0200 Subject: [PATCH] start treesitter highlighting --- lua/plugins/treesitter.lua | 13 +++++++++++-- nvim-pack-lock.json | 8 ++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 0ac5198..629f8bc 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -11,10 +11,19 @@ vim.api.nvim_create_autocmd('PackChanged', { end }) +vim.api.nvim_create_autocmd('FileType', { + callback = function() + -- Enable treesitter highlighting and disable regex syntax + pcall(vim.treesitter.start) + -- Enable treesitter-based indentation + vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" + end, +}) + vim.pack.add({ - { src = 'https://github.com/nvim-treesitter/nvim-treesitter', name = 'treesitter', branch = 'main' }, + { src = 'https://github.com/nvim-treesitter/nvim-treesitter', name = 'treesitter', branch = 'main' }, { src = 'https://github.com/nvim-treesitter/nvim-treesitter-context', name = 'treesitter-context' }, - { src = 'https://github.com/nvim-treesitter/nvim-treesitter-textobjects', name = 'treesitter-textobjects' }, + { src = 'https://github.com/nvim-treesitter/nvim-treesitter-textobjects', name = 'treesitter-textobjects', branch = 'main' }, }) require("nvim-treesitter").setup() diff --git a/nvim-pack-lock.json b/nvim-pack-lock.json index 96706a1..4717bd3 100644 --- a/nvim-pack-lock.json +++ b/nvim-pack-lock.json @@ -14,7 +14,7 @@ "version": "1.0.0 - 2.0.0" }, "conform.nvim": { - "rev": "086a40dc7ed8242c03be9f47fbcee68699cc2395", + "rev": "dca1a190aa85f9065979ef35802fb77131911106", "src": "https://github.com/stevearc/conform.nvim" }, "friendly-snippets": { @@ -26,11 +26,11 @@ "src": "https://github.com/tpope/vim-fugitive" }, "gitsigns": { - "rev": "8d82c240f190fc33723d48c308ccc1ed8baad69d", + "rev": "6d808f99bd63303646794406e270bd553ad7792e", "src": "https://github.com/lewis6991/gitsigns.nvim" }, "nvim-lspconfig": { - "rev": "4b7fbaa239c5db6b36f424a4521ca9f1a401be33", + "rev": "31026a13eefb20681124706a79fc1df6bf11ab27", "src": "https://github.com/neovim/nvim-lspconfig" }, "plenary": { @@ -38,7 +38,7 @@ "src": "https://github.com/nvim-lua/plenary.nvim" }, "telescope": { - "rev": "471eebb1037899fd942cc0f52c012f8773505da1", + "rev": "506338434fec5ad19cb1f8d45bf92d66c4917393", "src": "https://github.com/nvim-telescope/telescope.nvim" }, "tokyonight": {