-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
nimpretty shall support pipe on stdin, to stdout #24622
Comments
Fine with me if enabled via an explicit |
How about via (Or like gofmt & rustfmt, no args means reading from stdin) Maybe |
Nimsuggest uses |
Mean echo "echo 1" | nim r - outputs "1" |
Alright then nimpretty better supports both |
Summary
nimpretty currently must run on nim files (passed as arguments),
and lacks the feature of
pipe
.Description
Formatter of other langs, like rustfmt, gofmt, allows reading stdin and outputting to stdout,
which is handy, for example, in vim, you can simply use
:%!rustfmt
to format current source code file.Yet neither
:%!nimpretty
or:%!nimpretty -
doesn't work, as it currently expects one or more files as arguments.Alternatives
Write to a temp file, nimpretty it and then cat it.
In addition, according to #8458 (comment), relying on bash substitution won't work
Examples
No response
Backwards Compatibility
None.
This just allows a cli usage used to be invalid
Links
#8458 (comment)
The text was updated successfully, but these errors were encountered: