Docker.tmbundle icon indicating copy to clipboard operation
Docker.tmbundle copied to clipboard

Feature Request: Recognize Dockerfile.*

Open twmartin opened this issue 3 years ago • 1 comments

It was noticed that Github gives files named like Dockerfile.* no syntax highlighting; however, this appears to be a fairly common naming convention for Dockerfiles and is also referenced in the Docker documentation (https://docs.docker.com/engine/reference/commandline/build/#specify-a-dockerfile--f). My impression is that this is the project that provides Github with its Dockerfile syntax highlighting, but please correct me if I'm wrong. The VS Code Docker syntax highlighter had a similar feature request some time ago where they decided to recognize Dockerfile.*: https://github.com/microsoft/vscode-docker/issues/1907. Could we get that same filename convention matching support here as well?

Thanks!

twmartin avatar Dec 29 '21 20:12 twmartin

similar to #31

My recommendation is to use https://packagecontrol.io/packages/ApplySyntax.

My setting is like

{
    //...
    "syntaxes": [
        {
            "syntax": "Dockerfile Syntax Highlighting/Syntaxes/Dockerfile-bash",
            "rules": [
                { "file_path": ".*(?:\\\\|/)Dockerfile(\\.\\w+)*$" }
            ]
        },
        //...
    ]
}

If someone figured out a way to do this in Sublime syntax, or ST eventually added the feature, a PR is very welcome!

princemaple avatar Jan 03 '22 03:01 princemaple