From d873f5ffb14a8b52ec3567865e11026e1566a403 Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Mon, 22 Aug 2022 07:56:56 +0200 Subject: [PATCH] feat(neovim): use treesitter for folding --- home-manager/neovim/options.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/home-manager/neovim/options.lua b/home-manager/neovim/options.lua index 67d59c2..2386f6e 100644 --- a/home-manager/neovim/options.lua +++ b/home-manager/neovim/options.lua @@ -34,6 +34,10 @@ vim.opt.inccommand = "split" -- completion vim.opt.completeopt = "menu,menuone,noselect" +-- folding +vim.opt.foldmethod = "expr" +vim.opt.foldexpr = 'nvim_treesitter#foldexpr()' + -- set cursorline in active window vim.cmd([[ augroup CursorLine @@ -51,4 +55,3 @@ vim.cmd([[ autocmd TermOpen * setlocal nonumber norelativenumber augroup END ]]) -