on 89fcbb2 help sign in
bat/doc/bat.1
141 lines 4.7 kB history raw
1.TH BAT "1"
2.SH NAME
3bat \- manual page for bat
4.SH DESCRIPTION
5bat - a cat(1) clone with syntax highlighting and Git integration.
6.SH "USAGE"
7.IP
8bat [OPTIONS] [FILE]...
9.IP
10bat <SUBCOMMAND>
11.SH "OPTIONS"
12.HP
13\fB\-l\fR, \fB\-\-language\fR <language>
14.IP
15Explicitly set the language for syntax highlighting. The language can be specified as a
16name (like 'C++' or 'LaTeX') or possible file extension (like 'cpp', 'hpp' or 'md'). Use
17\&'\-\-list\-languages' to show all supported language names and file extensions.
18.HP
19\fB\-\-list\-languages\fR
20.IP
21Display a list of supported languages for syntax highlighting.
22.HP
23\fB\-m\fR, \fB\-\-map\-syntax\fR <from:to>...
24.IP
25Map a file extension or file name to an existing syntax. For example, to highlight
26*.conf files with the INI syntax, use '\-m conf:ini'. To highlight files named
27\&'.myignore' with the Git Ignore syntax, use '\-m .myignore:gitignore'.
28.HP
29\fB\-\-theme\fR <theme>
30.IP
31Set the theme for syntax highlighting. Use '\-\-list\-themes' to see all available themes.
32To set a default theme, add the '\-\-theme="..."' option to the configuration file or
33export the BAT_THEME environment variable (e.g.: export BAT_THEME="...").
34.HP
35\fB\-\-list\-themes\fR
36.IP
37Display a list of supported themes for syntax highlighting.
38.HP
39\fB\-\-style\fR <style\-components>
40.IP
41Configure which elements (line numbers, file headers, grid borders, Git modifications,
42\&..) to display in addition to the file contents. The argument is a comma\-separated list
43of components to display (e.g. 'numbers,changes,grid') or a pre\-defined style ('full').
44To set a default style, add the '\-\-style=".."' option to the configuration file or
45export the BAT_STYLE environment variable (e.g.: export BAT_STYLE=".."). Possible
46values: *auto*, full, plain, changes, header, grid, numbers.
47.HP
48\fB\-p\fR, \fB\-\-plain\fR
49.IP
50Only show plain style, no decorations. This is an alias for '\-\-style=plain'
51.HP
52\fB\-n\fR, \fB\-\-number\fR
53.IP
54Only show line numbers, no other decorations. This is an alias for '\-\-style=numbers'
55.HP
56\fB\-A\fR, \fB\-\-show\-all\fR
57.IP
58Show non\-printable characters like space, tab or newline. Use '\-\-tabs' to control the
59width of the tab\-placeholders.
60.HP
61\fB\-\-line\-range\fR <N:M>...
62.IP
63Only print the specified range of lines for each file. For example:
64.RS
65.IP "\-\-line\-range 30:40"
66prints lines 30 to 40
67.IP "\-\-line\-range :40"
68prints lines 1 to 40
69.IP "\-\-line\-range 40:"
70prints lines 40 to the end of the file
71.RE
72.HP
73\fB\-H\fR, \fB\-\-highlight\-line\fR <N>...
74.IP
75Highlight the N-th line with a different background color
76.HP
77\fB\-\-color\fR <when>
78.IP
79Specify when to use colored output. The automatic mode only enables colors if an
80interactive terminal is detected. Possible values: *auto*, never, always.
81.HP
82\fB\-\-italic\-text\fR <when>
83.IP
84Specify when to use ANSI sequences for italic text in the output. Possible values:
85always, *never*.
86.HP
87\fB\-\-decorations\fR <when>
88.IP
89Specify when to use the decorations that have been specified via '\-\-style'. The
90automatic mode only enables decorations if an interactive terminal is detected. Possible
91values: *auto*, never, always.
92.HP
93\fB\-\-paging\fR <when>
94.IP
95Specify when to use the pager. To control which pager is used, set the PAGER or
96BAT_PAGER environment variables (the latter takes precedence) or use the '\-\-pager'
97option. To disable the pager permanently, set BAT_PAGER to an empty string or set
98\&'\-\-paging=never' in the configuration file. Possible values: *auto*, never, always.
99.HP
100\fB\-\-pager\fR <command>
101.IP
102Determine which pager is used. This option will overwrite the PAGER and BAT_PAGER
103environment variables. The default pager is 'less'. To disable the pager completely, use
104the '\-\-paging' option. Example: '\-\-pager "less \fB\-RF\fR"'.
105.HP
106\fB\-\-wrap\fR <mode>
107.IP
108Specify the text\-wrapping mode (*auto*, never, character).
109.HP
110\fB\-\-tabs\fR <T>
111.IP
112Set the tab width to T spaces. Use a width of 0 to pass tabs through directly
113.HP
114\fB\-u\fR, \fB\-\-unbuffered\fR
115.IP
116This option exists for POSIX\-compliance reasons ('u' is for 'unbuffered'). The output is
117always unbuffered \- this option is simply ignored.
118.HP
119\fB\-\-terminal\-width\fR <width>
120.IP
121Explicitly set the width of the terminal instead of determining it automatically. If
122prefixed with '+' or '\-', the value will be treated as an offset to the actual terminal
123width.
124.HP
125\fB\-h\fR, \fB\-\-help\fR
126.IP
127Print this help message.
128.HP
129\fB\-V\fR, \fB\-\-version\fR
130.IP
131Show version information.
132.SH "ARGS"
133.IP
134<FILE>...
135.IP
136File(s) to print / concatenate. Use a dash ('\-') or no argument at all to read
137from standard input.
138.SH "SUBCOMMANDS"
139.IP
140cache
141Modify the syntax\-definition and theme cache