Merge pull request #81 from esc/fix/reading_git_colors_256
[tig.git] / tigrc.5.txt
blobb824147cc6c0470f53a6e00f4cde78c95b1675bc
1 tigrc(5)
2 ========
4 NAME
5 ----
6 tigrc - tig configuration file
9 SYNOPSIS
10 --------
11 [verse]
12 *set*   'variable' *=* 'value'
13 *bind*  'keymap' 'key' 'action'
14 *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
15 *source* 'path'
18 DESCRIPTION
19 -----------
21 You can permanently set an option by putting it in the `~/.tigrc` file.  The
22 file consists of a series of 'commands'.  Each line of the file may contain
23 only one command.
25 The hash mark ('#') is used as a 'comment' character. All text after the
26 comment character to the end of the line is ignored. You can use comments to
27 annotate your initialization file.
29 Alternatively, options can be set by putting them in one of the git
30 configuration files, which are read by tig on startup. See 'git-config(1)' for
31 which files to use.
33 Set command
34 -----------
36 A few selective variables can be configured via the set command. The syntax
37 is:
39 [verse]
40 *set* variables *=* value
42 Examples:
44 --------------------------------------------------------------------------
45 set show-author = abbreviated   # Show abbreviated author names.
46 set show-date = relative        # Show relative commit date.
47 set show-rev-graph = yes        # Show revision graph?
48 set show-refs = yes             # Show references?
49 set commit-order = topo         # Order commits topologically
50 set read-git-colors = no        # Do not read git's color settings.
51 set show-line-numbers = no      # Show line numbers?
52 set line-number-interval = 5    # Interval between line numbers
53 set horizontal-scroll = 33%     # Scroll 33% of the view width
54 set blame-options = -C -C -C    # Blame lines from other files
55 --------------------------------------------------------------------------
57 Or in the git configuration files:
59 --------------------------------------------------------------------------
60 [tig]
61         show-date = yes         # Show commit date?
62         author-width = 10       # Set width of the author column
63         line-graphics = no      # Disable graphics characters
64         tab-size = 8            # Number of spaces per tab
65 --------------------------------------------------------------------------
67 The type of variables is either bool, int, string, or mixed.
69 Valid bool values::
71         To set a bool variable to true use either "1", "true", or "yes".
72         Any other value will set the variable to false.
74 Valid int values::
76         A non-negative integer.
78 Valid string values::
80         A string of characters. Optionally, use either ' or " as delimiters.
82 Valid mixed values::
84         These values are composites of the above types. The valid values are
85         specified in the description.
87 Variables
88 ~~~~~~~~~
90 The following variables can be set:
92 'author-width' (int)::
94         Width of the author column. When set to 5 or below, the author name
95         will be abbreviated to the author's initials.
98 'filename-width' (int)::
100         Width of the filename column.
102 'id-width' (int)::
104         Width of the commit ID. When unset tig will use the value of
105         'core.abbrev' if found or default to 7.  See git-config(1) on how to
106         set 'core.abbrev'.
108 'blame-options' (string)::
110         A space separated string of extra blame options. Can be used for
111         telling git-blame(1) how to detect the origin of lines. The value
112         is ignored when tig is started in blame mode and given blame options
113         on the command line.
115 'line-graphics' (mixed) [ "ascii" | "default" | "utf-8" | bool]::
117         What type of character graphics for line drawing.
119 'line-number-interval' (int)::
121         Interval between line numbers. Note, you have to toggle on line
122         numbering with ".".  The default is to number every fifth line.
124 'horizontal-scroll' (mixed)::
126         Interval to scroll horizontally in each step. Can be specified either
127         as the number of columns, e.g. '5', or as a percentage of the view
128         width, e.g. '33%', where the maximum is 100%. For percentages it is
129         always ensured that at least one column is scrolled. The default is to
130         scroll '50%' of the view width.
132 'read-git-colors' (bool)::
134         Whether to read git's color settings.
136 'show-author' (mixed) ["abbreviated" | "full" | bool]::
138         How to display author names. If set to "abbreviated" author initials
139         will be shown. Can be toggled.
141 'show-filename' (mixed) ["auto" | "always" | bool]::
143         When to display file names. If set to "auto" file names are shown
144         only when needed, e.g. when running: tig blame -C <file>.
146 'show-date' (mixed) ["relative" | "short" | "default" | "local" | bool]::
148         Whether and how to show date. If set to "relative" a relative date will be
149         used, e.g. "2 minutes ago". If set to "short" no time information is
150         shown. If set to "local", localtime(3) is used. Can be toggled.
152 'show-notes' (mixed) [note reference | bool]::
154         Whether to show notes for a commit. When set to a note reference the
155         reference is passed to `git show --notes=`. Notes are enabled by
156         default.
158 'show-refs' (bool)::
160         Whether to show references (branches, tags, and remotes) in the main
161         view on start-up. Can be toggled.
163 'show-id' (bool)::
165         Whether to show commit IDs in the main view. Disabled by default. Can
166         be toggled. See also 'id-width' option.
168 'show-rev-graph' (bool)::
170         Whether to show revision graph in the main view on start-up.
171         Can be toggled. See also line-graphics options.
173 'show-changes' (bool)::
175         Whether to show staged and unstaged changes in the main view.
176         Can be toggled.
178 'vertical-split' (bool)::
180         Whether to split the view horizontally or vertically.
182 'split-view-height' (mixed)::
184         Height of the lower view in a split view. Can be specified either as
185         the number of rows, e.g. '5', or as a percentage of the view height,
186         e.g. '80%', where the maximum is 100%. It is always ensured that the
187         smaller of the views is at least four rows high. The default is a view
188         height of '66%'.
190 'status-untracked-dirs' (bool)::
192         Show untracked directories contents in the status view (analog to
193         `git ls-files --directory` option). On by default.
195 'tab-size' (int)::
197         Number of spaces per tab. The default is 8 spaces.
199 'diff-context' (int)::
201         Number of context lines to show for diffs.
203 'ignore-space' (mixed) ["no" | "all" | "some" | "at-eol" | bool]::
205     Ignore space changes in diff view. By default no space changes are ignored.
206     Changing this to "all", "some" or "at-eol" is equivalent to passing
207     "--ignore-all-space", "--ignore-space" or "--ignore-space-at-eol"
208     respectively to `git diff` or `git show`.
210 'commit-order' (mixed) ["default" | "topo" | "date" | "reverse" | bool]::
212         Commit ordering using the default (chronological reverse) order,
213         topological order, date order or reverse order. The default order is
214         used when the option is set to false, and topo order when set to true.
216 'ignore-case' (bool)::
218         Ignore case in searches. By default, the search is case sensitive.
220 'wrap-lines' (bool)::
222         Wrap long lines. By default, lines are not wrapped.
223         Not compatible with line numbers enabled.
225 Bind command
226 ------------
228 Using bind commands keys can be mapped to an action when pressed in a given
229 key map. The syntax is:
231 [verse]
232 *bind* 'keymap' 'key' 'action'
234 Examples:
236 --------------------------------------------------------------------------
237 # A few keybindings
238 bind main w scroll-line-up
239 bind main s scroll-line-down
240 bind main space enter
241 bind diff a previous
242 bind diff d next
243 bind diff b move-first-line
244 # An external command to update from upstream
245 bind generic F !git fetch
246 --------------------------------------------------------------------------
248 Or in the git configuration files:
250 --------------------------------------------------------------------------
251 [tig "bind"]
252         # 'unbind' the default quit key binding
253         main = Q none
254         # Cherry-pick current commit onto current branch
255         generic = C !git cherry-pick %(commit)
256 --------------------------------------------------------------------------
258 Keys are mapped by first searching the keybindings for the current view, then
259 the keybindings for the *generic* keymap, and last the default keybindings.
260 Thus, the view keybindings shadow the generic keybindings which Shadow the
261 built-in keybindings.
265 Keymaps::
267 Valid keymaps are: *main*, *diff*, *log*, *help*, *pager*, *status*, *stage*,
268 *tree*, *blob*, *blame*, *branch*, and *generic*.  Use *generic* to set key
269 mapping in all keymaps.
271 Key values::
273 Key values should never be quoted. Use either the ASCII value or one of the
274 following symbolic key names. Symbolic key names are case insensitive, Use
275 *Hash* to bind to the `#` key, since the hash mark is used as a comment
276 character.
278 *Enter*, *Space*, *Backspace*, *Tab*, *Escape*, *Left*, *Right*, *Up*, *Down*,
279 *Insert*, *Delete*, *Hash*, *Home*, *End*, *PageUp*, *PageDown*, *F1*, *F2*, *F3*,
280 *F4*, *F5*, *F6*, *F7*, *F8*, *F9*, *F10*, *F11*, *F12*.
282 Action names::
284 Valid action names are described below. Note, all names are
285 case-insensitive, and you may use '-', '_', and '.' interchangeably,
286 e.g. "view-main", "View.Main", and "VIEW_MAIN" are the same.
290 Actions
291 ~~~~~~~
293 Apart from the action names listed below, all actions starting with a '!' will
294 be available as an external command. External commands can contain variable
295 names that will be substituted before the command is run. Valid variable names
296 are:
298 .Browsing state variables
299 [frame="none",grid="none",cols="25<m,75<"]
300 |=============================================================================
301 |%(head)                |The currently viewed 'head' ID. Defaults to HEAD
302 |%(commit)              |The currently selected commit ID.
303 |%(blob)                |The currently selected blob ID.
304 |%(branch)              |The currently selected branch name.
305 |%(directory)           |The current directory path in the tree view;
306                          empty for the root directory.
307 |%(file)                |The currently selected file.
308 |%(ref)                 |The reference given to blame or HEAD if undefined.
309 |%(revargs)             |The revision arguments passed on the command line.
310 |%(fileargs)            |The file arguments passed on the command line.
311 |%(diffargs)            |The diff options passed on the command line.
312 |%(prompt)              |Prompt for the argument value.
313 |=============================================================================
315 As an example, the following external command will save the current commit as
316 a patch file: "!git format-patch -1 %(commit)". If your external command
317 requires use of dynamic features, such as subshells, expansion of environment
318 variables and process control, this can be achieved by using a combination of
319 git aliases and tig external commands. The following example entries can be
320 put in either the .gitconfig or .git/config file:
322 --------------------------------------------------------------------------
323 [alias]
324         gitk-bg = !"gitk HEAD --not $(git rev-parse --remotes) &"
325         publish = !"for i in origin public; do git push $i; done"
326 [tig "bind"]
327         # @-prefix means that the console output will not be shown.
328         generic = V !@git gitk-bg
329         generic = > !git publish
330 --------------------------------------------------------------------------
332 By default, commands are run in the foreground with their console output
333 shown. For different behavior, commands can be prefixed with one or more of
334 the following control flags to specify how it should be executed:
336 .External command control flags
337 [frame="none",grid="none",cols="25<m,75<"]
338 |=============================================================================
339 |@                      |Run the command in the background with no output.
340 |?                      |Prompt the user before executing the command.
341 |<                      |Exit tig after executing the command.
342 |=============================================================================
344 Control flags can be combined, e.g. "!?<git commit" will prompt whether to
345 execute the command and will exit tig after completion.
347 .View switching
348 [frame="none",grid="none",cols="25<m,75<"]
349 |=============================================================================
350 |view-main              |Show main view
351 |view-diff              |Show diff view
352 |view-log               |Show log view
353 |view-tree              |Show tree view
354 |view-blob              |Show blob view
355 |view-blame             |Show blame view
356 |view-branch            |Show branch view
357 |view-status            |Show status view
358 |view-stage             |Show stage view
359 |view-pager             |Show pager view
360 |view-help              |Show help page
361 |=============================================================================
363 .View manipulation
364 [frame="none",grid="none",cols="25<m,75<"]
365 |=============================================================================
366 |enter                  |Enter current line and scroll
367 |next                   |Move to next
368 |previous               |Move to previous
369 |parent                 |Move to parent
370 |view-next              |Move focus to next view
371 |refresh                |Reload and refresh view
372 |maximize               |Maximize the current view
373 |view-close             |Close the current view
374 |quit                   |Close all views and quit
375 |=============================================================================
377 .View specific actions
378 [frame="none",grid="none",cols="25<m,75<"]
379 |=============================================================================
380 |status-update          |Update file status
381 |status-merge           |Resolve unmerged file
382 |stage-update-line      |Stage single line
383 |stage-next             |Find next chunk to stage
384 |diff-context-up        |Increase the diff context
385 |diff-context-down      |Decrease the diff context
386 |=============================================================================
388 .Cursor navigation
389 [frame="none",grid="none",cols="25<m,75<"]
390 |=============================================================================
391 |move-up                |Move cursor one line up
392 |move-down              |Move cursor one line down
393 |move-page-down         |Move cursor one page down
394 |move-page-up           |Move cursor one page up
395 |move-first-line        |Move cursor to first line
396 |move-last-line         |Move cursor to last line
397 |=============================================================================
399 .Scrolling
400 [frame="none",grid="none",cols="25<m,75<"]
401 |=============================================================================
402 |scroll-line-up         |Scroll one line up
403 |scroll-line-down       |Scroll one line down
404 |scroll-page-up         |Scroll one page up
405 |scroll-page-down       |Scroll one page down
406 |scroll-first-col       |Scroll to the first column
407 |scroll-left            |Scroll one column left
408 |scroll-right           |Scroll one column right
409 |=============================================================================
411 .Searching
412 [frame="none",grid="none",cols="25<m,75<"]
413 |=============================================================================
414 |search                 |Search the view
415 |search-back            |Search backwards in the view
416 |find-next              |Find next search match
417 |find-prev              |Find previous search match
418 |=============================================================================
420 .Misc
421 [frame="none",grid="none",cols="25<m,75<"]
422 |=============================================================================
423 |prompt                 |Bring up the prompt
424 |screen-redraw          |Redraw the screen
425 |screen-resize          |Resize the screen
426 |show-version           |Show version information
427 |stop-loading           |Stop all loading views
428 |options                |Open options menu
429 |toggle-lineno          |Toggle line numbers
430 |toggle-date            |Toggle date display
431 |toggle-author          |Toggle author display
432 |toggle-filename        |Toggle file name display
433 |toggle-rev-graph       |Toggle revision graph visualization
434 |toggle-graphic         |Toggle (line) graphics mode
435 |toggle-refs            |Toggle reference display
436 |edit                   |Open in editor
437 |none                   |Do nothing
438 |=============================================================================
441 Color command
442 -------------
444 Color commands control highlighting and the user interface styles. If your
445 terminal supports color, these commands can be used to assign foreground and
446 background combinations to certain areas. Optionally, an attribute can be
447 given as the last parameter. The syntax is:
449 [verse]
450 *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
452 Examples:
454 ------------------------------------------------------------------------------
455 # Override the default terminal colors to white on black.
456 color default           white   black
457 # Diff colors
458 color diff-header       yellow  default
459 color diff-index        blue    default
460 color diff-chunk        magenta default
461 color "Reported-by:"    green   default
462 --------------------------------------------------------------------------
464 Or in the git configuration files:
466 --------------------------------------------------------------------------
467 [tig "color"]
468         # A strange looking cursor line
469         cursor          red     default underline
470         # UI colors
471         title-blur      white   blue
472         title-focus     white   blue    bold
473 ------------------------------------------------------------------------------
475 Area names::
477         Can be either a built-in area name or a custom quoted string. The
478         latter allows custom color rules to be added for lines matching a
479         quoted string.
480         Valid built-in area names are described below. Note, all names are
481         case-insensitive, and you may use '-', '_', and '.' interchangeably,
482         e.g. "Diff-Header", "DIFF_HEADER", and "diff.header" are the same.
484 Color names::
486         Valid colors include: *white*, *black*, *green*, *magenta*, *blue*,
487         *cyan*, *yellow*, *red*, *default*. Use *default* to refer to the
488         default terminal colors. This is recommended for background colors if
489         you are using a terminal with a transparent background.
491 Colors can also be specified using the keywords color0, color1, ..., colorN-1
492 (N being the number of colors supported by your terminal). This is useful when
493 you remap the colors for your display or want to enable colors supported by
494 256-color terminals.
496 Attribute names::
498         Valid attributes include: *normal*, *blink*, *bold*, *dim*, *reverse*,
499         *standout*, and *underline*. Note, not all attributes may be supported
500         by the terminal.
502 UI colors
503 ~~~~~~~~~
505 The colors and attributes to be used for the text that is not highlighted or
506 that specify the use of the default terminal colors can be controlled by
507 setting the *default* color option.
509 .General
510 [frame="none",grid="none",cols="25<m,75<"]
511 |=============================================================================
512 |default                |Override default terminal colors (see above).
513 |cursor                 |The cursor line.
514 |status                 |The status window showing info messages.
515 |title-focus            |The title window for the current view.
516 |title-blur             |The title window of any backgrounded view.
517 |delimiter              |Delimiter shown for truncated lines.
518 |line-number            |Line numbers.
519 |id                     |The commit ID.
520 |date                   |The commit date.
521 |author                 |The commit author.
522 |mode                   |The file mode holding the permissions and type.
523 |=============================================================================
525 .Main view colors
526 [frame="none",grid="none",cols="25<m,75<"]
527 |=============================================================================
528 |graph-commit           |The commit dot in the revision graph.
529 |palette-[0-6]          |7 different colors,
530 used for distinguishing branches or commits.
531 example: palette-0 = red
532 |main-commit            |The commit comment.
533 |main-head              |Label of the current branch.
534 |main-remote            |Label of a remote.
535 |main-tracked           |Label of the remote tracked by the current branch.
536 |main-tag               |Label of a signed tag.
537 |main-local-tag         |Label of a local tag.
538 |main-ref               |Label of any other reference.
539 |=============================================================================
541 .Status view
542 [frame="none",grid="none",cols="25<m,75<"]
543 |=============================================================================
544 |stat-head              |The "On branch"-line.
545 |stat-section           |Status section titles,
546 |stat-staged            |Status flag of staged files.
547 |stat-unstaged          |Status flag of unstaged files.
548 |stat-untracked         |Status flag of untracked files.
549 |=============================================================================
551 .Tree view
552 [frame="none",grid="none",cols="25<m,75<"]
553 |=============================================================================
554 |tree-head              |The "Directory /"-line
555 |tree-dir               |The directory name.
556 |tree-file              |The file name.
557 |=============================================================================
559 Highlighting
560 ~~~~~~~~~~~~
564 Diff markup::
566 Options concerning diff start, chunks and lines added and deleted.
568 *diff-header*, *diff-chunk*, *diff-add*, *diff-del*
570 Enhanced git diff markup::
572 Extra diff information emitted by the git diff machinery, such as mode
573 changes, rename detection, and similarity.
575 *diff-oldmode*, *diff-newmode*, *diff-copy-from*, *diff-copy-to*,
576 *diff-rename-from*, *diff-rename-to*, *diff-deleted-file-mode*,
577 *diff-similarity*, *diff-dissimilarity* *diff-tree*, *diff-index*, *diff-stat*
579 Pretty print commit headers::
581 Commit diffs and the revision logs are usually formatted using pretty printed
582 headers , unless `--pretty=raw` was given. This includes lines, such as merge
583 info, commit ID, and author and committer date.
585 *pp-author*, *pp-commit*, *pp-merge*, *pp-date*, *pp-adate*, *pp-cdate*,
586 *pp-refs*
588 Raw commit header::
590 Usually shown when `--pretty=raw` is given, however 'commit' is pretty much
591 omnipresent.
593 *commit*, *parent*, *tree*, *author*, *committer*
595 Commit message::
597 `Signed-off-by`, `Acked-by`, `Reviewed-by` and `Tested-by` lines are colorized.
599 *signoff*, *acked*, *reviewed*, *tested*
601 Tree markup::
603 Colors for information of the tree view.
605 *tree-dir*, *tree-file*
609 Source command
610 -------------
612 Source commands make it possible to read additional configuration files.
613 Sourced files are included in-place, meaning when a 'source' command is
614 encountered the file will be immediately read. Any commands later in the
615 current configuration file will take precedence. The syntax is:
617 [verse]
618 *source* 'path'
620 Examples:
622 ------------------------------------------------------------------------------
623 source ~/.tig/colorscheme.tigrc
624 source ~/.tig/keybindings.tigrc
625 --------------------------------------------------------------------------
627 COPYRIGHT
628 ---------
629 Copyright (c) 2006-2012 Jonas Fonseca <fonseca@diku.dk>
631 This program is free software; you can redistribute it and/or modify
632 it under the terms of the GNU General Public License as published by
633 the Free Software Foundation; either version 2 of the License, or
634 (at your option) any later version.
636 SEE ALSO
637 --------
638 manpage:tig[1], manpage:tigmanual[7], git-config(1),
639 and the http://jonas.nitro.dk/tig/manual.html[tig manual].