Adjust treesitter load

Thu, 11 Apr 2024 22:25:18 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Thu, 11 Apr 2024 22:25:18 -0500
changeset 1150
52033d249bcb
parent 1149
4af7c8156683
child 1151
ecfcc61310d4

Adjust treesitter load

.config/nvim/lua/plugins/filetype.lua file | annotate | diff | comparison | revisions
--- a/.config/nvim/lua/plugins/filetype.lua
+++ b/.config/nvim/lua/plugins/filetype.lua
@@ -12,11 +12,11 @@ return {
     dependencies = {
       "RRethy/nvim-treesitter-endwise",
     },
-    event = { "BufReadPost", "BufNewFile" },
-    build = function()
-      require("nvim-treesitter.install").update({ with_sync = true })
-    end,
+    event = "VeryLazy",
+    build = ":TSUpdate",
+    cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" },
     config = function()
+      ---@diagnostic disable-next-line: missing-fields
       require("nvim-treesitter.configs").setup({
         highlight = { enable = true },
         indent = { enable = true },
@@ -36,6 +36,7 @@ return {
       })
     end,
   },
+
   { "Shougo/vinarise.vim", cmd = "Vinarise" },
   "asciidoc/vim-asciidoc",
   { "vim-perl/vim-perl", branch = "dev" },

mercurial