Skip to content

🚀 [syntax highlighting] improved language mappings via shebang #485

@Kr1ss-XD

Description

@Kr1ss-XD

Some tools (especially bat) check source files for a shebang line and if present use this to assign the according syntax rules. I'm wondering if this would be possible for delta, too.

Currently, a source file seems to be considered a specific language only if its name/extension can be mapped to a known language. Therefore, generically named files (e.g. executable shell scripts without *.sh filename extension) are not being syntax highlighted by delta. Considering a shebang could be an option in addition to filenames or --map-syntax.

Maybe it's even possible to use the algorithm/regexes which bat has already implemented ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions