Skip to content

Treesitter folds are broken #1256

@blackxored

Description

@blackxored

I have confirmed that this is a bug related to nvf

  • This is a bug, and not an user error or a support request. I understand that my issue will be closed if it is not a bug in nvf.
  • I have checked the issues tab and confirmed that my issue has not yet been reported. I understand that my issue will be closed if it is a duplicate.

Description

Treesitter folds are broken, it only works if you manually set vim.opt.foldexpr to the specified value after a file is opened.
I'm not sure what is going on this file other than being that way to solve another issue?

Installation Method

NixOS Module (nixosModules.default)

Installation Method (Other)

No response

nvf Version

main

Reproduction steps

  1. Set vim.treesitter.fold = true in your config.
  2. Open a file with code
  3. Try any folding options (i.e zA to toggle all folds)
  4. See that no folds were registered.

Expected behavior

To be working by default without having to set foldexpr or any other fold-related options that seem to fix it.

Actual Behavior

No folds are registered, can't close or open folds.

System Information

- system: `"aarch64-darwin"`
 - host os: `Darwin 25.2.0, macOS 26.2`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Lix, like Nix) 2.94.0
System type: aarch64-darwin
Additional system types: 
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf

Relevant log output

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions