From b38465b50ee5af080d6b7ebc3edbb451a013c10d Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 7 Jan 2023 10:50:06 +0100 Subject: [PATCH] refactor(treesitter): make it easier to override installed parsers --- lua/lazyvim/plugins/treesitter.lua | 37 +++++++++++++++--------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/lua/lazyvim/plugins/treesitter.lua b/lua/lazyvim/plugins/treesitter.lua index b6d1a09c..506c081e 100644 --- a/lua/lazyvim/plugins/treesitter.lua +++ b/lua/lazyvim/plugins/treesitter.lua @@ -3,26 +3,27 @@ return { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", event = "BufReadPost", - config = function() + ensure_installed = { + "bash", + "help", + "html", + "javascript", + "json", + "lua", + "markdown", + "markdown_inline", + "python", + "query", + "regex", + "tsx", + "typescript", + "vim", + "yaml", + }, + config = function(plugin) require("nvim-treesitter.configs").setup({ sync_install = false, - ensure_installed = { - "bash", - "help", - "html", - "javascript", - "json", - "lua", - "markdown", - "markdown_inline", - "python", - "query", - "regex", - "tsx", - "typescript", - "vim", - "yaml", - }, + ensure_installed = plugin.ensure_installed, highlight = { enable = true }, indent = { enable = true }, context_commentstring = { enable = true, enable_autocmd = false },