bat-extras
bat-extras copied to clipboard
feature: support bat's `--language` option
when i batgrep generic files, e.g. *.txt, the matching text isn't highlighted since bat is not aware which language the file is. it would be great if the file's language could be passed to bat via the --language option, starting with batgrep. many thanks.
Is it possible to provide an example of what you mean?
With batgrep, bat is given the the full file name and should be able to correctly detect the syntax based on the file extension. For example, running BAT_THEME='OneHalfLight' ./src/batgrep.sh bat in this repo will correctly highlight Markdown and shell scripts based on their file names:
i think the --language is most useful when piping into batgrep