diff --git a/nvim/.config/nvim/lua/plugins/treesitter.lua b/nvim/.config/nvim/lua/plugins/treesitter.lua index 18e2e53..53306e2 100644 --- a/nvim/.config/nvim/lua/plugins/treesitter.lua +++ b/nvim/.config/nvim/lua/plugins/treesitter.lua @@ -1,7 +1,23 @@ return { { "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", + run = ":TSUpdate", + -- show current cursor context at top of buffer + -- improves commenting plugin above by using ts + dependencies = { + { "romgrk/nvim-treesitter-context", config = true }, + "JoosepAlviste/nvim-ts-context-commentstring", + "RRethy/nvim-treesitter-textsubjects", + "windwp/nvim-ts-autotag", + "RRethy/nvim-treesitter-endwise", + -- rainbow brackets using treesitter + { + "HiPhish/rainbow-delimiters.nvim", + config = function() + require("rainbow-delimiters.setup").setup({}) + end, + }, + }, config = function() require("nvim-treesitter.configs").setup({ -- one of "all", "maintained" (parsers with maintainers), or a list of languages @@ -63,7 +79,7 @@ return { filetype = "nu", } end, - event = { "BufReadPost", "BufNewFile", "BufWritePre", "VeryLazy" }, + event = { "VeryLazy" }, cmd = { "TSBufDisable", "TSBufEnable", @@ -83,24 +99,5 @@ return { { "si", "Inspect", desc = "treesitter element", silent = true }, { "sI", "InspectTree", desc = "treesitter tree", silent = true }, }, - - -- show current cursor context at top of buffer - -- improves commenting plugin above by using ts - dependencies = { - { "romgrk/nvim-treesitter-context", config = true }, - "JoosepAlviste/nvim-ts-context-commentstring", - "RRethy/nvim-treesitter-textsubjects", - "windwp/nvim-ts-autotag", - "RRethy/nvim-treesitter-endwise", - }, - }, - -- rainbow brackets using treesitter - { - "https://gitlab.com/HiPhish/rainbow-delimiters.nvim", - lazy = false, - event = { "BufReadPost", "BufNewFile", "BufWritePre", "VeryLazy" }, - config = function() - require("rainbow-delimiters.setup").setup({}) - end, }, }