Bat: Difference between revisions

From wikinotes
Line 14: Line 14:
<source lang="bash">
<source lang="bash">
bat file.graphql
bat file.graphql
bat \
  -l go  `# syntaxhighlight for lang` \
  --file-name 'my-file.go'  `# set file title in result` \
  --theme 'Monokai Extended Light'
</source>
syntaxhighlighting
<syntaxhighlight lang="bash">
bat --list-languages
bat --list-languages
bat -l Python
bat -l Python
echo '{ __schema { fields { name } } }' | bat -l graphql
echo '{ __schema { fields { name } } }' | bat -l graphql
</source>
</syntaxhighlight>
</blockquote><!-- Usage -->
</blockquote><!-- Usage -->

Revision as of 21:43, 6 May 2023

Bat is a syntax highlighted cat.

Documentation

github https://github.com/sharkdp/bat

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