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
|
|
@ -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`
|
||||
|
||||
<!-- vim: set textwidth=80: -->
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
})
|
||||
''}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue