diff --git a/docs/manual/release-notes/rl-0.9.md b/docs/manual/release-notes/rl-0.9.md index c792df75..0bea2b95 100644 --- a/docs/manual/release-notes/rl-0.9.md +++ b/docs/manual/release-notes/rl-0.9.md @@ -22,7 +22,6 @@ ``` Some other settings and commands are now deprecated but are still supported. - - The `setupOpts.mappings` options were also removed. Use the built-in Neovim settings (nvf's {option}`vim.keymaps`) @@ -35,7 +34,6 @@ - "Correct `languages.go.treesitter` to contain all Go file types. `languages.go.treesitter.package` is now `languages.go.treesitter.goPackage`. New are: - - `languages.go.treesitter.goPackage`. - `languages.go.treesitter.gomodPackage`. @@ -70,7 +68,7 @@ following: ```shell - (class: "nixos") cannot be imported into a module + (class: "nixos") cannot be imported into a module evaluation that expects class "darwin". ``` @@ -165,7 +163,9 @@ - Mappings are now expected to be set using the built-in Neovim APIs, managed by `vim.keymaps` in nvf, instead of `mappings` options. - Some option defaults have changed. + - And more. + - Automatically configure an enabled picker in the order mentioned above, if any are enabled. - Add integration with `snacks.image` for rendering workspace/vault assets. @@ -318,4 +318,8 @@ https://github.com/gorbit99/codewindow.nvim - Fix `vim.formatter.conform-nvim.setupOpts.formatters` type for correct merging +[tlvince](https://github.com/tlvince): + +- Added configuration option for `foldenable` + diff --git a/modules/plugins/treesitter/config.nix b/modules/plugins/treesitter/config.nix index 899e7c19..e1bbc3c4 100644 --- a/modules/plugins/treesitter/config.nix +++ b/modules/plugins/treesitter/config.nix @@ -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, }) ''} diff --git a/modules/plugins/treesitter/treesitter.nix b/modules/plugins/treesitter/treesitter.nix index c2039a9f..dd62e750 100644 --- a/modules/plugins/treesitter/treesitter.nix +++ b/modules/plugins/treesitter/treesitter.nix @@ -10,6 +10,7 @@ in { enable = mkEnableOption "treesitter, also enabled automatically through language options"; fold = mkEnableOption "fold with treesitter"; + foldByDefault = mkEnableOption "folding by default when a file is opened"; autotagHtml = mkEnableOption "autoclose and rename html tag"; grammars = mkOption {