From ef6efa82a15f629c22e73917557b2d44be3a31c5 Mon Sep 17 00:00:00 2001 From: Toby Vincent Date: Tue, 24 Oct 2023 17:34:52 -0500 Subject: feat(nvim): add treesitter parsers install script --- nvim/.config/nvim/lua/plugins/treesitter.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'nvim/.config') diff --git a/nvim/.config/nvim/lua/plugins/treesitter.lua b/nvim/.config/nvim/lua/plugins/treesitter.lua index 21bdcad..16676ed 100644 --- a/nvim/.config/nvim/lua/plugins/treesitter.lua +++ b/nvim/.config/nvim/lua/plugins/treesitter.lua @@ -3,6 +3,15 @@ local M = { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", event = "BufReadPost", + cmd = { + "TSInstall", + "TSInstallInfo", + "TSInstallSync", + "TSModuleInfo", + "TSUninstall", + "TSUpdate", + "TSUpdateSync", + }, dependencies = { "nvim-treesitter/nvim-treesitter-textobjects", "mfussenegger/nvim-ts-hint-textobject", @@ -48,7 +57,6 @@ local M = { "scss", "sql", "svelte", - "teal", "toml", "tsx", "typescript", @@ -56,6 +64,9 @@ local M = { "vue", "yaml", }, + -- BUG: Required for TSUpdateSync to work in headless. + -- Ref: https://github.com/nvim-treesitter/nvim-treesitter/issues/2900 + sync_install = #vim.api.nvim_list_uis() == 0, indent = { enable = true, }, -- cgit v1.2.3-70-g09d2