helix
helix copied to clipboard
pretty print `tree-sitter-subtree` expression
Closes #2880
This PR indents and line-breaks the expression displayed for :tree-sitter-subtree. For short sexprs it might be a little annoying. Maybe we should generate the sexpr and if it's longer than ~40 chars, manually format it?
I didn't know where to put the formatting function, so I just put it inside the command itself.
Before:

After:

With named fields:

Also @the-mikedavis if you merge this, could you add the hacktoberfest-accepted label for me? And I just want to add that this PR was the first time I used helix and I'm addicted. I'm trying to use it in every side-project now hoping to get productive enough to use it full-time at work! Thank you and the rest of the contributors for your work on the project :)
Thanks!