@@ -490,27 +490,32 @@ and the `GitHub` theme when in the _light mode_.
490alias cat="bat --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo default || echo GitHub)"
490alias cat="bat --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo default || echo GitHub)"
493−### Syntax of a file
493+### Adapting file type associations
495−You can change the default syntax association of the file using the `--map-syntax` option.
495+You can add new (or change existing) file name patterns using the
496−It supports glob pattern matching and is matched on full path and filename.
496+`--map-syntax` option. The option takes an argument of the form `pattern:syntax`.
497+`pattern` is a glob pattern that is matched against the file name and
498+the absolute file path. `syntax` is the *name* of a supported language
499+(use `bat --list-languages` for an overview).
498−You can use it like this:
501+This option is most useful in combination with the `bat` configuration file (see below).
503+Example: To use "INI" syntax highlighting for all files with a `.conf` file extension, use
501−bat --map-syntax='PATTERN:SYNTAX' file-name
505+--map-syntax='*.conf:INI'
504−For example:
508+Example: To open all files called `.ignore` (exact match) with the "Git Ignore" syntax, use:
506−# Using `INI` file syntax highlighting when opening a file with extension `.conf`.
510+--map-syntax='.ignore:Git Ignore'
507−bat --map-syntax='*.conf:INI' file.conf
511+```
509−# Using `Git Ignore` file syntax highlighting for ".ignore" files
513+Example: To open all `.conf` files in subfolders of `/etc/apache2` with the "Apache Conf"
510−bat --map-syntax='.ignore:Git Ignore' .ignore
514+syntax, use (this mapping is already built in):
516+-map-syntax='/etc/apache2/**/*.conf:Apache Conf'
513−You can use `bat --list-languages` to see all the file syntax types available.
515## Configuration file
520## Configuration file