-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option for reindentation #565
Comments
Thank you for the feedback. We have discussed pretty-printing in the past (see e.g. #55). I'd rather not implement this in I think the best way to do this is to pipe into |
Thinking of it, maybe we could provide a wrapper script in this repository that would:
Something like: #!/bin/bash
for file in "$@"; do
extension="${file##*.}"
case "$extension" in
xml)
xmllint --format "$file" | bat -lxml
;;
json)
json_pp < "$file" | bat -ljson
;;
*)
bat "$file"
;;
esac
done |
I like the idea, but I would guess that it is a little out of scope for this project. Perhaps a possible solution could be to store some preferences as to what external command to execute for each file type to prettify them. But I guess many people will be using Just my 2 cents :) |
Absolutely. Even if we were to implement this in
Hm, I don't believe that sublime syntax files have enough information to implement pretty printing (for any non-trivial syntax). I think that most pretty printers are based on actual parsers for the given language. The pretty-printing part is then "just" a way of formatting the AST.
👍 |
oops, sorry - I didn't see your replies before I wrote mine @sharkdp, so I like the idea you came up with is so similar to what I was imagining ;) you're right - my thinking was that if one wants to build a general purpose prettifier, each |
I think we can close this now that we have |
Hi
Just tried out bat. Fell in love. I wish you'ld get it included in Ubuntu / Debian / CentOS repositories but that's not my topic right now.
I'm screwing up with Jenkins atm, it look like this
I wish there was an option to add line break & indent this properly. Make it pretty basically. I did it adding a
| xmllint --format - |
, but maybe you can consider this forbat
Keep up the rocking on !
The text was updated successfully, but these errors were encountered: