Bat: Difference between revisions
From wikinotes
Line 13: | Line 13: | ||
<blockquote> | <blockquote> | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |||
| <code>~/.config/bat/config</code> || user config | |||
|- | |- | ||
| <code>/etc/bat/config</code> || system config | | <code>/etc/bat/config</code> || system config |
Revision as of 21:53, 6 May 2023
Bat is a syntax highlighted cat.
Documentation
github https://github.com/sharkdp/bat
Locations
~/.config/bat/config
user config /etc/bat/config
system config
Usage
bat file.graphql bat \ -l go `# syntaxhighlight for lang` \ --file-name 'my-file.go' `# set file title in result` \ --theme 'Monokai Extended Light'syntaxhighlighting
bat --list-languages bat -l Python echo '{ __schema { fields { name } } }' | bat -l graphql
Configuration
Config File
# writes sample config to ~/.config/bat/config bat --generate-config-file# the config-file simply defines CLI params. # comments are allowed # escaping lines is unecessary --theme="TwoDark"Environment Variables
BAT_THEME="TwoDark" BAT_CONFIG_PATH="/path/to/bat.conf"