-
-
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
Support custom extension and file name mappings #169
Comments
The file extensions and filenames that should be highlighted are specified in the respective However, they will probably not accept something generic like I'm inclined to say that this feature would be a useful addition to (by the way, I hope that you already know that you can always use something like |
This is a great idea. From a usability perspective, it would be ideal if Regarding the config file's format, I think INI and TOML are a bit nicer than YAML and JSON. They're less pedantic about syntax (i.e. INIs don't care about quoting strings, or about structuring dictionaries and arrays properly, while a typo in a large JSON file can result in very frustrating error messages, and an empty YAML file won't even parse). |
My 2 cents is that power users will always have a need to override default configuration (in this case, the Sublime syntax definitions). They might find that using a specific highlight syntax for a custom file works better, they want to add common but not standard extensions (my case), or they are working on a system that doesn't use the standard extensions for some reason. |
This adds a `-m`/`--map-syntax` option that allows users to (re)map certain file extensions or file names to an existing syntax. For example: ``` bat --map-syntax .config:json ``` The option can be use multiple times. Note that you can easily make these mappings permanent by using `bat`s new configuration file. closes #169
This adds a `-m`/`--map-syntax` option that allows users to (re)map certain file extensions or file names to an existing syntax. For example: ``` bat --map-syntax .config:json ``` The option can be use multiple times. Note that you can easily make these mappings permanent by using `bat`s new configuration file. closes #169
Released in v0.8.0. |
I would like to add custom file name and extension mappings to a language. For example, Erlang often uses
.config
as an extension for configuration files, and some canonical files likerebar.lock
in the project root folder should also be highlighted as Erlang.It would be nice to be able to assign custom extension mappings to languages, and additionally complete file name mappings (could also be abused as extensions).
The text was updated successfully, but these errors were encountered: