on master help sign in
add new section for sytax of file in README.md
4be32cfhenil
README.md+14−5
@@ -492,17 +492,26 @@ alias cat="bat --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /de
492
492
493### Syntax of a file
493### Syntax of a file
494
494
495−You can configure `bat` to change the default syntax of the file using `--map-syntax`. Use glob pattern to match exact filename.
495+You can change the default syntax highlighting of the file using `--map-syntax` option.
496+It uses glob pattern matching and is matched on full path and filename.
497+
498+Use it like this:
499+
500+```bash
501+bat --map-syntax='PATTERN:SYNTAX' file-name
502+```
496
503
497For example:
504For example:
498```bash
505```bash
499−# Use INI syntax for .conf files
506+# Using `INI` file syntax highligting when opening a file with extension `.conf`.
500−--map-syntax "*.conf:INI"
507+bat --map-syntax='*.conf:INI' file.conf
501
508
502−# Use ".gitignore"-style highlighting for ".ignore" files
509+# Using `Git Ignore` file syntax highlighting for ".ignore" files
503−--map-syntax ".ignore:Git Ignore"
510+bat --map-syntax='.ignore:Git Ignore' .ignore
504```
511```
505
512
513+You can use `bat --list-languages` to see all the file syntax types available.
514+
506## Configuration file
515## Configuration file
507
516
508`bat` can also be customized with a configuration file. The location of the file is dependent
517`bat` can also be customized with a configuration file. The location of the file is dependent