-
Can we use tree-sitter as a pager like bat and pygmentize? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Direct answer - no. As it says in the README, "Tree-sitter is a parser generator tool and an incremental parsing library." It is not possible to use the If your question is more akin to "Can pager applications such as A quick search for currently available solutions revealed You can also use |
Beta Was this translation helpful? Give feedback.
-
Actually it's possible to use it in a pipe with the less util like: |
Beta Was this translation helpful? Give feedback.
Direct answer - no. As it says in the README, "Tree-sitter is a parser generator tool and an incremental parsing library." It is not possible to use the
tree-sitter
application to read an input and provide paged, formatted, or colored output.If your question is more akin to "Can pager applications such as
bat
orless
usetree-sitter
to provide syntax highlighting? - yes, they can, and it is up to the maintainer (or up to you) to add such support.A quick search for currently available solutions revealed
syncat
.You can also use
nvim
to open files in read-only mode and use it as an ad-hoc pager, but you will not get colored output into a terminal this way.