diff options
| -rw-r--r-- | lua/ache/plugins/treesitter.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lua/ache/plugins/treesitter.lua b/lua/ache/plugins/treesitter.lua index df133d0..5ef3525 100644 --- a/lua/ache/plugins/treesitter.lua +++ b/lua/ache/plugins/treesitter.lua @@ -29,12 +29,8 @@ return { }, indent = { enable = true, - disable = {}, + disable = { "c" }, -- C indent is bugged :'( }, - -- TODO: Install nvim-ts-autotag - -- autotag = { -- With nvim-ts-autotag plugin - -- enable = true, - -- }, --[[ rainbow = { enable = true, @@ -123,6 +119,7 @@ return { -- vim.wo[0][0].foldlevel = 9 -- vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" + -- WARN: If there is folding problem with python, refresh with <leader>z vim.keymap.set("n", "<leader>z", function() vim.cmd([[set foldexpr=nvim_treesitter#foldexpr()]]) end, { desc = "Refresh folding from Treesitter" }) @@ -130,9 +127,12 @@ return { -- Use treesitter for auto-fold -- Create an autocommand for "BufRead" events + -- WARN: Fix Python folding vim.api.nvim_create_autocmd("FileType", { -- This autocommand will only trigger if the buffer name matches the following patterns - -- pattern = { "*.yaml", "*.yml" }, + -- NOTE: Oddly, the pattern MUST be commented, them it will run on every file + -- if the pattern is applied, it doesn't work anymore for python. 🤷 + -- pattern = { "*.py", "*.yml", "*.yaml" }, -- The autocommand will trigger the following lua function callback = function() local parsers = require("nvim-treesitter.parsers") |