mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-03-21 11:53:50 +00:00
treesitter: make foldenable configurable
This commit is contained in:
parent
046afc8b3e
commit
68b7df5065
3 changed files with 10 additions and 7 deletions
|
|
@ -6,6 +6,7 @@
|
|||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.lists) optionals;
|
||||
inherit (lib.nvim.dag) entryAfter;
|
||||
inherit (lib.trivial) boolToString;
|
||||
|
||||
cfg = config.vim.treesitter;
|
||||
in {
|
||||
|
|
@ -54,10 +55,7 @@ in {
|
|||
callback = function()
|
||||
vim.wo[0][0].foldmethod = "expr"
|
||||
vim.wo[0][0].foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||
-- This is optional, but is set rather as a sane default.
|
||||
-- If unset, opened files will be folded by automatically as
|
||||
-- the files are opened
|
||||
vim.o.foldenable = false
|
||||
vim.o.foldenable = ${boolToString cfg.foldByDefault}
|
||||
end,
|
||||
})
|
||||
''}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue