Use custom foldtext

This commit is contained in:
Kenneth Benzie 2024-04-02 20:49:11 +01:00
parent 776fb1f204
commit f95a8fb8e5

View File

@ -77,6 +77,18 @@ vim.opt.autowrite = true
-- Don't add 2 spaces after end of sentence -- Don't add 2 spaces after end of sentence
vim.opt.joinspaces = false 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 -- Enable all mouse features
vim.opt.mouse = 'a' vim.opt.mouse = 'a'