Sublime Forum

Open STDIN *and* specify filetype

#1

I don’t think this is possible now, and I’d like it to be.

I want to pipe the output of one or more commands into subl and also be able to specify the “filetype” of the content I am wishing to open. “Filetype” is a poor word for this, as the content is not in a file (unless you call STDIN a file, I guess.)

Anyway, I can open files from STDIN using subl just fine, but I’d like to be able to specify how to highlight/parse those files from the command line as well.

0 Likes

#2

At this moment, maybe https://packagecontrol.io/packages/AutoSetSyntax can help. But if it’s a “cold start” for ST, there is a noticeable delay for a plugin to work. It can also be configured to use a tiny deep learning model to guess the syntax.

0 Likes

#3

Did you already try subl --command 'set_file_type {"syntax": "Packages/JSON/JSON.sublime-syntax"}'(using whatever syntax is appropriate)?

0 Likes