Skip to content

Trouble with treesitter indentation and any kind of formatting. #750

Answered by venkyr77
Steve-Cooley asked this question in Q&A
Discussion options

You must be logged in to vote

I face this issue too, treesitter.indent.enable = true seems to be adding more indentation than what is needed. I was able to get a hack that fixes indentation issues for me.

Hack - use guess-indent-nvim with treesitter.indent.enable = true

{pkgs, ...}: {
  config.vim.extraPlugins."guess-indent" = {
    package = pkgs.vimPlugins.guess-indent-nvim;
    setup =
      # lua
      ''
        require("guess-indent").setup()
      '';
  };
}

I need both of them to be setup (that is guess-indent-nvim + treesitter.indent.enable = true), without any of this, my indentation is literally unusable :(

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@Steve-Cooley
Comment options

Comment options

You must be logged in to vote
1 reply
@Steve-Cooley
Comment options

Answer selected by Steve-Cooley
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants