-
-
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
Automatic syntax detection/guessing without using filename #205
Comments
|
FWIW, I think this is a very important feature. While I know that Personally, I was hoping to makes |
@zeenix What is the structure/syntax of I'm leaving this ticket open because I think we can fix the "does not work for STDIN or FIFOs" part (I have already planned an implementation). I don't think there is any change to make the syntax detection more powerful than it currently is. |
Some examples:
Cool.
Oh, that's a pity but I think at least for the second case of gst-launch (which is the most useful) that could work as I don't think many commands will output Also if there was an option to explicitly specify the language/content-type, the one-line-on-detection won't be a big problem. |
There is! You can always use For example (obviously, TOML is not the right syntax here, but it kinda works)
|
@sharkdp Ah yes, cool. TOML already makes it prettier to look at. So I guess we just need to add language support for |
|
@sharkdp Right. I don't quite agree with GStreamer not being mainstream enough but as long as there is a way to easily add my own language/syntaxes, it's all good. :) Thanks for your quick and informative replies and have a lovely weekend! |
My go-to resource to check popularity was https://packagecontrol.io and there doesn't even seem to be a package for gstreamer. Anyway, you have a nice weekend as well - Thank you for your feedback! |
Pygments has this feature where you can
cat <file> | pygmentize
orpygmentize <file-without-extension>
and the syntax will be guessed according to some patterns in the file.It would be great to avoid relying on file extensions only (which are not always present) or integrating with other commands that can output the content and pipe it directly to
bat
.The text was updated successfully, but these errors were encountered: