Move git color mappings to tigrc
[tig.git] / doc / tigrc.5.adoc
blobb8badaefd0f0d60c7c8b169a84064506ae20cc8e
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.  Commands can span multiple lines if each line is
27 terminated by a backslash ('\') character. 
29 The hash mark ('#') is used as a 'comment' character. All text after the
30 comment character to the end of the line is ignored. You can use comments to
31 annotate your initialization file.
33 Git configuration
34 -----------------
36 Alternatively to using `~/.tigrc`, Tig options can be set by putting them in
37 one of the Git configuration files, which are read by Tig on startup. See
38 'git-config(1)' for which files to use. The following example show the basic
39 syntax to use for settings, bindings and colors.
41 --------------------------------------------------------------------------
42 [tig] show-rev-graph = true
43 [tig "color"] cursor = yellow red bold 
44 [tig "bind"] generic = P parent
45 --------------------------------------------------------------------------
47 In addition to tig-specific options, the following Git options are read from
48 the Git configuration:
50 'color.*'::
52         Colors for the various UI types. Can be configured via the 'git-colors'
53         setting.
55 'core.abbrev'::
57         The width of the commit ID. See also 'id-width' option.
59 'core.editor'::
61         The editor command. Can be overridden by setting GIT_EDITOR.
63 'core.worktree'::
65         The path to the root of the working tree.
67 'gui.encoding'::
69         The encoding to use for displaying of file content.
71 'i18n.commitencoding'::
73         The encoding used for commits. The default is UTF-8.
75 Set command
76 -----------
78 A few selective variables can be configured via the set command. The syntax
79 is:
81 [verse]
82 *set* variables *=* value
84 Examples:
86 --------------------------------------------------------------------------
87 set commit-order = topo         # Order commits topologically
88 set git-colors = no             # Do not read Git's color settings.
89 set horizontal-scroll = 33%     # Scroll 33% of the view width
90 set blame-options = -C -C -C    # Blame lines from other files
92 # Wrap branch names with () and tags with <>
93 set reference-format = (branch) <tag>
95 # Configure blame view columns using command spanning multiple lines.
96 set blame-view = \
97         date:default \
98         author:abbreviated \
99         file-name:auto \
100         id:yes,color \
101         line-number:yes,interval=5 text
102 --------------------------------------------------------------------------
104 Or in the Git configuration files:
106 --------------------------------------------------------------------------
107 [tig]
108         line-graphics = no      # Disable graphics characters
109         tab-size = 8            # Number of spaces per tab
110 --------------------------------------------------------------------------
112 The type of variables is either bool, int, string, or mixed.
114 Valid bool values::
116         To set a bool variable to true use either "1", "true", or "yes".
117         Any other value will set the variable to false.
119 Valid int values::
121         A non-negative integer.
123 Valid string values::
125         A string of characters. Optionally, use either ' or " as delimiters.
127 Valid mixed values::
129         These values are composites of the above types. The valid values are
130         specified in the description.
132 Variables
133 ~~~~~~~~~
135 The following variables can be set:
137 'diff-options' (string)::
139         A space separated string of diff options to use in the diff view.
140         git-show(1) is used for formatting and always passes --patch-with-stat.
141         This option overrides any options specified in the TIG_DIFF_OPTS
142         environment variable (described in manpage:tig[1]), but is itself
143         overridden by diff flags given on the command line invocation.
145 'blame-options' (string)::
147         A space separated string of extra blame options. Can be used for
148         telling git-blame(1) how to detect the origin of lines. The value
149         is ignored when Tig is started in blame mode and given blame options
150         on the command line.
152 'reference-format' (string)::
154         A space separated string of format strings used for formatting reference
155         names. Wrap the name of the reference type with the characters you would
156         like to use for formatting, e.g. `[tag]` and `<remote>`. If no format is
157         specified for `local-tag`, the format for `tag` is used. Similarly, if no
158         format is specified for `tracked-remote` the `remote` format is used.
159         Prefix with `hide:` to not show that reference type, e.g. `hide:remote`.
160         Supported reference types are:
161          - head                 : The current HEAD.
162          - tag                  : A signed tag.
163          - local-tag            : An unsigned tag.
164          - remote               : A remote.
165          - tracked-remote       : The remote tracked by current HEAD.
166          - replace              : A replaced reference.
167          - branch               : Any other reference.
169 'line-graphics' (mixed) [ "ascii" | "default" | "utf-8" | bool]::
171         What type of character graphics for line drawing.
173 'horizontal-scroll' (mixed)::
175         Interval to scroll horizontally in each step. Can be specified either
176         as the number of columns, e.g. '5', or as a percentage of the view
177         width, e.g. '33%', where the maximum is 100%. For percentages it is
178         always ensured that at least one column is scrolled. The default is to
179         scroll '50%' of the view width.
181 'mouse-scroll' (int)::
182         Interval to scroll up or down using the mouse. The default is 3 lines.
183         Mouse support requires that ncurses itself support mouse events and that
184         you have enabled mouse support in ~/.tigrc with `set mouse = true`.
186 'git-colors' (list)::
188         A space separated list of "key=value" pairs where the key is a Git color
189         name and the value is a Tig color name, e.g. "branch.current=main-head"
190         and "grep.filename=grep.file". Set to "no" to disable.
192 'show-notes' (mixed) [note reference | bool]::
194         Whether to show notes for a commit. When set to a note reference the
195         reference is passed to `git show --notes=`. Notes are enabled by
196         default.
198 'show-changes' (bool)::
200         Whether to show staged and unstaged changes in the main view.
202 'vertical-split' (mixed) ["auto" | bool]::
204         Whether to split the view horizontally or vertically.
205         "auto" (which is the default) means that it will depend on the window
206         dimensions. When true vertical orientation is used, and false sets the
207         orientation to horizontal.
209 'split-view-height' (mixed)::
211         Height of the lower view in a split view. Can be specified either as
212         the number of rows, e.g. '5', or as a percentage of the view height,
213         e.g. '80%', where the maximum is 100%. It is always ensured that the
214         smaller of the views is at least four rows high. The default is a view
215         height of '66%'.
217 'status-untracked-dirs' (bool)::
219         Show untracked directories contents in the status view (analog to
220         `git ls-files --directory` option). On by default.
222 'tab-size' (int)::
224         Number of spaces per tab. The default is 8 spaces.
226 'diff-context' (int)::
228         Number of context lines to show for diffs.
230 'ignore-space' (mixed) ["no" | "all" | "some" | "at-eol" | bool]::
232     Ignore space changes in diff view. By default no space changes are ignored.
233     Changing this to "all", "some" or "at-eol" is equivalent to passing
234     "--ignore-all-space", "--ignore-space" or "--ignore-space-at-eol"
235     respectively to `git diff` or `git show`.
237 'commit-order' (mixed) [default|topo|date|author-date|reverse|<bool>]::
239         Commit ordering using the default (chronological reverse) order,
240         topological order, date order or reverse order. The default order is
241         used when the option is set to false, and topo order when set to true.
243 'ignore-case' (bool)::
245         Ignore case in searches. By default, the search is case sensitive.
247 'wrap-lines' (bool)::
249         Wrap long lines. By default, lines are not wrapped.
250         Not compatible with line numbers enabled.
252 'focus-child' (bool)::
254         Whether to focus the child view when it is opened. When disabled the
255         focus will remain in the parent view, avoiding reloads of the child
256         view when navigating the parent view. True by default.
258 'editor-line-number' (bool)::
260         Whether to pass the selected line number to the editor command. The
261         line number is passed as `+<line-number>` in front of the file name.
262         Example: `vim +10 tig.c`
264 'mouse' (bool)::
265         Whether to enable mouse support. Off by default since it makes selecting
266         text from the terminal less intuitive. When enabled hold down Shift (or
267         Option on Mac) to select text. Mouse support requires that ncurses
268         itself support mouse events.
270 View settings
271 ~~~~~~~~~~~~~
273 The view settings, e.g. `blame-view`, can be used to configure the order and
274 settings for the different columns of a view. Each view option expects a space
275 separated list of column specifications. Column specifications first give the
276 column type, and can optionally be followed by a colon (`:`) and a list of
277 column settings, e.g. `author:full,width=20`. The first setting value is always
278 the 'display' setting. When no 'display' setting value is given, 'yes' is
279 assumed. For 'display' settings taking an enumerated value this will
280 automatically resolve to the default enum value. For example, `file-name` will
281 automatically have its 'display' setting resolve to 'auto'.
283 The following list shows which the available view options and what column types
284 they support:
286 blob-view, diff-view, log-view, pager-view, stage-view:: line-number, text
287 blame-view:: author, date, file-name, id, line-number, text
288 grep-view:: file-name, line-number, text
289 main-view:: author, date, commit-title, id, line-number
290 refs-view:: author, date, commit-title, id, line-number, ref
291 stash-view:: author, date, commit-title, id, line-number
292 status-view:: file-name, line-number, status
293 tree-view:: author, date, id, file-name, file-size, line-number, mode
295 Supported column types and their respective settings:
297 author::
299         - 'display' (mixed) [full|abbreviated|email|email-user|<bool>]: How to
300           display author names. If set to "abbreviated" author initials will be
301           shown.
302         - 'width' (int): Width of the column. When set to 5 or below, the author
303           name will be abbreviated to the author's initials.  When set to zero,
304           the width is automatically sized to fit the content.
306 commit-title::
307         - 'graph' (bool): Whether to show revision graph in the main view on
308           start-up. See also the 'line-graphics' options.
309         - 'refs' (bool): Whether to show references (branches, tags, and
310           remotes) in the main view. Can be toggled.
311         - 'overflow' (bool or int): Whether to highlight text in commit titles
312           exceeding a given width. When set to a boolean, it enables or disables
313           the highlighting using the default width of 50 character. When set to
314           an int, the assigned value is used as the maximum character width.
316 date::
317         - 'display' (mixed) [relative|short|default|local|<bool>]: How to
318           display dates. If set to "relative" a relative date will be used, e.g.
319           "2 minutes ago". If set to "short" no time information is shown.  If
320           set to "local", localtime(3) is used.
321         - 'width' (int): Width of the column. When set to zero, the width is
322           automatically sized to fit the content.
324 file-name::
325         - 'display' (mixed) [auto|always|<bool>]: When to display file names.
326           If set to "auto" file names are shown only when needed, e.g. when
327           running: tig blame -C <file>.
328         - 'width' (int): Width of the column. When set to zero, the width is
329           automatically sized to fit the content.
331 file-size::
332         - 'display' (mixed) [default|units|<bool>]: How to display file sizes.
333           When set to "units", sizes are shown using binary prefixes, e.g. 12524
334           bytes is shown as "12.2K".
335         - 'width' (int): Width of the filename column. When set to zero, the
336           width is automatically sized to fit the content.
338 id::
339         - 'display' (bool): Whether to show commit IDs in the main view.
340         - 'width' (int) : Width of the commit ID. When unset Tig will use the
341           value of 'core.abbrev' if found. See git-config(1) on how to set
342           'core.abbrev'. When set to zero the width is automatically sized to
343           fit the content of reflog (e.g.  `ref/stash@{4}`) IDs and otherwise
344           default to 7.
346 line-number::
347         - 'display' (bool): Whether to show line numbers.
348         - 'interval' (int): Interval between line numbers.
349         - 'width' (int): Width of the column. When set to zero, the width is
350           automatically sized to fit the content.
352 mode::
353         - 'display' (bool): Whether to show file modes.
354         - 'width' (int): Width of the column. When set to zero, the width is
355           automatically sized to fit the content.
357 ref::
358         - 'display' (bool): Whether to show the reference name.
359         - 'width' (int): Width of the column. When set to zero, the width is
360           automatically sized to fit the content.
362 status::
363         - 'display' (mixed) [no|short|long|<bool>]: How to display the status
364           label.
365         - 'width' (int): Width of the column. When set to zero, the width is
366           automatically sized to fit the content.
368 text::
369         - 'commit-title-overflow' (bool or int): Whether to highlight commit
370           titles exceeding a given width in the diff view. When set to a
371           boolean, it enables or disables the highlighting using the default
372           width of 50 character. When set to an int, the assigned value is used
373           as the maximum character width.
375 Examples:
376 --------------------------------------------------------------------------
377 # Enable both ID and line numbers in the blame view
378 set blame-view = date:default author:full file-name:auto id:yes,color line-number:yes,interval=5 text
380 # Change grep view to be similar to `git grep` format
381 set grep-view = file-name:yes line-number:yes,interval=1 text
383 # Show file sizes as units
384 set tree-view = line-number:no,interval=5 mode author:full file-size:units date:default id:no file-name
386 # Show line numbers for every 10th line in the pager view
387 set pager-view = line-number:yes,interval=10 text
388 --------------------------------------------------------------------------
390 Note that all column options can be toggled. For 'display' options, use the
391 option name as the prefix followed by a dash and the column name. E.g.
392 `:toggle author-display` will toggle the 'display' option in the 'author'
393 column. For all other options use the column name followed by a dash and
394 then the option name as the suffix. E.g. `:toggle commit-title-graph`
395 will toggle the 'graph' option in the 'commit-title' column.
397 Bind command
398 ------------
400 Using bind commands, keys can be mapped to an action when pressed in a given
401 key map. The syntax is:
403 [verse]
404 *bind* 'keymap' 'key' 'action'
406 Examples:
408 --------------------------------------------------------------------------
409 # Add keybinding to quickly jump to the next diff chunk in the stage view
410 bind stage Enter :/^@@
412 # Disable the default mapping for running git-gc
413 bind generic G none
415 # User-defined external command to amend the last commit
416 bind status + !git commit --amend
418 # User-defined internal command that reloads ~/.tigrc
419 bind generic S :source ~/.tigrc
421 # UTF8-encoded characters can be used as key values.
422 bind generic Ã¸ @sh -c "printf '%s' %(commit) | pbcopy"
423 --------------------------------------------------------------------------
425 Or in the Git configuration files:
427 --------------------------------------------------------------------------
428 [tig "bind"]
429         # 'unbind' the default quit key binding
430         main = Q none
431         # Cherry-pick current commit onto current branch
432         generic = C !git cherry-pick %(commit)
433 --------------------------------------------------------------------------
435 Keys are mapped by first searching the keybindings for the current view, then
436 the keybindings for the *generic* keymap, and last the default keybindings.
437 Thus, the view keybindings override the generic keybindings which override the
438 built-in keybindings.
442 Keymaps::
444 Valid keymaps are: *main*, *diff*, *log*, *help*, *pager*, *status*, *stage*,
445 *tree*, *blob*, *blame*, *refs*, *stash*, *grep* and *generic*. Use *generic*
446 to set key mapping in all keymaps.
448 Key values::
450 Key values should never be quoted. Use either an ASCII or UTF8-encoded character
451 or one of the following symbolic key names. Symbolic key names are case
452 insensitive. Use *Hash* to bind to the `#` key, since the hash mark is used as a
453 comment character.
455 *Enter*, *Space*, *Backspace*, *Tab*, *Escape*, *Left*, *Right*, *Up*, *Down*,
456 *Insert*, *Delete*, *Hash*, *Home*, *End*, *PageUp*, *PageDown*, *F1*, *F2*, *F3*,
457 *F4*, *F5*, *F6*, *F7*, *F8*, *F9*, *F10*, *F11*, *F12*.
459 To add a key mapping that uses the `Ctrl` key, use a `^` prefix in your mapping.
460 Similarly, use `^[` to map to keys prefixed by the `Escape` key. Examples:
462 --------------------------------------------------------------------------
463 bind main ^f  scroll-page-down
464 bind main ^[o options
465 --------------------------------------------------------------------------
467 Note that due to the way ncurses encodes `Ctrl` key mappings, `Ctrl-m` and
468 `Ctrl-i` cannot be bound as they conflict with 'Enter' and 'Tab' respectively.
469 Furthermore, ncurses does not allow to distinguish between `Ctrl-f` and
470 `Ctrl-F`. Finally, `Ctrl-z` is automatically used for process control and will
471 suspend Tig and open a subshell (use `fg` to reenter Tig).
473 Actions::
475 Actions are either specified as user-defined commands (external or internal) or
476 using action names as described in the following sections.
480 External user-defined command
481 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
483 These actions start with one or more of the following option flags followed by
484 the command that should be executed.
486 [frame="none",grid="none",cols="25<m,75<"]
487 |=============================================================================
488 |!                      |Run the command in the foreground with output shown.
489 |@                      |Run the command in the background with no output.
490 |?                      |Prompt the user before executing the command.
491 |<                      |Exit Tig after executing the command.
492 |=============================================================================
494 Unless otherwise specified, commands are run in the foreground with their
495 console output shown (as if '!' was specified). When multiple command options
496 are specified their behavior are combined, e.g. "?<git commit" will prompt the
497 user whether to execute the command and will exit Tig after completion.
499 Browsing state variables
500 ^^^^^^^^^^^^^^^^^^^^^^^^
502 User-defined commands can optionally refer to Tig's internal state using the
503 following variable names, which are substituted before commands are run:
505 [frame="none",grid="none",cols="25<m,75<"]
506 |=============================================================================
507 |%(head)                |The currently viewed 'head' ID. Defaults to HEAD
508 |%(commit)              |The currently selected commit ID.
509 |%(blob)                |The currently selected blob ID.
510 |%(branch)              |The currently selected branch name.
511 |%(remote)              |The currently selected remote name. For remote
512                          branches %(branch) will contain the branch name.
513 |%(tag)                 |The currently selected tag name.
514 |%(stash)               |The currently selected stash name.
515 |%(directory)           |The current directory path in the tree view or
516                          "." if undefined.
517 |%(file)                |The currently selected file.
518 |%(ref)                 |The reference given to blame or HEAD if undefined.
519 |%(revargs)             |The revision arguments passed on the command line.
520 |%(fileargs)            |The file arguments passed on the command line.
521 |%(cmdlineargs)         |All other options passed on the command line.
522 |%(diffargs)            |The diff options from 'diff-options' or 'TIG_DIFF_OPTS'
523 |%(prompt)              |Prompt for the argument value. Optionally specify a
524                          custom prompt using `"%(prompt Enter branch name: )"`
525 |=============================================================================
527 Examples:
529 --------------------------------------------------------------------------
530 # Save save the current commit as a patch file when the user selects a
531 # commit in the main view and presses 'S'.
532 bind main S !git format-patch -1 %(commit)
534 # Create and checkout a new branch; specify custom prompt
535 bind main B ?git checkout -b "%(prompt Enter new branch name: )"
536 --------------------------------------------------------------------------
538 Advanced shell-like commands
539 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
541 If your command requires use of dynamic features, such as subshells,
542 expansion of environment variables and process control, this can be achieved by
543 using a shell command:
545 .Configure a binding to copy the current commit ID to the clipboard.
546 --------------------------------------------------------------------------
547 bind generic I @sh -c "echo -n %(commit) | xclip -selection c"
548 --------------------------------------------------------------------------
550 Or by using a combination of Git aliases and Tig external commands. The
551 following example entries can be put in either the .gitconfig or .git/config
552 file:
554 .Git configuration which binds Tig keys to Git command aliases.
555 --------------------------------------------------------------------------
556 [alias]
557         gitk-bg = !"gitk HEAD --not $(git rev-parse --remotes) &"
558         publish = !"for i in origin public; do git push $i; done"
559 [tig "bind"]
560         # @-prefix means that the console output will not be shown.
561         generic = V !@git gitk-bg
562         generic = > !git publish
563 --------------------------------------------------------------------------
565 Internal user-defined commands
566 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
568 Actions beginning with a ':' will be run and interpreted as internal commands
569 and act similar to commands run via Tig's prompt. Valid internal commands are
570 configuration file options (as described in this document) and pager view
571 commands. Examples:
573 --------------------------------------------------------------------------
574 # Reload ~/.tigrc when 'S' is pressed
575 bind generic S :source .tigrc
577 # Change diff view to show all commit changes regardless of file limitations
578 bind diff F :set diff-options = --full-diff
580 # Show the output of git-reflog(1) in the pager view
581 bind generic W :!git reflog
583 # Search for previous diff (c)hunk and next diff header
584 bind stage 2 :?^@@
585 bind stage D :/^diff --(git|cc)
587 bind main I :toggle show-id                     # Show/hide the ID column
588 bind diff D :toggle diff-options --minimal      # Use minimal diff algorithm
589 bind diff [ :toggle diff-context -3             # Decrese context (-U arg)
590 bind diff ] :toggle diff-context +3             # Increase context
591 bind generic V :toggle split-view-height -10%   # Decrease split height
592 --------------------------------------------------------------------------
594 Similar to external commands, pager view commands can contain variable names
595 that will be substituted before the command is run.
597 Action names
598 ~~~~~~~~~~~~
600 Valid action names are described below. Note, all action names are
601 case-insensitive, and you may use '-', '_', and '.' interchangeably, e.g.
602 "view-main", "View.Main", and "VIEW_MAIN" are the same.
604 ifndef::DOC_GEN_ACTIONS[]
605 View switching
606 ^^^^^^^^^^^^^^
608 [frame="none",grid="none",cols="25<m,75<"]
609 |=============================================================================
610 |view-main               |Show main view
611 |view-diff               |Show diff view
612 |view-log                |Show log view
613 |view-tree               |Show tree view
614 |view-blob               |Show blob view
615 |view-blame              |Show blame view
616 |view-refs               |Show refs view
617 |view-status             |Show status view
618 |view-stage              |Show stage view
619 |view-stash              |Show stash view
620 |view-grep               |Show grep view
621 |view-pager              |Show pager view
622 |view-help               |Show help view
623 |=============================================================================
625 View manipulation
626 ^^^^^^^^^^^^^^^^^
628 [frame="none",grid="none",cols="25<m,75<"]
629 |=============================================================================
630 |enter                   |Enter and open selected line
631 |back                    |Go back to the previous view state
632 |next                    |Move to next
633 |previous                |Move to previous
634 |parent                  |Move to parent
635 |view-next               |Move focus to the next view
636 |refresh                 |Reload and refresh view
637 |maximize                |Maximize the current view
638 |view-close              |Close the current view
639 |quit                    |Close all views and quit
640 |=============================================================================
642 View specific actions
643 ^^^^^^^^^^^^^^^^^^^^^
645 [frame="none",grid="none",cols="25<m,75<"]
646 |=============================================================================
647 |status-update           |Stage/unstage chunk or file changes
648 |status-revert           |Revert chunk or file changes
649 |status-merge            |Merge file using external tool
650 |stage-update-line       |Stage/unstage single line
651 |stage-split-chunk       |Split current diff chunk
652 |=============================================================================
654 Cursor navigation
655 ^^^^^^^^^^^^^^^^^
657 [frame="none",grid="none",cols="25<m,75<"]
658 |=============================================================================
659 |move-up                 |Move cursor one line up
660 |move-down               |Move cursor one line down
661 |move-page-down          |Move cursor one page down
662 |move-page-up            |Move cursor one page up
663 |move-first-line         |Move cursor to first line
664 |move-last-line          |Move cursor to last line
665 |=============================================================================
667 Scrolling
668 ^^^^^^^^^
670 [frame="none",grid="none",cols="25<m,75<"]
671 |=============================================================================
672 |scroll-line-up          |Scroll one line up
673 |scroll-line-down        |Scroll one line down
674 |scroll-page-up          |Scroll one page up
675 |scroll-page-down        |Scroll one page down
676 |scroll-first-col        |Scroll to the first line columns
677 |scroll-left             |Scroll two columns left
678 |scroll-right            |Scroll two columns right
679 |=============================================================================
681 Searching
682 ^^^^^^^^^
684 [frame="none",grid="none",cols="25<m,75<"]
685 |=============================================================================
686 |search                  |Search the view
687 |search-back             |Search backwards in the view
688 |find-next               |Find next search match
689 |find-prev               |Find previous search match
690 |=============================================================================
692 Option manipulation
693 ^^^^^^^^^^^^^^^^^^^
695 In addition to the actions below, options can also be toggled with the
696 `:toggle` prompt command.
698 [frame="none",grid="none",cols="25<m,75<"]
699 |=============================================================================
700 |options                 |Open the options menu
701 |=============================================================================
703 Misc
704 ^^^^
706 [frame="none",grid="none",cols="25<m,75<"]
707 |=============================================================================
708 |edit                    |Open in editor
709 |prompt                  |Open the prompt
710 |screen-redraw           |Redraw the screen
711 |stop-loading            |Stop all loading views
712 |show-version            |Show version information
713 |none                    |Do nothing
714 |=============================================================================
715 endif::DOC_GEN_ACTIONS[]
717 Color command
718 -------------
720 Color commands control highlighting and the user interface styles. If your
721 terminal supports color, these commands can be used to assign foreground and
722 background combinations to certain areas. Optionally, an attribute can be
723 given as the last parameter. The syntax is:
725 [verse]
726 *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
728 Examples:
730 ------------------------------------------------------------------------------
731 # Override the default terminal colors to white on black.
732 color default           white   black
733 # Diff colors
734 color diff-header       yellow  default
735 color diff-index        blue    default
736 color diff-chunk        magenta default
737 color "Reported-by:"    green   default
738 # View specific color
739 color tree.date         black   cyan    bold
740 --------------------------------------------------------------------------
742 Or in the Git configuration files:
744 --------------------------------------------------------------------------
745 [tig "color"]
746         # A strange looking cursor line
747         cursor          = red   default underline
748         # UI colors
749         title-blur      = white blue
750         title-focus     = white blue    bold
751 # View specific color
752 [tig "color.tree"]
753         date            = cyan  default bold
754 ------------------------------------------------------------------------------
756 Area names::
758         Can be either a built-in area name or a custom quoted string. The
759         latter allows custom color rules to be added for lines matching a
760         quoted string.
761         Valid built-in area names are described below. Note, all names are
762         case-insensitive, and you may use '-', and '_' interchangeably,
763         e.g. "Diff-Header" and "DIFF_HEADER" are the same.
764         View specific colors can be defined by prefixing the view name to
765         the area name, e.g. "stage.diff-chunk" and "diff.diff-chunk".
767 Color names::
769         Valid colors include: *white*, *black*, *green*, *magenta*, *blue*,
770         *cyan*, *yellow*, *red*, *default*. Use *default* to refer to the
771         default terminal colors, for example, to keep the background
772         transparent when you are using a terminal with a transparent
773         background.
775 Colors can also be specified using the keywords *color0*, *color1*, ...,
776 *colorN-1* (where *N* is the number of colors supported by your terminal).
777 This is useful when you remap the colors for your display or want to enable
778 colors supported by 88-color and 256-color terminals. Note that the 'color'
779 prefix is optional. If you prefer, you can specify colors directly by their
780 numbers *0*, *1*, ..., *N-1* instead, just like in the configuration file of
781 Git.
783 Attribute names::
785         Valid attributes include: *normal*, *blink*, *bold*, *dim*, *reverse*,
786         *standout*, and *underline*. Note, not all attributes may be supported
787         by the terminal.
789 UI colors
790 ~~~~~~~~~
792 The colors and attributes to be used for the text that is not highlighted or
793 that specify the use of the default terminal colors can be controlled by
794 setting the *default* color option.
796 .General
797 [frame="none",grid="none",cols="25<m,75<"]
798 |=============================================================================
799 |default                |Override default terminal colors (see above).
800 |cursor                 |The cursor line.
801 |status                 |The status window showing info messages.
802 |title-focus            |The title window for the current view.
803 |title-blur             |The title window of any backgrounded view.
804 |delimiter              |Delimiter shown for truncated lines.
805 |header                 |The view header lines. Use 'status.header' to color
806                          the staged, unstaged, and untracked sections in the
807                          status view. Use 'help.header' to color the keymap
808                          sections in the help view.
809 |line-number            |Line numbers.
810 |id                     |The commit ID.
811 |date                   |The commit date.
812 |author                 |The commit author.
813 |mode                   |The file mode holding the permissions and type.
814 |overflow               |Title text overflow.
815 |directory              |The directory name.
816 |file                   |The file name.
817 |file-size              |File size.
818 |=============================================================================
820 .Main view colors
821 [frame="none",grid="none",cols="25<m,75<"]
822 |=============================================================================
823 |graph-commit           |The commit dot in the revision graph.
824 |palette-[0-6]          |7 different colors,
825 used for distinguishing branches or commits.
826 example: palette-0 = red
827 |main-commit            |The commit comment.
828 |main-head              |Label of the current branch.
829 |main-remote            |Label of a remote.
830 |main-tracked           |Label of the remote tracked by the current branch.
831 |main-tag               |Label of a signed tag.
832 |main-local-tag         |Label of a local tag.
833 |main-ref               |Label of any other reference.
834 |main-replace           |Label of replaced reference.
835 |=============================================================================
837 .Status view
838 [frame="none",grid="none",cols="25<m,75<"]
839 |=============================================================================
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 .Help view
847 [frame="none",grid="none",cols="25<m,75<"]
848 |=============================================================================
849 |help-group             |Help group name.
850 |help-action            |Help action name.
851 |=============================================================================
853 Highlighting
854 ~~~~~~~~~~~~
858 Diff markup::
860 Options concerning diff start, chunks and lines added and deleted.
862 *diff-header*, *diff-chunk*, *diff-add*, *diff-add2*, *diff-del*,
863 *diff-del2*
865 Enhanced Git diff markup::
867 Extra diff information emitted by the Git diff machinery, such as mode
868 changes, rename detection, and similarity.
870 *diff-oldmode*, *diff-newmode*, *diff-copy-from*, *diff-copy-to*,
871 *diff-similarity*, *diff-index*
873 Pretty print commit headers::
875 Commit diffs and the revision logs are usually formatted using pretty printed
876 headers , unless `--pretty=raw` was given. This includes lines, such as merge
877 info, commit ID, and author and committer date.
879 *pp-refs*, *pp-reflog*, *pp-reflogmsg*, *pp-merge*
881 Raw commit header::
883 Usually shown when `--pretty=raw` is given, however 'commit' is pretty much
884 omnipresent.
886 *commit*, *parent*, *tree*, *author*, *committer*
888 Commit message::
890 `Signed-off-by`, `Acked-by`, `Reviewed-by` and `Tested-by` lines are colorized.
891 Characters in the commit title exceeding a predefined width can be highlighted.
894 Tree markup::
896 Colors for information of the tree view.
898 *tree-dir*, *tree-file*
902 Source command
903 -------------
905 Source commands make it possible to read additional configuration files.
906 Sourced files are included in-place, meaning when a 'source' command is
907 encountered the file will be immediately read. Any commands later in the
908 current configuration file will take precedence. The syntax is:
910 [verse]
911 *source* 'path'
913 Examples:
915 --------------------------------------------------------------------------
916 source ~/.tig/colorscheme.tigrc
917 source ~/.tig/keybindings.tigrc
918 --------------------------------------------------------------------------
920 COPYRIGHT
921 ---------
922 Copyright (c) 2006-2014 Jonas Fonseca <jonas.fonseca@gmail.com>
924 This program is free software; you can redistribute it and/or modify
925 it under the terms of the GNU General Public License as published by
926 the Free Software Foundation; either version 2 of the License, or
927 (at your option) any later version.
929 SEE ALSO
930 --------
931 ifndef::backend-docbook[]
932 link:tig.1.{docext}[tig(1)],
933 link:manual.{docext}[the Tig manual],
934 endif::backend-docbook[]
935 ifdef::backend-docbook[]
936 manpage:tig[1],
937 manpage:tigmanual[7],
938 endif::backend-docbook[]
939 git(7), git-config(1)