From 4be32cf746630e91ef291751cbf1590dd75fc97c Mon Sep 17 00:00:00 2001 From: henil Date: Mon, 5 Oct 2020 22:20:26 +0530 Subject: [PATCH] add new section for sytax of file in README.md --- README.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 96e2f982..85214eab 100644 --- a/README.md +++ b/README.md @@ -492,17 +492,26 @@ alias cat="bat --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /de ### 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: ```bash -# Use INI syntax for .conf files ---map-syntax "*.conf:INI" +# Using `INI` file syntax highligting when opening a file with extension `.conf`. +bat --map-syntax='*.conf:INI' file.conf -# Use ".gitignore"-style highlighting for ".ignore" files ---map-syntax ".ignore:Git Ignore" +# Using `Git Ignore` file syntax highlighting for ".ignore" files +bat --map-syntax='.ignore:Git Ignore' .ignore ``` +You can use `bat --list-languages` to see all the file syntax types available. + ## Configuration file `bat` can also be customized with a configuration file. The location of the file is dependent