1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-02-21 20:38:44 +00:00

add new section for sytax of file in README.md

This commit is contained in:
henil 2020-10-05 22:20:26 +05:30 committed by David Peter
parent 4ec6075f81
commit 4be32cf746

View File

@ -492,17 +492,26 @@ alias cat="bat --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /de
### Syntax of a file ### Syntax of a file
You can configure `bat` to change the default syntax of the file using `--map-syntax`. Use glob pattern to match exact filename. You can change the default syntax highlighting of the file using `--map-syntax` option.
It uses glob pattern matching and is matched on full path and filename.
Use it like this:
```bash
bat --map-syntax='PATTERN:SYNTAX' file-name
```
For example: For example:
```bash ```bash
# Use INI syntax for .conf files # Using `INI` file syntax highligting when opening a file with extension `.conf`.
--map-syntax "*.conf:INI" bat --map-syntax='*.conf:INI' file.conf
# Use ".gitignore"-style highlighting for ".ignore" files # Using `Git Ignore` file syntax highlighting for ".ignore" files
--map-syntax ".ignore:Git Ignore" bat --map-syntax='.ignore:Git Ignore' .ignore
``` ```
You can use `bat --list-languages` to see all the file syntax types available.
## Configuration file ## Configuration file
`bat` can also be customized with a configuration file. The location of the file is dependent `bat` can also be customized with a configuration file. The location of the file is dependent