Make view columns configurable
[tig.git] / doc / tigrc.5.adoc
blob35bee683dc85405a27a0ff247b0cbde0ee05f5ef
1 tigrc(5)
2 ========
3 :docext: adoc
5 NAME
6 ----
7 tigrc - Tig configuration file
10 SYNOPSIS
11 --------
12 [verse]
13 _______________________________________________________________________
14 *set*   'variable' *=* 'value'
15 *bind*  'keymap' 'key' 'action'
16 *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
17 *source* 'path'
18 _______________________________________________________________________
21 DESCRIPTION
22 -----------
24 You can permanently set an option by putting it in the `~/.tigrc` file.  The
25 file consists of a series of 'commands'.  Each line of the file may contain
26 only one command.
28 The hash mark ('#') is used as a 'comment' character. All text after the
29 comment character to the end of the line is ignored. You can use comments to
30 annotate your initialization file.
32 Git configuration
33 -----------------
35 Alternatively to using `~/.tigrc`, Tig options can be set by putting them in
36 one of the Git configuration files, which are read by Tig on startup. See
37 'git-config(1)' for which files to use. The following example show the basic
38 syntax to use for settings, bindings and colors.
40 --------------------------------------------------------------------------
41 [tig] show-rev-graph = true
42 [tig "color"] cursor = yellow red bold 
43 [tig "bind"] generic = P parent
44 --------------------------------------------------------------------------
46 In addition to tig-specific options, the following Git options are read from
47 the Git configuration:
49 'color.*'::
51         Colors for the various UI types. Can be completely disabled by setting
52         'read-git-colors'.
54 'core.abbrev'::
56         The width of the commit ID. See also 'id-width' option.
58 'core.editor'::
60         The editor command. Can be overridden by setting GIT_EDITOR.
62 'core.worktree'::
64         The path to the root of the working tree.
66 'gui.encoding'::
68         The encoding to use for displaying of file content.
70 'i18n.commitencoding'::
72         The encoding used for commits. The default is UTF-8.
74 Set command
75 -----------
77 A few selective variables can be configured via the set command. The syntax
78 is:
80 [verse]
81 *set* variables *=* value
83 Examples:
85 --------------------------------------------------------------------------
86 set commit-order = topo         # Order commits topologically
87 set read-git-colors = no        # Do not read Git's color settings.
88 set horizontal-scroll = 33%     # Scroll 33% of the view width
89 set blame-options = -C -C -C    # Blame lines from other files
91 # Wrap branch names with () and tags with <>
92 set reference-format = (branch) <tag>
94 # Configure blame view columns
95 set blame-view = date:default author:abbreviated file-name:auto id:yes,color line-number:yes,interval=5 text
96 --------------------------------------------------------------------------
98 Or in the Git configuration files:
100 --------------------------------------------------------------------------
101 [tig]
102         line-graphics = no      # Disable graphics characters
103         tab-size = 8            # Number of spaces per tab
104 --------------------------------------------------------------------------
106 The type of variables is either bool, int, string, or mixed.
108 Valid bool values::
110         To set a bool variable to true use either "1", "true", or "yes".
111         Any other value will set the variable to false.
113 Valid int values::
115         A non-negative integer.
117 Valid string values::
119         A string of characters. Optionally, use either ' or " as delimiters.
121 Valid mixed values::
123         These values are composites of the above types. The valid values are
124         specified in the description.
126 Variables
127 ~~~~~~~~~
129 The following variables can be set:
131 'diff-options' (string)::
133         A space separated string of diff options to use in the diff view.
134         git-show(1) is used for formatting and always passes --patch-with-stat.
135         This option overrides any options specified in the TIG_DIFF_OPTS
136         environment variable (described in manpage:tig[1]), but is itself
137         overridden by diff flags given on the command line invocation.
139 'blame-options' (string)::
141         A space separated string of extra blame options. Can be used for
142         telling git-blame(1) how to detect the origin of lines. The value
143         is ignored when Tig is started in blame mode and given blame options
144         on the command line.
146 'reference-format' (string)::
148         A space separated string of format strings used for formatting reference
149         names. Wrap the name of the reference type with the characters you would
150         like to use for formatting, e.g. `[tag]` and `<remote>`. If no format is
151         specified for `local-tag`, the format for `tag` is used. Similarly, if no
152         format is specified for `tracked-remote` the `remote` format is used.
153         Prefix with `hide:` to not show that reference type, e.g. `hide:remote`.
154         Supported reference types are:
155          - head                 : The current HEAD.
156          - tag                  : A signed tag.
157          - local-tag            : An unsigned tag.
158          - remote               : A remote.
159          - tracked-remote       : The remote tracked by current HEAD.
160          - replace              : A replaced reference.
161          - branch               : Any other reference.
163 'line-graphics' (mixed) [ "ascii" | "default" | "utf-8" | bool]::
165         What type of character graphics for line drawing.
167 'horizontal-scroll' (mixed)::
169         Interval to scroll horizontally in each step. Can be specified either
170         as the number of columns, e.g. '5', or as a percentage of the view
171         width, e.g. '33%', where the maximum is 100%. For percentages it is
172         always ensured that at least one column is scrolled. The default is to
173         scroll '50%' of the view width.
175 'mouse-scroll' (int)::
176         Interval to scroll up or down using the mouse. The default is 3 lines.
177         Mouse support requires that ncurses itself support mouse events and that
178         you have enabled mouse support in ~/.tigrc with `set mouse = true`.
180 'read-git-colors' (bool)::
182         Whether to read Git's color settings. True by default.
184 'show-notes' (mixed) [note reference | bool]::
186         Whether to show notes for a commit. When set to a note reference the
187         reference is passed to `git show --notes=`. Notes are enabled by
188         default.
190 'show-changes' (bool)::
192         Whether to show staged and unstaged changes in the main view.
194 'vertical-split' (mixed) ["auto" | bool]::
196         Whether to split the view horizontally or vertically.
197         "auto" (which is the default) means that it will depend on the window
198         dimensions. When true vertical orientation is used, and false sets the
199         orientation to horizontal.
201 'split-view-height' (mixed)::
203         Height of the lower view in a split view. Can be specified either as
204         the number of rows, e.g. '5', or as a percentage of the view height,
205         e.g. '80%', where the maximum is 100%. It is always ensured that the
206         smaller of the views is at least four rows high. The default is a view
207         height of '66%'.
209 'status-untracked-dirs' (bool)::
211         Show untracked directories contents in the status view (analog to
212         `git ls-files --directory` option). On by default.
214 'tab-size' (int)::
216         Number of spaces per tab. The default is 8 spaces.
218 'diff-context' (int)::
220         Number of context lines to show for diffs.
222 'ignore-space' (mixed) ["no" | "all" | "some" | "at-eol" | bool]::
224     Ignore space changes in diff view. By default no space changes are ignored.
225     Changing this to "all", "some" or "at-eol" is equivalent to passing
226     "--ignore-all-space", "--ignore-space" or "--ignore-space-at-eol"
227     respectively to `git diff` or `git show`.
229 'commit-order' (mixed) ["default" | "topo" | "date" | "reverse" | bool]::
231         Commit ordering using the default (chronological reverse) order,
232         topological order, date order or reverse order. The default order is
233         used when the option is set to false, and topo order when set to true.
235 'ignore-case' (bool)::
237         Ignore case in searches. By default, the search is case sensitive.
239 'wrap-lines' (bool)::
241         Wrap long lines. By default, lines are not wrapped.
242         Not compatible with line numbers enabled.
244 'focus-child' (bool)::
246         Whether to focus the child view when it is opened. When disabled the
247         focus will remain in the parent view, avoiding reloads of the child
248         view when navigating the parent view. True by default.
250 'editor-line-number' (bool)::
252         Whether to pass the selected line number to the editor command. The
253         line number is passed as `+<line-number>` in front of the file name.
254         Example: `vim +10 tig.c`
256 'mouse' (bool)::
257         Whether to enable mouse support. Off by default since it makes selecting
258         text from the terminal less intuitive. When enabled hold down Shift (or
259         Option on Mac) to select text. Mouse support requires that ncurses
260         itself support mouse events.
262 View settings
263 ~~~~~~~~~~~~~
265 The view settings, e.g. `blame-view`, can be used to configure the order and
266 settings for the different columns of a view. Each view option expects a space
267 separated list of column specifications. Column specifications first give the
268 column type, and can optionally be followed by a colon (`:`) and a list of
269 column settings, e.g.  `author:full,width=20`. The first setting value is always
270 the 'show' setting. When no 'show' setting value is given, 'yes' is assumed,
271 which for 'show' settings taking an enumerated value will automatically resolve
272 to the default enum value. For example, `file-name` will automatically have its
273 'show' setting resolve to 'auto'.
275 The following list shows which the available view options and what column types
276 they support:
278 blob-view, diff-view, log-view, pager-view, stage-view::
280         *line-number*, *text*
282 blame-view::
284         *author*, *date*, *file-name*, *id*, *line-number*, *text*
286 grep-view::
288         *file-name*, *line-number*, *text*
290 main-view::
292         *author*, *date*, *commit-title*, *id*, *line-number*
294 refs-view::
296         *author*, *date*, *commit-title*, *id*, *line-number*, *ref*
298 stash-view::
300         *author*, *date*, *commit-title*, *id*, *line-number*
302 tree-view::
304         *author*, *date*, *id*, *file-name*, *file-size*, *line-number*, *mode*
306 Supported column types and their respective settings:
308 *author*::
310         - 'show' (mixed) [full|abbreviated|email|email-user|<bool>]: How to
311           display author names. If set to "abbreviated" author initials will be
312           shown.
313         - 'width' (int): Width of the column. When set to 5 or below, the author
314           name will be abbreviated to the author's initials.  When set to zero,
315           the width is automatically sized to fit the content.
317 *commit-title*::
318         - 'graph' (bool): Whether to show revision graph in the main view on
319           start-up. See also the 'line-graphics' options.
320         - 'refs' (bool): Whether to show references (branches, tags, and
321           remotes) in the main view. Can be toggled.
322         - 'overflow' (bool or int): Whether to highlight text in commit titles
323           exceeding a given width. When set to a boolean, it enables or disables
324           the highlighting using the default width of 50 character. When set to
325           an int, the assigned value is used as the maximum character width.
327 *date*::
328         - 'show' (mixed) [relative|short|default|local|<bool>]: Whether and how
329           to show date. If set to "relative" a relative date will be used, e.g.
330           "2 minutes ago". If set to "short" no time information is shown. If
331           set to "local", localtime(3) is used.
332         - 'width' (int): Width of the column. When set to zero, the width is
333           automatically sized to fit the content.
335 *file-name*::
336         - 'show' (mixed) [no|auto|always|bool]: When to display file names. If
337           set to "auto" file names are shown only when needed, e.g. when
338           running: tig blame -C <file>.
339         - 'width' (int): Width of the column. When set to zero, the width is
340           automatically sized to fit the content.
342 *file-size*::
344         - 'show' (mixed) [default|units|<bool>]: How to display file sizes. When
345           set to "units", sizes are shown using binary prefixes, e.g. 12524
346           bytes is shown as "12.2K".
347         - 'width' (int): Width of the filename column. When set to zero, the
348           width is automatically sized to fit the content.
350 *id*::
351         - 'show' (bool): Whether to show commit IDs in the main view.
352         - 'width' (int) : Width of the commit ID. When unset Tig will use the
353           value of 'core.abbrev' if found. See git-config(1) on how to set
354           'core.abbrev'. When set to zero the width is automatically sized to
355           fit the content of reflog (e.g.  `ref/stash@{4}`) IDs and otherwise
356           default to 7.
358 *line-number*::
359         - 'show' (bool): Whether to show line numbers.
360         - 'interval' (int): Interval between line numbers.
361         - 'width' (int): Width of the column. When set to zero, the width is
362           automatically sized to fit the content.
364 *mode*::
365         - 'show' (bool): Whether to show file modes.
366         - 'width' (int): Width of the column. When set to zero, the width is
367           automatically sized to fit the content.
369 *ref*::
370         - 'show' (bool): Whether to show the reference name.
371         - 'width' (int): Width of the column. When set to zero, the width is
372           automatically sized to fit the content.
374 *text*::
375         - 'commit-title-overflow' (bool or int): Whether to highlight commit
376           titles exceeding a given width in the diff view. When set to a
377           boolean, it enables or disables the highlighting using the default
378           width of 50 character. When set to an int, the assigned value is used
379           as the maximum character width.
381 Examples:
382 --------------------------------------------------------------------------
383 # Enable both ID and line numbers in the blame view
384 set blame-view = date:default author:full file-name:auto id:yes,color line-number:yes,interval=5 text
386 # Change grep view to be similar to `git grep` format
387 set grep-view = file-name:yes line-number:yes,interval=1 text
389 # Show file sizes as units
390 set tree-view = line-number:no,interval=5 mode author:full file-size:units date:default id:no file-name
392 # Show line numbers for every 10th line in the pager view
393 set pager-view = line-number:yes,interval=10 text
394 --------------------------------------------------------------------------
396 Note that all column options can be toggled. For 'show' options, use the
397 option name as the prefix followed by a dash and the column name. E.g.
398 `:toggle show-author` will toggle the 'show' option in the 'author'
399 column. For all other options use the column name followed by a dash and
400 then the option name as the suffix. E.g. `:toggle commit-title-graph`
401 will toggle the 'graph' option in the 'commit-title' column.
403 Bind command
404 ------------
406 Using bind commands, keys can be mapped to an action when pressed in a given
407 key map. The syntax is:
409 [verse]
410 *bind* 'keymap' 'key' 'action'
412 Examples:
414 --------------------------------------------------------------------------
415 # Add keybinding to quickly jump to the next diff chunk in the stage view
416 bind stage Enter :/^@@
418 # Disable the default mapping for running git-gc
419 bind generic G none
421 # User-defined external command to amend the last commit
422 bind status + !git commit --amend
424 # User-defined internal command that reloads ~/.tigrc
425 bind generic S :source ~/.tigrc
427 # UTF8-encoded characters can be used as key values.
428 bind generic Ã¸ @sh -c "printf '%s' %(commit) | pbcopy"
429 --------------------------------------------------------------------------
431 Or in the Git configuration files:
433 --------------------------------------------------------------------------
434 [tig "bind"]
435         # 'unbind' the default quit key binding
436         main = Q none
437         # Cherry-pick current commit onto current branch
438         generic = C !git cherry-pick %(commit)
439 --------------------------------------------------------------------------
441 Keys are mapped by first searching the keybindings for the current view, then
442 the keybindings for the *generic* keymap, and last the default keybindings.
443 Thus, the view keybindings override the generic keybindings which override the
444 built-in keybindings.
448 Keymaps::
450 Valid keymaps are: *main*, *diff*, *log*, *help*, *pager*, *status*, *stage*,
451 *tree*, *blob*, *blame*, *refs*, *stash*, *grep* and *generic*. Use *generic*
452 to set key mapping in all keymaps.
454 Key values::
456 Key values should never be quoted. Use either an ASCII or UTF8-encoded character
457 or one of the following symbolic key names. Symbolic key names are case
458 insensitive. Use *Hash* to bind to the `#` key, since the hash mark is used as a
459 comment character.
461 *Enter*, *Space*, *Backspace*, *Tab*, *Escape*, *Left*, *Right*, *Up*, *Down*,
462 *Insert*, *Delete*, *Hash*, *Home*, *End*, *PageUp*, *PageDown*, *F1*, *F2*, *F3*,
463 *F4*, *F5*, *F6*, *F7*, *F8*, *F9*, *F10*, *F11*, *F12*.
465 To add a key mapping that uses the `Ctrl` key, use a `^` prefix in your mapping.
466 Similarly, use `^[` to map to keys prefixed by the `Escape` key. Examples:
468 --------------------------------------------------------------------------
469 bind main ^f  scroll-page-down
470 bind main ^[o options
471 --------------------------------------------------------------------------
473 Note that due to the way ncurses encodes `Ctrl` key mappings, `Ctrl-m` and
474 `Ctrl-i` cannot be bound as they conflict with 'Enter' and 'Tab' respectively.
475 Furthermore, ncurses does not allow to distinguish between `Ctrl-f` and
476 `Ctrl-F`. Finally, `Ctrl-z` is automatically used for process control and will
477 suspend Tig and open a subshell (use `fg` to reenter Tig).
479 Actions::
481 Actions are either specified as user-defined commands (external or internal) or
482 using action names as described in the following sections.
486 External user-defined command
487 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
489 These actions start with one or more of the following option flags followed by
490 the command that should be executed.
492 [frame="none",grid="none",cols="25<m,75<"]
493 |=============================================================================
494 |!                      |Run the command in the foreground with output shown.
495 |@                      |Run the command in the background with no output.
496 |?                      |Prompt the user before executing the command.
497 |<                      |Exit Tig after executing the command.
498 |=============================================================================
500 Unless otherwise specified, commands are run in the foreground with their
501 console output shown (as if '!' was specified). When multiple command options
502 are specified their behavior are combined, e.g. "?<git commit" will prompt the
503 user whether to execute the command and will exit Tig after completion.
505 Browsing state variables
506 ^^^^^^^^^^^^^^^^^^^^^^^^
508 User-defined commands can optionally refer to Tig's internal state using the
509 following variable names, which are substituted before commands are run:
511 [frame="none",grid="none",cols="25<m,75<"]
512 |=============================================================================
513 |%(head)                |The currently viewed 'head' ID. Defaults to HEAD
514 |%(commit)              |The currently selected commit ID.
515 |%(blob)                |The currently selected blob ID.
516 |%(branch)              |The currently selected branch name.
517 |%(stash)               |The currently selected stash name.
518 |%(directory)           |The current directory path in the tree view;
519                          empty for the root directory.
520 |%(file)                |The currently selected file.
521 |%(ref)                 |The reference given to blame or HEAD if undefined.
522 |%(revargs)             |The revision arguments passed on the command line.
523 |%(fileargs)            |The file arguments passed on the command line.
524 |%(cmdlineargs)         |All other options passed on the command line.
525 |%(diffargs)            |The diff options from 'diff-options' or 'TIG_DIFF_OPTS'
526 |%(prompt)              |Prompt for the argument value. Optionally specify a
527                          custom prompt using `"%(prompt Enter branch name: )"`
528 |=============================================================================
530 Examples:
532 --------------------------------------------------------------------------
533 # Save save the current commit as a patch file when the user selects a
534 # commit in the main view and presses 'S'.
535 bind main S !git format-patch -1 %(commit)
537 # Create and checkout a new branch; specify custom prompt
538 bind main B ?git checkout -b "%(prompt Enter new branch name: )"
539 --------------------------------------------------------------------------
541 Advanced shell-like commands
542 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
544 If your command requires use of dynamic features, such as subshells,
545 expansion of environment variables and process control, this can be achieved by
546 using a shell command:
548 .Configure a binding to copy the current commit ID to the clipboard.
549 --------------------------------------------------------------------------
550 bind generic I @sh -c "echo -n %(commit) | xclip -selection c"
551 --------------------------------------------------------------------------
553 Or by using a combination of Git aliases and Tig external commands. The
554 following example entries can be put in either the .gitconfig or .git/config
555 file:
557 .Git configuration which binds Tig keys to Git command aliases.
558 --------------------------------------------------------------------------
559 [alias]
560         gitk-bg = !"gitk HEAD --not $(git rev-parse --remotes) &"
561         publish = !"for i in origin public; do git push $i; done"
562 [tig "bind"]
563         # @-prefix means that the console output will not be shown.
564         generic = V !@git gitk-bg
565         generic = > !git publish
566 --------------------------------------------------------------------------
568 Internal user-defined commands
569 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
571 Actions beginning with a ':' will be run and interpreted as internal commands
572 and act similar to commands run via Tig's prompt. Valid internal commands are
573 configuration file options (as described in this document) and pager view
574 commands. Examples:
576 --------------------------------------------------------------------------
577 # Reload ~/.tigrc when 'S' is pressed
578 bind generic S :source .tigrc
580 # Change diff view to show all commit changes regardless of file limitations
581 bind diff F :set diff-options = --full-diff
583 # Show the output of git-reflog(1) in the pager view
584 bind generic W :!git reflog
586 # Search for previous diff (c)hunk and next diff header
587 bind stage 2 :?^@@
588 bind stage D :/^diff --(git|cc)
590 bind main I :toggle show-id                     # Show/hide the ID column
591 bind diff D :toggle diff-options --minimal      # Use minimal diff algorithm
592 bind diff [ :toggle diff-context -3             # Decrese context (-U arg)
593 bind diff ] :toggle diff-context +3             # Increase context
594 bind generic V :toggle split-view-height -10%   # Decrease split height
595 --------------------------------------------------------------------------
597 Similar to external commands, pager view commands can contain variable names
598 that will be substituted before the command is run.
600 Action names
601 ~~~~~~~~~~~~
603 Valid action names are described below. Note, all action names are
604 case-insensitive, and you may use '-', '_', and '.' interchangeably, e.g.
605 "view-main", "View.Main", and "VIEW_MAIN" are the same.
607 ifndef::DOC_GEN_ACTIONS[]
608 View switching
609 ^^^^^^^^^^^^^^
611 [frame="none",grid="none",cols="25<m,75<"]
612 |=============================================================================
613 |view-main               |Show main view
614 |view-diff               |Show diff view
615 |view-log                |Show log view
616 |view-tree               |Show tree view
617 |view-blob               |Show blob view
618 |view-blame              |Show blame view
619 |view-refs               |Show refs view
620 |view-status             |Show status view
621 |view-stage              |Show stage view
622 |view-stash              |Show stash view
623 |view-grep               |Show grep view
624 |view-pager              |Show pager view
625 |view-help               |Show help view
626 |=============================================================================
628 View manipulation
629 ^^^^^^^^^^^^^^^^^
631 [frame="none",grid="none",cols="25<m,75<"]
632 |=============================================================================
633 |enter                   |Enter and open selected line
634 |back                    |Go back to the previous view state
635 |next                    |Move to next
636 |previous                |Move to previous
637 |parent                  |Move to parent
638 |view-next               |Move focus to the next view
639 |refresh                 |Reload and refresh view
640 |maximize                |Maximize the current view
641 |view-close              |Close the current view
642 |quit                    |Close all views and quit
643 |=============================================================================
645 View specific actions
646 ^^^^^^^^^^^^^^^^^^^^^
648 [frame="none",grid="none",cols="25<m,75<"]
649 |=============================================================================
650 |status-update           |Stage/unstage chunk or file changes
651 |status-revert           |Revert chunk or file changes
652 |status-merge            |Merge file using external tool
653 |stage-update-line       |Stage/unstage single line
654 |stage-split-chunk       |Split current diff chunk
655 |=============================================================================
657 Cursor navigation
658 ^^^^^^^^^^^^^^^^^
660 [frame="none",grid="none",cols="25<m,75<"]
661 |=============================================================================
662 |move-up                 |Move cursor one line up
663 |move-down               |Move cursor one line down
664 |move-page-down          |Move cursor one page down
665 |move-page-up            |Move cursor one page up
666 |move-first-line         |Move cursor to first line
667 |move-last-line          |Move cursor to last line
668 |=============================================================================
670 Scrolling
671 ^^^^^^^^^
673 [frame="none",grid="none",cols="25<m,75<"]
674 |=============================================================================
675 |scroll-line-up          |Scroll one line up
676 |scroll-line-down        |Scroll one line down
677 |scroll-page-up          |Scroll one page up
678 |scroll-page-down        |Scroll one page down
679 |scroll-first-col        |Scroll to the first line columns
680 |scroll-left             |Scroll two columns left
681 |scroll-right            |Scroll two columns right
682 |=============================================================================
684 Searching
685 ^^^^^^^^^
687 [frame="none",grid="none",cols="25<m,75<"]
688 |=============================================================================
689 |search                  |Search the view
690 |search-back             |Search backwards in the view
691 |find-next               |Find next search match
692 |find-prev               |Find previous search match
693 |=============================================================================
695 Option manipulation
696 ^^^^^^^^^^^^^^^^^^^
698 In addition to the actions below, options can also be toggled with the
699 `:toggle` prompt command.
701 [frame="none",grid="none",cols="25<m,75<"]
702 |=============================================================================
703 |options                 |Open the options menu
704 |=============================================================================
706 Misc
707 ^^^^
709 [frame="none",grid="none",cols="25<m,75<"]
710 |=============================================================================
711 |edit                    |Open in editor
712 |prompt                  |Open the prompt
713 |screen-redraw           |Redraw the screen
714 |stop-loading            |Stop all loading views
715 |show-version            |Show version information
716 |none                    |Do nothing
717 |=============================================================================
718 endif::DOC_GEN_ACTIONS[]
720 Color command
721 -------------
723 Color commands control highlighting and the user interface styles. If your
724 terminal supports color, these commands can be used to assign foreground and
725 background combinations to certain areas. Optionally, an attribute can be
726 given as the last parameter. The syntax is:
728 [verse]
729 *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
731 Examples:
733 ------------------------------------------------------------------------------
734 # Override the default terminal colors to white on black.
735 color default           white   black
736 # Diff colors
737 color diff-header       yellow  default
738 color diff-index        blue    default
739 color diff-chunk        magenta default
740 color "Reported-by:"    green   default
741 # View specific color
742 color tree.date         black   cyan    bold
743 --------------------------------------------------------------------------
745 Or in the Git configuration files:
747 --------------------------------------------------------------------------
748 [tig "color"]
749         # A strange looking cursor line
750         cursor          = red   default underline
751         # UI colors
752         title-blur      = white blue
753         title-focus     = white blue    bold
754 # View specific color
755 [tig "color.tree"]
756         date            = cyan  default bold
757 ------------------------------------------------------------------------------
759 Area names::
761         Can be either a built-in area name or a custom quoted string. The
762         latter allows custom color rules to be added for lines matching a
763         quoted string.
764         Valid built-in area names are described below. Note, all names are
765         case-insensitive, and you may use '-', and '_' interchangeably,
766         e.g. "Diff-Header" and "DIFF_HEADER" are the same.
767         View specific colors can be defined by prefixing the view name to
768         the area name, e.g. "stage.diff-chunk" and "diff.diff-chunk".
770 Color names::
772         Valid colors include: *white*, *black*, *green*, *magenta*, *blue*,
773         *cyan*, *yellow*, *red*, *default*. Use *default* to refer to the
774         default terminal colors, for example, to keep the background
775         transparent when you are using a terminal with a transparent
776         background.
778 Colors can also be specified using the keywords *color0*, *color1*, ...,
779 *colorN-1* (where *N* is the number of colors supported by your terminal).
780 This is useful when you remap the colors for your display or want to enable
781 colors supported by 88-color and 256-color terminals. Note that the 'color'
782 prefix is optional. If you prefer, you can specify colors directly by their
783 numbers *0*, *1*, ..., *N-1* instead, just like in the configuration file of
784 Git.
786 Attribute names::
788         Valid attributes include: *normal*, *blink*, *bold*, *dim*, *reverse*,
789         *standout*, and *underline*. Note, not all attributes may be supported
790         by the terminal.
792 UI colors
793 ~~~~~~~~~
795 The colors and attributes to be used for the text that is not highlighted or
796 that specify the use of the default terminal colors can be controlled by
797 setting the *default* color option.
799 .General
800 [frame="none",grid="none",cols="25<m,75<"]
801 |=============================================================================
802 |default                |Override default terminal colors (see above).
803 |cursor                 |The cursor line.
804 |status                 |The status window showing info messages.
805 |title-focus            |The title window for the current view.
806 |title-blur             |The title window of any backgrounded view.
807 |delimiter              |Delimiter shown for truncated lines.
808 |line-number            |Line numbers.
809 |id                     |The commit ID.
810 |date                   |The commit date.
811 |author                 |The commit author.
812 |mode                   |The file mode holding the permissions and type.
813 |overflow               |Title text overflow.
814 |filename               |Filename.
815 |file-size              |File size.
816 |=============================================================================
818 .Main view colors
819 [frame="none",grid="none",cols="25<m,75<"]
820 |=============================================================================
821 |graph-commit           |The commit dot in the revision graph.
822 |palette-[0-6]          |7 different colors,
823 used for distinguishing branches or commits.
824 example: palette-0 = red
825 |main-commit            |The commit comment.
826 |main-head              |Label of the current branch.
827 |main-remote            |Label of a remote.
828 |main-tracked           |Label of the remote tracked by the current branch.
829 |main-tag               |Label of a signed tag.
830 |main-local-tag         |Label of a local tag.
831 |main-ref               |Label of any other reference.
832 |main-replace           |Label of replaced reference.
833 |=============================================================================
835 .Status view
836 [frame="none",grid="none",cols="25<m,75<"]
837 |=============================================================================
838 |stat-head              |The "On branch"-line.
839 |stat-section           |Status section titles,
840 |stat-none              |Empty status label.
841 |stat-staged            |Status flag of staged files.
842 |stat-unstaged          |Status flag of unstaged files.
843 |stat-untracked         |Status flag of untracked files.
844 |=============================================================================
846 .Tree view
847 [frame="none",grid="none",cols="25<m,75<"]
848 |=============================================================================
849 |tree-head              |The "Directory /"-line
850 |tree-dir               |The directory name.
851 |tree-file              |The file name.
852 |=============================================================================
854 .Help view
855 [frame="none",grid="none",cols="25<m,75<"]
856 |=============================================================================
857 |help-keymap            |Keymap name.
858 |help-group             |Help group name.
859 |help-action            |Help action name.
860 |=============================================================================
862 Highlighting
863 ~~~~~~~~~~~~
867 Diff markup::
869 Options concerning diff start, chunks and lines added and deleted.
871 *diff-header*, *diff-chunk*, *diff-add*, *diff-add2*, *diff-del*,
872 *diff-del2*
874 Enhanced Git diff markup::
876 Extra diff information emitted by the Git diff machinery, such as mode
877 changes, rename detection, and similarity.
879 *diff-oldmode*, *diff-newmode*, *diff-copy-from*, *diff-copy-to*,
880 *diff-similarity*, *diff-index*
882 Pretty print commit headers::
884 Commit diffs and the revision logs are usually formatted using pretty printed
885 headers , unless `--pretty=raw` was given. This includes lines, such as merge
886 info, commit ID, and author and committer date.
888 *pp-refs*, *pp-reflog*, *pp-reflogmsg*, *pp-merge*
890 Raw commit header::
892 Usually shown when `--pretty=raw` is given, however 'commit' is pretty much
893 omnipresent.
895 *commit*, *parent*, *tree*, *author*, *committer*
897 Commit message::
899 `Signed-off-by`, `Acked-by`, `Reviewed-by` and `Tested-by` lines are colorized.
900 Characters in the commit title exceeding a predefined width can be highlighted.
903 Tree markup::
905 Colors for information of the tree view.
907 *tree-dir*, *tree-file*
911 Source command
912 -------------
914 Source commands make it possible to read additional configuration files.
915 Sourced files are included in-place, meaning when a 'source' command is
916 encountered the file will be immediately read. Any commands later in the
917 current configuration file will take precedence. The syntax is:
919 [verse]
920 *source* 'path'
922 Examples:
924 --------------------------------------------------------------------------
925 source ~/.tig/colorscheme.tigrc
926 source ~/.tig/keybindings.tigrc
927 --------------------------------------------------------------------------
929 COPYRIGHT
930 ---------
931 Copyright (c) 2006-2014 Jonas Fonseca <jonas.fonseca@gmail.com>
933 This program is free software; you can redistribute it and/or modify
934 it under the terms of the GNU General Public License as published by
935 the Free Software Foundation; either version 2 of the License, or
936 (at your option) any later version.
938 SEE ALSO
939 --------
940 ifndef::backend-docbook[]
941 link:tig.1.{docext}[tig(1)],
942 link:manual.{docext}[the Tig manual],
943 endif::backend-docbook[]
944 ifdef::backend-docbook[]
945 manpage:tig[1],
946 manpage:tigmanual[7],
947 endif::backend-docbook[]
948 git(7), git-config(1)