summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--nvim/.config/nvim/lua/plugins/treesitter.lua13
-rwxr-xr-xnvim/install.sh4
2 files changed, 16 insertions, 1 deletions
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,
},
diff --git a/nvim/install.sh b/nvim/install.sh
index 8d21011..e51df09 100755
--- a/nvim/install.sh
+++ b/nvim/install.sh
@@ -9,3 +9,7 @@ printf "%s: Restoring plugins\n" "$0"
nvim --headless -c 'Lazy! restore' -c qa
nvim --headless -c 'Lazy! clean' -c qa
+
+printf "%s: Installing treesitter parsers\n" "$0"
+
+nvim --headless -c 'TSInstallSync' -c qa