Move usage string near parse_options
[tig] / tigrc.5.txt
1 tigrc(5)
2 ========
3
4 NAME
5 ----
6 tigrc - tig user configuration file
7
8
9 SYNOPSIS
10 --------
11 [verse]
12 .............................................................................
13 *set*   'variable' *=* 'value'
14 *bind*  'keymap' 'key' 'action'
15 *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
16 .............................................................................
17
18
19 DESCRIPTION
20 -----------
21
22 You can permanently set an option by putting it in the `~/.tigrc` file.  The
23 file consists of a series of 'commands'.  Each line of the file may contain
24 only one command.
25
26 The hash mark ('#') is used as a 'comment' character. All text after the
27 comment character to the end of the line is ignored. You can use comments to
28 annotate your initialization file.
29
30
31 Set command
32 -----------
33
34 A few selective variables can be configured via the set command. The syntax
35 is:
36
37 [verse]
38 ..............................................................................
39 *set* variables *=* value
40 ..............................................................................
41
42 Examples:
43
44 --------------------------------------------------------------------------
45 set show-author = yes           # Show author?
46 set show-date = yes             # Show commit date?
47 set show-rev-graph = yes        # Show revision graph?
48 set show-refs = yes             # Show references?
49 set show-line-numbers = no      # Show line numbers?
50 set author-width = 10           # Set width of the author column
51 set line-graphics = no          # Disable graphics characters
52 set line-number-interval = 5    # Interval between line numbers
53 set tab-size = 8                # Number of spaces per tab
54 set encoding = "UTF-8"          # Commit encoding
55 --------------------------------------------------------------------------
56
57 The type of variables are either bool, int, and string.
58
59 Valid bool values::
60
61         To set a bool variable to true use either "1", "true", or "yes".
62         Any other value will set the variable to false.
63
64 Valid int values::
65
66         A non-negative integer.
67
68 Valid string values::
69
70         A string of characters. Optionally, use either ' or " as delimiters.
71
72 Variables
73 ~~~~~~~~~
74
75 The following variables can be set:
76
77 'show-author' (bool)::
78 'show-date' (bool)::
79 'show-rev-graph' (bool)::
80 'show-refs' (bool)::
81
82         Whether to show author, date, revision graph, and references
83         (branches, tags, and remotes) in the main view on start-up. Can all be
84         toggled.
85
86 'author-width' (int)::
87
88         Width of the author column. When set to 5 or below, the author name
89         will be abbreviated to the author's initials.
90
91 'line-graphics' (bool)::
92
93         Whether to use graphic characters for line drawing.
94
95 'line-number-interval' (int)::
96
97         Interval between line numbers. Note, you have to toggle on line
98         numbering with 'n' or the `-n` command line option.  The default is to
99         number every line.
100
101 'tab-size' (int)::
102
103         Number of spaces per tab. The default is 8 spaces.
104
105 'commit-encoding' (string)::
106
107         The encoding used for commits. The default is UTF-8. Not this option
108         is shadowed by the "i18n.commitencoding" option in `.git/config`.
109
110
111 Bind command
112 ------------
113
114 Using bind commands keys can be mapped to an action when pressed in a given
115 key map. The syntax is:
116
117 [verse]
118 ..............................................................................
119 *bind* 'keymap' 'key' 'action'
120 ..............................................................................
121
122 Examples:
123
124 --------------------------------------------------------------------------
125 # A few keybindings
126 bind main w scroll-line-up
127 bind main s scroll-line-down
128 bind main space enter
129 bind diff a previous
130 bind diff d next
131 bind diff b move-first-line
132 # 'unbind' the default quit key binding
133 bind main Q none
134 # An external command to update from upstream
135 bind generic F !git fetch
136 # Cherry-pick current commit onto current branch
137 bind generic C !git cherry-pick %(commit)
138 --------------------------------------------------------------------------
139
140 Keys are mapped by first searching the keybindings for the current view, then
141 the keybindings for the *generic* keymap, and last the default keybindings.
142 Thus, the view keybindings shadow the generic keybindings which Shadow the
143 built-in keybindings.
144
145 --
146
147 Keymaps::
148
149 Valid keymaps are: *main*, *diff*, *log*, *help*, *pager*, *status*, *stage*,
150 and *generic*.  Use *generic* to set key mapping in all keymaps.
151
152 Key values::
153
154 Key values should never be quoted. Use either the ASCII value or one of the
155 following symbolic key names. Symbolic key names are case insensitive, Use
156 *Hash* to bind to the `#` key, since the hash mark is used as a comment
157 character.
158
159 *Enter*, *Space*, *Backspace*, *Tab*, *Escape*, *Left*, *Right*, *Up*, *Down*,
160 *Insert*, *Delete*, *Hash*, *Home*, *End*, *PageUp*, *PageDown*, *F1*, *F2*, *F3*,
161 *F4*, *F5*, *F6*, *F7*, *F8*, *F9*, *F10*, *F11*, *F12*.
162
163 Action names::
164
165 Valid action names are described below. Note, all names are
166 case-insensitive, and you may use '-', '_', and '.' interchangeably,
167 e.g. "view-main", "View.Main", and "VIEW_MAIN" are the same.
168
169 --
170
171 Actions
172 ~~~~~~~
173
174 Apart from the action names listed below, all actions starting with a '!' will
175 be available as an external command. External commands can contain variable
176 names that will be substituted before the command is run. Valid variable names
177 are:
178
179 ifdef::backend-xhtml11[]
180 [frame="none"]
181 `-----------------------`-----------------------------------------------------
182 endif::backend-xhtml11[]
183 Browsing state variables
184 ------------------------------------------------------------------------------
185 %(head)                 The currently viewed 'head' ID. Defaults to HEAD
186 %(commit)               The currently selected commit ID.
187 %(blob)                 The currently selected blob ID.
188 %(directory)            The current directory path in the tree view; \
189                         empty for the root directory.
190 %(file)                 The currently selected file.
191 %(ref)                  The reference given to blame or HEAD if undefined.
192 ------------------------------------------------------------------------------
193
194 As an example, the following external command will save the current commit as
195 a patch file: "!git format-patch -1 %(commit)".
196
197 ifdef::backend-xhtml11[]
198 [frame="none"]
199 `-----------------------`-----------------------------------------------------
200 endif::backend-xhtml11[]
201 View switching:
202 ------------------------------------------------------------------------------
203 view-main               Show main view
204 view-diff               Show diff view
205 view-log                Show log view
206 view-tree               Show tree view
207 view-blob               Show blob view
208 view-blame              Show blame view
209 view-status             Show status view
210 view-stage              Show stage view
211 view-pager              Show pager view
212 view-help               Show help page
213 ------------------------------------------------------------------------------
214
215 ifdef::backend-xhtml11[]
216 [frame="none"]
217 `-----------------------`-----------------------------------------------------
218 endif::backend-xhtml11[]
219 View manipulation:
220 ------------------------------------------------------------------------------
221 enter                   Enter current line and scroll
222 next                    Move to next
223 previous                Move to previous
224 parent                  Move to parent
225 view-next               Move focus to next view
226 refresh                 Reload and refresh view
227 maximize                Maximize the current view
228 view-close              Close the current view
229 quit                    Close all views and quit
230 ------------------------------------------------------------------------------
231
232 ifdef::backend-xhtml11[]
233 [frame="none"]
234 `-----------------------`-----------------------------------------------------
235 endif::backend-xhtml11[]
236 View specific actions:
237 ------------------------------------------------------------------------------
238 status-update           Update file status
239 status-merge            Resolve unmerged file
240 stage-next              Find next chunk to stage
241 ------------------------------------------------------------------------------
242
243 ifdef::backend-xhtml11[]
244 [frame="none"]
245 `-----------------------`-----------------------------------------------------
246 endif::backend-xhtml11[]
247 Cursor navigation:
248 ------------------------------------------------------------------------------
249 move-up                 Move cursor one line up
250 move-down               Move cursor one line down
251 move-page-down          Move cursor one page down
252 move-page-up            Move cursor one page up
253 move-first-line         Move cursor to first line
254 move-last-line          Move cursor to last line
255 ------------------------------------------------------------------------------
256
257 ifdef::backend-xhtml11[]
258 [frame="none"]
259 `-----------------------`-----------------------------------------------------
260 endif::backend-xhtml11[]
261 Scrolling:
262 ------------------------------------------------------------------------------
263 scroll-line-up          Scroll one line up
264 scroll-line-down        Scroll one line down
265 scroll-page-eup         Scroll one page up
266 scroll-page-down        Scroll one page down
267 scroll-left             Scroll one column left
268 scroll-right            Scroll one column right
269 ------------------------------------------------------------------------------
270
271 ifdef::backend-xhtml11[]
272 [frame="none"]
273 `-----------------------`-----------------------------------------------------
274 endif::backend-xhtml11[]
275 Searching:
276 ------------------------------------------------------------------------------
277 search                  Search the view
278 search-back             Search backwards in the view
279 find-next               Find next search match
280 find-prev               Find previous search match
281 ------------------------------------------------------------------------------
282
283 ifdef::backend-xhtml11[]
284 [frame="none"]
285 `-----------------------`-----------------------------------------------------
286 endif::backend-xhtml11[]
287 Misc:
288 ------------------------------------------------------------------------------
289 prompt                  Bring up the prompt
290 screen-redraw           Redraw the screen
291 screen-resize           Resize the screen
292 show-version            Show version information
293 stop-loading            Stop all loading views
294 toggle-lineno           Toggle line numbers
295 toggle-date             Toggle date display
296 toggle-author           Toggle author display
297 toggle-rev-graph        Toggle revision graph visualization
298 toggle-refs             Toggle reference display
299 edit                    Open in editor
300 none                    Do nothing
301 ------------------------------------------------------------------------------
302
303
304 Color command
305 -------------
306
307 Color commands control highlighting and the user interface styles. If your
308 terminal supports color, these commands can be used to assign foreground and
309 background combinations to certain areas. Optionally, an attribute can be
310 given as the last parameter. The syntax is:
311
312 [verse]
313 ..............................................................................
314 *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
315 ..............................................................................
316
317 Examples:
318
319 ------------------------------------------------------------------------------
320 # Overwrite the default terminal colors to white on black.
321 color default           white   black
322 # Diff colors
323 color diff-header       yellow  default
324 color diff-index        blue    default
325 color diff-chunk        magenta default
326 # A strange looking cursor line
327 color cursor            red     default underline
328 # UI colors
329 color title-blur        white   blue
330 color title-focus       white   blue    bold
331 ------------------------------------------------------------------------------
332
333 Area names::
334
335         Valid area names are described below. Note, all names are
336         case-insensitive, and you may use '-', '_', and '.' interchangeably,
337         e.g. "Diff-Header", "DIFF_HEADER", and "diff.header" are the same.
338
339 Color names::
340
341         Valid colors include: *white*, *black*, *green*, *magenta*, *blue*,
342         *cyan*, *yellow*, *red*, *default*. Use *default* to refer to the
343         default terminal colors. This is recommended for background colors
344         if you are using a terminal with a transparent background.
345
346 Attribute names::
347
348         Valid attributes include: *normal*, *blink*, *bold*, *dim*, *reverse*,
349         *standout*, and *underline*. Note, not all attributes may be supported
350         by the terminal.
351
352 UI colors
353 ~~~~~~~~~
354
355 The colors and attributes to be used for the text that is not highlighted or
356 that specify the use of the default terminal colors can be controlled by
357 setting the *default* color option.
358
359 ifdef::backend-xhtml11[]
360 [frame="none"]
361 `-----------------------`-----------------------------------------------------
362 endif::backend-xhtml11[]
363 General:
364 ------------------------------------------------------------------------------
365 default                 Overwrite default terminal colors (see above).
366 cursor                  The cursor line.
367 status                  The status window showing info messages.
368 title-focus             The title window for the current view.
369 title-blur              The title window of any backgrounded view.
370 delimiter               Delimiter shown for truncated lines.
371 line-number             Line numbers.
372 date                    The commit date.
373 ------------------------------------------------------------------------------
374
375 ifdef::backend-xhtml11[]
376 [frame="none"]
377 `-----------------------`-----------------------------------------------------
378 endif::backend-xhtml11[]
379 Main view colors:
380 ------------------------------------------------------------------------------
381 main-author             The commit author.
382 main-revgraph           The revision graph.
383 main-commit             The commit comment.
384 main-head               Label of the current branch.
385 main-remote             Label of a remote.
386 main-tracked            Label of the remote tracked by the current branch.
387 main-tag                Label of a signed tag.
388 main-local-tag          Label of a local tag.
389 main-ref                Label of any other reference.
390 ------------------------------------------------------------------------------
391
392 ifdef::backend-xhtml11[]
393 [frame="none"]
394 `-----------------------`-----------------------------------------------------
395 endif::backend-xhtml11[]
396 Status view:
397 ------------------------------------------------------------------------------
398 stat-head               The "On branch"-line.
399 stat-section            Status section titles,
400 stat-staged             Status flag of staged files.
401 stat-unstaged           Status flag of unstaged files.
402 stat-untracked          Status flag of untracked files.
403 ------------------------------------------------------------------------------
404
405 ifdef::backend-xhtml11[]
406 [frame="none"]
407 `-----------------------`-----------------------------------------------------
408 endif::backend-xhtml11[]
409 Blame view:
410 ------------------------------------------------------------------------------
411 blame-id                The commit ID.
412 ------------------------------------------------------------------------------
413
414 Highlighting
415 ~~~~~~~~~~~~
416
417 --
418
419 Diff markup::
420
421 Options concerning diff start, chunks and lines added and deleted.
422
423 *diff-header*, *diff-chunk*, *diff-add*, *diff-del*
424
425 Enhanced git diff markup::
426
427 Extra diff information emitted by the git diff machinery, such as mode
428 changes, rename detection, and similarity.
429
430 *diff-oldmode*, *diff-newmode*, *diff-copy-from*, *diff-copy-to*,
431 *diff-rename-from*, *diff-rename-to*, *diff-similarity*, *diff-dissimilarity*
432 *diff-tree*, *diff-index*
433
434 Pretty print commit headers::
435
436 Commit diffs and the revision logs are usually formatted using pretty printed
437 headers , unless `--pretty=raw` was given. This includes lines, such as merge
438 info, commit ID, and author and committer date.
439
440 *pp-author*, *pp-commit*, *pp-merge*, *pp-date*, *pp-adate*, *pp-cdate*,
441 *pp-refs*
442
443 Raw commit header::
444
445 Usually shown when `--pretty=raw` is given, however 'commit' is pretty much
446 omnipresent.
447
448 *commit*, *parent*, *tree*, *author*, *committer*
449
450 Commit message::
451
452 For now only `Signed-off-by` and `Acked-by` lines are colorized.
453
454 *signoff*, *acked*
455
456 Tree markup::
457
458 Colors for information of the tree view.
459
460 *tree-dir*, *tree-file*
461
462 --
463
464 COPYRIGHT
465 ---------
466 Copyright (c) 2006-2009 Jonas Fonseca <fonseca@diku.dk>
467
468 Licensed under the terms of the GNU General Public License.
469
470 SEE ALSO
471 --------
472 manpage:tig[1] and the http://jonas.nitro.dk/tig/manual.html[tig manual].