From f95a8fb8e5f5ea15642e7c0fabc66e8aea0585a4 Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Tue, 2 Apr 2024 20:49:11 +0100 Subject: [PATCH] Use custom foldtext --- lua/settings.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lua/settings.lua b/lua/settings.lua index e3f087a..c3439b4 100644 --- a/lua/settings.lua +++ b/lua/settings.lua @@ -77,6 +77,18 @@ vim.opt.autowrite = true -- Don't add 2 spaces after end of sentence vim.opt.joinspaces = false +-- Set fold level to something high +vim.opt.foldlevel = 20 +vim.opt.foldmethod = 'expr' +vim.opt.foldexpr = 'nvim_treesitter#foldexpr()' +vim.opt.fillchars = 'fold: ' +-- FIXME: Replace this with transparent fold text in 0.10 +-- https://github.com/neovim/neovim/pull/20750 +function _G.fold_text() + return vim.fn.getline(vim.v.foldstart) +end +vim.opt.foldtext = 'v:lua.fold_text()' + -- Enable all mouse features vim.opt.mouse = 'a'