Skip to content
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

Feature Request: Recognize Dockerfile.* #37

Open
twmartin opened this issue Dec 29, 2021 · 1 comment
Open

Feature Request: Recognize Dockerfile.* #37

twmartin opened this issue Dec 29, 2021 · 1 comment

Comments

@twmartin
Copy link

twmartin commented Dec 29, 2021

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.*: microsoft/vscode-docker#1907. Could we get that same filename convention matching support here as well?

Thanks!

@princemaple
Copy link
Collaborator

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 princemaple pinned this issue Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants