From 31a03cac7b898126ad08ab19ed1de2f0a282f759 Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Thu, 15 Jan 2026 16:40:06 +0000 Subject: [PATCH] Add treesitter keymap to reset foldmethod Seems like treesitter folds get into a confused situation, potentially a race condition, which is fixed by setting `foldmethod=expr`. This mapping makes that faster. --- lua/plugins/treesitter.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 11a31a8..caacf0f 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -98,5 +98,10 @@ return { }, }, }) + + -- Keymaps + vim.keymap.set('n', 'fm', function() + vim.o.foldmethod = 'expr' + end, {}) end }