From b1746b0178dada15b190b34394db655929f24794 Mon Sep 17 00:00:00 2001 From: Ade Attwood Date: Wed, 10 Apr 2024 19:17:42 +0100 Subject: [PATCH] feat(vim): auto install treesitter grammars Previously we were defining what ones we want to install. Now we are say we want to install the grammar when we go to a file. If we don't have that grammar installed then we will install it then --- site-modules/core/files/vim/plugin/treesitter.lua | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/site-modules/core/files/vim/plugin/treesitter.lua b/site-modules/core/files/vim/plugin/treesitter.lua index a944c47..3027f43 100644 --- a/site-modules/core/files/vim/plugin/treesitter.lua +++ b/site-modules/core/files/vim/plugin/treesitter.lua @@ -1,4 +1,5 @@ require("nvim-treesitter.configs").setup { + auto_install = true, playground = { enable = true }, indent = { enable = false }, rainbow = { enable = true }, @@ -7,13 +8,9 @@ require("nvim-treesitter.configs").setup { enable = true, additional_vim_regex_highlighting = true, }, - ensure_installed = { - "typescript", - "javascript", - "tsx", - "php", - "html", - "go", - "clojure", - }, } + + +vim.opt.foldmethod = "expr" +vim.opt.foldexpr = "nvim_treesitter#foldexpr()" +vim.opt.foldenable = false