1TIGRC(5)                          Tig Manual                          TIGRC(5)
2
3
4

NAME

6       tigrc - Tig configuration file
7

SYNOPSIS

9       set   variable = value
10       bind  keymap key action
11       color area fgcolor bgcolor [attributes]
12       source path
13
14

DESCRIPTION

16       You can permanently set an option by putting it in the ~/.tigrc file.
17       The file consists of a series of commands. Each line of the file may
18       contain only one command. Commands can span multiple lines if each line
19       is terminated by a backslash (\) character.
20
21       The hash mark (#) is used as a comment character. All text after the
22       comment character to the end of the line is ignored. You can use
23       comments to annotate your initialization file.
24
25       Certain options can be manipulated at runtime via the option menu. In
26       addition, options can also be toggled with the :toggle prompt command
27       or by entering the configuration command into the prompt.
28
29       In some environments, a user’s configuration will be stored in the
30       alternate location $XDG_CONFIG_HOME/tig/config. For brevity, this
31       document will refer only to ~/.tigrc.
32

GIT CONFIGURATION

34       Alternatively to using ~/.tigrc, Tig options can be set by putting them
35       in one of the Git configuration files, which are read by Tig on
36       startup. See git-config(1) for which files to use. The following
37       example show the basic syntax to use for settings, bindings and colors.
38
39           [tig] show-changes = true
40           [tig "color"] cursor = yellow red bold
41           [tig "bind"] generic = P parent
42
43
44       In addition to tig-specific options, the following Git options are read
45       from the Git configuration:
46
47       color.*
48           Colors for the various UI types. Can be configured via the
49           git-colors setting.
50
51       core.abbrev
52           The width of the commit ID. See also id-width option.
53
54       core.editor
55           The editor command. Can be overridden by setting TIG_EDITOR or
56           GIT_EDITOR.
57
58       core.worktree
59           The path to the root of the working tree.
60
61       gui.encoding
62           The encoding to use for displaying of file content.
63
64       i18n.commitencoding
65           The encoding used for commits. The default is UTF-8.
66

SET COMMAND

68       A few selective variables can be configured via the set command. The
69       syntax is:
70
71           set variables = value
72
73
74       Examples:
75
76           set commit-order = topo         # Order commits topologically
77           set git-colors = no             # Do not read Git's color settings.
78           set horizontal-scroll = 33%     # Scroll 33% of the view width
79           set blame-options = -C -C -C    # Blame lines from other files
80
81           # Wrap branch names with () and tags with <>
82           set reference-format = (branch) <tag>
83
84           # Configure blame view columns using command spanning multiple lines.
85           set blame-view = \
86                   date:default \
87                   author:abbreviated \
88                   file-name:auto \
89                   id:yes,color \
90                   line-number:yes,interval=5 text
91
92
93       Or in the Git configuration files:
94
95           [tig]
96                   line-graphics = no      # Disable graphics characters
97                   tab-size = 8            # Number of spaces per tab
98
99
100       The type of variables is either bool, int, string, or mixed.
101
102       Valid bool values
103           To set a bool variable to true use either "1", "true", or "yes".
104           Any other value will set the variable to false.
105
106       Valid int values
107           A non-negative integer.
108
109       Valid string values
110           A string of characters. Optionally, use either ' or " as
111           delimiters.
112
113       Valid mixed values
114           These values are composites of the above types. The valid values
115           are specified in the description.
116
117   Variables
118       The following variables can be set:
119
120       diff-options (string)
121           A space-separated string of diff options to use in the diff view.
122           git-show(1) is used for formatting and always passes
123           --patch-with-stat. Can control display of commit header metadata,
124           passing option --format. This option overrides any options
125           specified in the TIG_DIFF_OPTS environment variable (described in
126           tig(1)), but is itself overridden by diff flags given on the
127           command line invocation.
128
129       blame-options (string)
130           A space-separated string of default blame options. Can be used for
131           telling git-blame(1) how to detect the origin of lines. The options
132           are ignored when Tig is started in blame mode and given blame
133           options on the command line.
134
135       log-options (string)
136           A space-separated string of default options that should be passed
137           to the git-log(1) command used by the log view. Options can be
138           overridden by command line options. Used internally override custom
139           ‘pretty.format’ settings that break the log view.
140
141       main-options (string)
142           A space-separated string of default options that should be passed
143           to the git-log(1) command used by the main view. Options can be
144           overridden by command line options.
145
146       reference-format (string)
147           A space-separated string of format strings used for formatting
148           reference names. Wrap the name of the reference type with the
149           characters you would like to use for formatting, e.g.  [tag] and
150           <remote>. If no format is specified for local-tag, the format for
151           tag is used. Similarly, if no format is specified for
152           tracked-remote the remote format is used. Prefix with hide: to not
153           show that reference type, e.g.  hide:remote. Supported reference
154           types are:
155
156           •   head : The current HEAD.
157
158           •   tag : An annotated tag.
159
160           •   local-tag : A lightweight tag.
161
162           •   remote : A remote.
163
164           •   tracked-remote : The remote tracked by current HEAD.
165
166           •   replace : A replaced reference.
167
168           •   branch : A branch.
169
170           •   stash : The stash.
171
172           •   other : Any other reference.
173
174       line-graphics (mixed) [ascii|default|utf-8|auto|<bool>]
175           What type of character graphics for line drawing. "auto" means
176           "utf-8" if the locale is UTF-8, "default" otherwise.
177
178       truncation-delimiter (mixed) [utf-8|<string>]
179           A single character to draw where columns are truncated. The default
180           is "~". The special value "utf-8" refers to the character "..."
181           ("Midline Horizontal Ellipsis").
182
183       horizontal-scroll (mixed)
184           Interval to scroll horizontally in each step. Can be specified
185           either as the number of columns, e.g.  5, or as a percentage of the
186           view width, e.g.  33%, where the maximum is 100%. For percentages
187           it is always ensured that at least one column is scrolled. The
188           default is to scroll 50% of the view width.
189
190       git-colors (list)
191           A space-separated list of "key=value" pairs where the key is a Git
192           color name and the value is a Tig color name, e.g.
193           "branch.current=main-head" and "grep.filename=grep.file". Set to
194           "no" to disable.
195
196       show-notes (mixed) [<reference>|<bool>]
197           Whether to show notes for a commit. When set to a note reference
198           the reference is passed to git show --notes=. Notes are enabled by
199           default.
200
201       show-changes (bool)
202           Whether to show staged and unstaged changes in the main view.
203
204       show-untracked (bool)
205           Whether to show also untracked changes in the main view.
206
207       vertical-split (mixed) [auto|<bool>]
208           Whether to split the view horizontally or vertically. "auto" (which
209           is the default) means that it will depend on the window dimensions.
210           When true vertical orientation is used, and false sets the
211           orientation to horizontal.
212
213       split-view-height (mixed)
214           The height of the bottom view in a horizontally split display. Can
215           be specified either as the number of rows, e.g.  5, or as a
216           percentage of the view height, e.g.  80%, where the maximum is
217           100%. It is always ensured that the smaller of the views is at
218           least four rows high. The default is 67%.
219
220       split-view-width (mixed)
221           Width of the right-most view in a vertically split display. Can be
222           specified either as the number of column, e.g.  5, or as a
223           percentage of the view width, e.g.  80%, where the maximum is 100%.
224           It is always ensured that the smaller of the views is at least four
225           columns wide. The default is 50%.
226
227       status-show-untracked-dirs (bool)
228           Show untracked directories contents in the status view (analog to
229           git ls-files --directory option). On by default.
230
231       status-show-untracked-files (bool)
232           Show untracked files in the status view (mirrors Git’s
233           status.showUntrackedFiles option). On by default.
234
235       tab-size (int)
236           Number of spaces per tab. The default is 8 spaces.
237
238       diff-context (int)
239           Number of context lines to show for diffs.
240
241       diff-highlight (mixed)
242           Whether to highlight diffs using Git’s diff-highlight program.
243           Defaults to false. When set to true then diff-highlight is used,
244           else the option value is used as the path. When this option is in
245           effect, highlighted regions are governed by color
246           diff-add-highlight and color diff-del-highlight.
247
248       ignore-space (mixed) [no|all|some|at-eol|<bool>]
249           Ignore space changes in diff view. By default no space changes are
250           ignored. Changing this to "all", "some" or "at-eol" is equivalent
251           to passing "--ignore-all-space", "--ignore-space" or
252           "--ignore-space-at-eol" respectively to git diff or git show.
253
254
255           Warning: when ignore-space is set to some, all or at-eol, then the
256           status-update and status-revert may fail when updating or reverting
257           chunks containing lines with space changes. Similarly,
258           stage-update-line may fail when updating a line adjacent to a line
259           with space changes
260
261       commit-order (enum) [auto|default|topo|date|author-date|reverse]
262           Commit ordering using the default (chronological reverse) order,
263           topological order, date order or reverse order. When set to "auto"
264           (which is the default), topological order is automatically used in
265           the main view when the commit graph is enabled. In repositories
266           with a long commit history it is advised to set this option to
267           "default" to speed up loading of the main view.
268
269       ignore-case (enum) [no|yes|smart-case]
270           Ignore case in searches. "smart-case" ignores case if the search
271           string doesn’t contain any uppercase letters. By default, the
272           search is case sensitive.
273
274       mailmap (bool)
275           Read canonical name and email addresses for authors and committers
276           from .mailmap. Off by default. See git-shortlog(1).
277
278       wrap-lines (bool)
279           Wrap long lines. By default, lines are not wrapped. Not compatible
280           with line numbers enabled.
281
282       focus-child (bool)
283           Whether to focus the child view when it is opened. When disabled
284           the focus will remain in the parent view, avoiding reloads of the
285           child view when navigating the parent view. True by default.
286
287       send-child-enter (bool)
288           Whether to send "enter" key presses to the child view, even if
289           parent view is active. When disabled the child view has to be
290           explicitly focused to receive the "enter" key presses. In practice
291           only relevant when set focus-child = no. True by default.
292
293       editor-line-number (bool)
294           Whether to pass the selected line number to the editor command. The
295           line number is passed as +<line-number> in front of the file name.
296           Example: vim +10 tig.c
297
298       history-size (int)
299           Size of the persistent ~/.tig_history file when compiled with
300           readline support. Default is 500. Set to 0 to disable.
301
302       mouse (bool)
303           Whether to enable mouse support. Off by default since it makes
304           selecting text from the terminal less intuitive. When enabled hold
305           down Shift (or Option on Mac) to select text. Mouse support
306           requires that ncurses itself support mouse events.
307
308       mouse-scroll (int)
309           Interval to scroll up or down using the mouse. The default is 3
310           lines. Mouse support requires that ncurses itself support mouse
311           events and that you have enabled mouse support in ~/.tigrc with set
312           mouse = true.
313
314       mouse-wheel-cursor (bool)
315           Whether to prefer moving the cursor to scrolling the view when
316           using the mouse wheel. Off by default. Combines well with set
317           mouse-scroll = 1. Mouse support requires that ncurses itself
318           support mouse events and that you have enabled mouse support in
319           ~/.tigrc with set mouse = true.
320
321       pgrp (bool)
322           Make tig process-group leader when starting and clean all processes
323           when exiting. Off by default. Do not enable this option if you are
324           using a Zsh version affected by zsh-workers/43379. Run xclip with
325           setsid to keep clipboard content after exiting tig. If you are
326           using git-credential-cache helper, set option
327           credentialCache.ignoreSIGHUP.
328
329       start-on-head (bool)
330           Start with cursor on HEAD commit.
331
332       refresh-mode (mixed) [manual|auto|after-command|periodic|<bool>]
333           Configures how views are refreshed based on modifications to
334           watched files in the repository. When set to manual, nothing is
335           refreshed automatically. When set to auto, views are refreshed when
336           a modification is detected in another view. When set to
337           after-command only refresh after returning from an external
338           command. When set to periodic, visible views are refreshed
339           periodically using refresh-interval.
340
341       refresh-interval (int)
342           Interval in seconds between view refresh update checks when
343           refresh-mode is set to periodic.
344
345       file-args (args)
346           Command line arguments referring to files. These are filtered using
347           git-rev-parse(1).
348
349       rev-args (args)
350           Command line arguments referring to revisions. These are filtered
351           using git-rev-parse(1).
352
353   View settings
354       The view settings define the order and options for the different
355       columns of a view. Each view setting expects a space-separated list of
356       column specifications. Column specifications starts with the column
357       type, and can optionally be followed by a colon (:) and a list of
358       column options. E.g. the following column specification defines an
359       author column displaying the author email and with a fixed width of 20
360       characters: author:email,width=20.
361
362       The first option value in a column specification is always the display
363       option. When no display value is given, yes is assumed. For display
364       options expecting an enumerated value this will automatically resolve
365       to the default enum value. For example, file-name will automatically
366       have its display setting resolve to auto.
367
368       Specifications can also be given for a single column, for example to
369       override the defaults in the system tigrc file. To override a single
370       column, use the column name as a suffix after the view setting name,
371       e.g. main-view-date will allow to set the date in the main view.
372
373       Examples:
374
375           # Enable both ID and line numbers in the blame view
376           set blame-view = date:default author:full file-name:auto id:yes,color \
377                            line-number:yes,interval=5 text
378
379           # Change grep view to be similar to `git grep` format
380           set grep-view = file-name:yes line-number:yes,interval=1 text
381
382           # Show file sizes as units
383           set tree-view = line-number:no,interval=5 mode author:full \
384                           file-size:units date:default id:no file-name
385
386           # Show line numbers for every 10th line in the pager view
387           set pager-view = line-number:yes,interval=10 text
388
389           # Shorthands to change view settings for a previously defined column
390           set main-view-date = custom
391           set main-view-date-format = "%Y-%m-%d %H:%M"
392           set blame-view-line-number = no
393           # Use Git's default commit order, even when the commit graph is enabled.
394           set commit-order = default
395
396
397       The following list shows which the available view settings and what
398       column types they support:
399
400       blob-view, diff-view, log-view, pager-view, stage-view
401           line-number, text
402
403       blame-view
404           author, date, file-name, id, line-number, text
405
406       grep-view
407           file-name, line-number, text
408
409       main-view, reflog-view
410           author, date, commit-title, id, line-number, ref
411
412       refs-view
413           author, date, commit-title, id, line-number, ref
414
415       stash-view
416           author, date, commit-title, id, line-number
417
418       status-view
419           file-name, line-number, status
420
421       tree-view
422           author, date, id, file-name, file-size, line-number, mode
423
424       Supported column types and their respective column options:
425
426       author
427
428display (mixed) [full|abbreviated|email|email-user|<bool>]: How
429               to display author names. If set to "abbreviated" author
430               initials will be shown.
431
432width (int): Fixed width for the column. When set to a value
433               between 1 and 10, the author name will be abbreviated to the
434               author’s initials. When set to zero, the width is automatically
435               sized to fit the content.
436
437maxwidth (int): Maximum width of the column. Permit
438               automatically sizing content, up to this limit. Can be
439               specified either as the number of columns, e.g.  15, or as a
440               percentage of the view width, e.g.  20%, where the maximum is
441               100%.
442
443       commit-title
444
445graph (mixed) [no|v2|v1]: Whether to show the revision graph in
446               the main view on start-up. "v1" refers to the old graph
447               rendering, which is less accurate but faster and thus
448               recommended in large repositories. See also the line-graphics
449               options.
450
451refs (bool): Whether to show references (branches, tags, and
452               remotes) in the main view. Can be toggled.
453
454overflow (bool or int): Whether to highlight text in commit
455               titles exceeding a given width. When set to a boolean, it
456               enables or disables the highlighting using the default width of
457               50 character. When set to an int, the assigned value is used as
458               the maximum character width.
459
460       date
461
462display (mixed)
463               [relative|relative-compact|custom|default|<bool>]: How to
464               display dates. If set to "relative" or "relative-compact" a
465               relative date will be used, e.g. "2 minutes ago" or "2m". If
466               set to "custom", the strftime(3) string format specified in the
467               "format" option is used.
468
469local (bool): If true, use localtime(3) to convert to local
470               timezone. Note that relative dates always use local offsets.
471
472format (string): format string to pass to strftime(3) when
473               custom display mode has been selected.
474
475width (int): Fixed width for the column. When set to zero, the
476               width is automatically sized to fit the content.
477
478       file-name
479
480display (mixed) [auto|always|<bool>]: When to display file
481               names. If set to "auto" file names are shown only when needed,
482               e.g. when running: tig blame -C <file>.
483
484width (int): Width of the column. When set to zero, the width
485               is automatically sized to fit the content.
486
487maxwidth (int): Maximum width of the column. Permit
488               automatically sizing content, up to this limit. Can be
489               specified either as the number of columns, e.g.  15, or as a
490               percentage of the view width, e.g.  20%, where the maximum is
491               100%.
492
493       file-size
494
495display (mixed) [default|units|<bool>]: How to display file
496               sizes. When set to "units", sizes are shown using binary
497               prefixes, e.g. 12524 bytes is shown as "12.2K".
498
499width (int): Fixed width for the filename column. When set to
500               zero, the width is automatically sized to fit the content.
501
502       id
503
504display (bool): Whether to show commit IDs in the main view.
505
506width (int) : Fixed width for the commit ID column. When unset
507               Tig will use the value of core.abbrev if found. See
508               git-config(1) on how to set core.abbrev. When set to zero the
509               width is automatically sized to fit the content of reflog (e.g.
510               ref/stash@{4}) IDs and otherwise default to 7.
511
512       line-number
513
514display (bool): Whether to show line numbers.
515
516interval (int): Interval between line numbers.
517
518width (int): Fixed width for the column. When set to zero, the
519               width is automatically sized to fit the content.
520
521       mode
522
523display (bool): Whether to show file modes.
524
525width (int): Fixed width for the column. When set to zero, the
526               width is automatically sized to fit the content.
527
528       ref
529
530display (bool): Whether to show the reference name.
531
532width (int): Fixed width for the column. When set to zero, the
533               width is automatically sized to fit the content.
534
535maxwidth (int): Maximum width of the column. Permit
536               automatically sizing content, up to this limit. Can be
537               specified either as the number of columns, e.g.  15, or as a
538               percentage of the view width, e.g.  20%, where the maximum is
539               100%.
540
541       status
542
543display (mixed) [no|short|long|<bool>]: How to display the
544               status label.
545
546       text
547
548commit-title-overflow (bool or int): Whether to highlight
549               commit titles exceeding a given width in the diff view. When
550               set to a boolean, it enables or disables the highlighting using
551               the default width of 50 character. When set to an int, the
552               assigned value is used as the maximum character width.
553
554       All column options can be toggled. For display options, use the option
555       name as the prefix followed by a dash and the column name. E.g. :toggle
556       author-display will toggle the display option in the author column. For
557       all other options use the column name followed by a dash and then the
558       option name as the suffix. E.g. :toggle commit-title-graph will toggle
559       the graph option in the commit-title column. Alternatively, use the
560       option menu to manipulate options.
561

BIND COMMAND

563       Using bind commands, keys can be mapped to an action when pressed in a
564       given key map. The syntax is:
565
566           bind keymap key action
567
568
569       Examples:
570
571           # Add keybinding to quickly jump to the next diff chunk in the stage view
572           bind stage <Enter> :/^@@
573
574           # Disable the default mapping for running git-gc
575           bind generic G none
576
577           # User-defined external command to amend the last commit
578           bind status + !git commit --amend
579
580           # User-defined internal command that reloads ~/.tigrc
581           bind generic S :source ~/.tigrc
582
583           # UTF8-encoded characters can be used as key values.
584           bind generic ø @sh -c "printf '%s' %(commit) | pbcopy"
585
586
587       Or in the Git configuration files:
588
589           [tig "bind"]
590                   # 'unbind' the default quit key binding
591                   main = Q none
592                   # Cherry-pick current commit onto current branch
593                   generic = C !git cherry-pick %(commit)
594
595
596       Keys are mapped by first searching the keybindings for the current
597       view, then the keybindings for the generic keymap, and last the default
598       keybindings. Thus, the view keybindings override the generic
599       keybindings which override the built-in keybindings.
600
601       Keybindings at the line-entry prompt are typically governed by the
602       readline library, and are configured separately in ~/.inputrc. See
603       readline(1). Tig respects but does not require an $if tig section in
604       ~/.inputrc.
605
606       Keymaps
607           Valid keymaps are: main, diff, log, reflog, help, pager, status,
608           stage, tree, blob, blame, refs, stash, grep and generic. Use
609           generic to set key mapping in all keymaps (which may still be
610           overridden by a specific view keybinding). Use search to define
611           keys for navigating search results during search.
612
613       Key values
614           Key values should never be quoted. Use either an ASCII or
615           UTF8-encoded character or one of the following symbolic key names.
616           Symbolic key names are case insensitive and starts with "<" and
617           ends with ">". Use <Hash> to bind to the # key, since the hash mark
618           is used as a comment character. Use <LessThan> to bind to the <
619           key.
620
621       <Enter>, <Space>, <Backspace>, <Tab>, <Escape> or <Esc>, <Left>,
622       <Right>, <Up>, <Down>, <Insert> or <Ins>, <Delete> or <Del>, <Hash>,
623       <LessThan> or <LT>, <Home>, <End>, <PageUp> or <PgUp>, <PageDown> or
624       <PgDown>, <ScrollBack> or <SBack>, <ScrollFwd> or <SFwd>, <ShiftTab> or
625       <BackTab>, <ShiftLeft>, <ShiftRight>, <ShiftDelete> or <ShiftDel>,
626       <ShiftHome>, <ShiftEnd>, <SingleQuote>, <DoubleQuote>, <F1> ... <F19>
627
628       To define key mappings with the Ctrl key, use <Ctrl-key>. In addition,
629       key combos consisting of an initial Escape key followed by a normal key
630       value can be bound using <Esc>key.
631
632       Examples:
633
634           bind main R             refresh
635           bind main <Down>        next
636           bind main <Ctrl-f>      scroll-page-down
637           bind main <Esc>o        options
638           bind main <ShiftTab>    parent
639
640
641       Notes
642
643       •   Tig reads keystrokes via ncurses and is subject to various
644           limitations. See ncurses(3x) and terminfo(5) (or termcap).
645
646       •   Ctrl-m and Ctrl-i cannot be bound as they conflict with Enter and
647           Tab respectively.
648
649       •   Case differences cannot be distinguished in control sequences such
650           as Ctrl-f and Ctrl-F.
651
652       •   Ctrl-<Space> is typically translated to Ctrl-@, which is available
653           for binding.
654
655       •   Only some subset of special symbolic keys such as <ShiftTab> will
656           be available in any given terminal emulator.
657
658       •   Ctrl-z is automatically used for process control and will suspend
659           Tig and open a subshell (use fg to reenter Tig).
660
661           Actions
662               Actions are either specified as user-defined commands (external
663               or internal) or using action names as described in the
664               following sections.
665
666   External user-defined command
667       These actions start with one or more of the following option flags
668       followed by the command that should be executed.
669
670
671       !   Run the command in the
672           foreground with output
673           shown.
674
675       @   Run the command in the
676           background with no output.
677
678       +   Run the command
679           synchronously, and echo
680           the first line of output
681           to the status bar.
682
683       ?   Prompt the user before
684           executing the command.
685
686       <   Exit Tig after executing
687           the command.
688
689       >   Re-open Tig instantly in
690           the last displayed view
691           after executing the
692           command.
693
694
695       Unless otherwise specified, commands are run in the foreground with
696       their console output shown (as if ! was specified). When multiple
697       command options are specified their behavior are combined, e.g. "?<git
698       commit" will prompt the user whether to execute the command and will
699       exit Tig after completion.
700
701       Note that if you want to use pipes or redirection in your commands then
702       you must run them in a subshell, i.e. embed your commands in sh -c
703       '<commands>'.
704
705       Browsing state variables
706           User-defined commands can optionally refer to Tig’s internal state
707           using the following variable names, which are substituted before
708           commands are run:
709
710
711           %(head)                       The currently viewed head
712                                         ID. Defaults to HEAD
713
714           %(commit)                     The currently selected
715                                         commit ID.
716
717           %(blob)                       The currently selected
718                                         blob ID.
719
720           %(branch)                     The currently selected
721                                         branch name.
722
723
724
725
726
727
728           %(remote)                     The currently selected
729                                         remote name. For remote
730                                         branches %(branch) will
731                                         contain the branch name.
732
733           %(tag)                        The currently selected tag
734                                         name.
735
736           %(refname)                    The currently selected
737                                         reference name including
738                                         the remote name for remote
739                                         branches.
740
741           %(stash)                      The currently selected
742                                         stash name.
743
744           %(directory)                  The current directory path
745                                         in the tree view or "." if
746                                         undefined.
747
748           %(file)                       The currently selected
749                                         file.
750
751           %(file_old)                   The old filename of the
752                                         currently selected file.
753
754           %(lineno)                     The currently selected
755                                         line number. Defaults to
756                                         0.
757
758           %(lineno_old)                 The currently selected
759                                         line number, before the
760                                         diff was applied. Defaults
761                                         to 0.
762
763           %(ref)                        The reference given to
764                                         blame or HEAD if
765                                         undefined.
766
767           %(revargs)                    The revision arguments
768                                         passed on the command
769                                         line.
770
771           %(fileargs)                   The file arguments passed
772                                         on the command line.
773
774           %(cmdlineargs)                All other options passed
775                                         on the command line.
776
777           %(diffargs)                   Options from diff-options
778                                         or TIG_DIFF_OPTS used by
779                                         the diff and stage view.
780
781           %(blameargs)                  Options from blame-options
782                                         used by the blame view.
783
784           %(logargs)                    Options from log-options
785                                         used by the log view.
786
787           %(mainargs)                   Options from main-options
788                                         used by the main view.
789
790
791
792
793
794           %(prompt)                     Prompt for the argument
795                                         value. Optionally specify
796                                         a custom prompt using
797                                         "%(prompt Enter branch
798                                         name: )"
799
800           %(text)                       The text of the currently
801                                         selected line.
802
803           %(repo:head)                  The name of the checked
804                                         out branch, e.g. master
805
806           %(repo:head-id)               The commit ID of the
807                                         checked out branch.
808
809           %(repo:remote)                The remote associated with
810                                         the checked out branch,
811                                         e.g. origin/master.
812
813           %(repo:cdup)                  The path to change
814                                         directory to the
815                                         repository root, e.g. ../
816
817           %(repo:prefix)                The path prefix of the
818                                         current work directory,
819                                         e.g subdir/.
820
821           %(repo:git-dir)               The path to the Git
822                                         directory, e.g.
823                                         /src/repo/.git.
824
825           %(repo:worktree)              The worktree path, if
826                                         defined.
827
828           %(repo:is-inside-work-tree)   Whether Tig is running
829                                         inside a work tree, either
830                                         true or false.
831
832
833           Examples:
834
835               # Save the current commit as a patch file when the user selects a commit
836               # in the main view and presses 'S'.
837               bind main S !git format-patch -1 %(commit)
838
839               # Create and checkout a new branch; specify custom prompt
840               bind main B ?git checkout -b "%(prompt Enter new branch name: )"
841
842               # Show commit statistics for the author under the cursor
843               bind main U +sh -c 'git --no-pager shortlog -s --author="$(git show -s --format=%aE %(commit))" </dev/tty'
844
845
846       Advanced shell-like commands
847           If your command requires use of dynamic features, such as
848           subshells, expansion of environment variables and process control,
849           this can be achieved by using a shell command:
850
851           Example 1. Configure a binding to copy the current commit ID to the
852           clipboard.
853
854               bind generic I @sh -c "echo -n %(commit) | xclip -selection c"
855
856
857
858           Or by using a combination of Git aliases and Tig external commands.
859           The following example entries can be put in either the .gitconfig
860           or .git/config file:
861
862           Example 2. Git configuration which binds Tig keys to Git command
863           aliases.
864
865               [alias]
866                       gitk-bg = !"gitk HEAD --not $(git rev-parse --remotes) &"
867                       publish = !"for i in origin public; do git push $i; done"
868               [tig "bind"]
869                       generic = V @git gitk-bg
870                       generic = > !git publish
871
872
873
874   Internal user-defined commands
875       Actions beginning with a : will be run and interpreted as internal
876       commands and act similar to commands run via Tig’s prompt. Valid
877       internal commands are configuration file options (as described in this
878       document) and pager view commands. Examples:
879
880           # Reload ~/.tigrc when 'S' is pressed
881           bind generic S :source .tigrc
882
883           # Change diff view to show all commit changes regardless of file limitations
884           bind diff F :set diff-options = --full-diff
885
886           # Show the output of git-reflog(1) in the pager view
887           bind generic W :!git reflog
888
889           # Search for previous diff (c)hunk and next diff header
890           bind stage 2 :?^@@
891           bind stage D :/^diff --(git|cc)
892
893           bind main I :toggle id                          # Show/hide the ID column
894           bind diff D :toggle diff-options --minimal      # Use minimal diff algorithm
895           bind diff [ :toggle diff-context -3             # Decrease context (-U arg)
896           bind diff ] :toggle diff-context +3             # Increase context
897           bind generic V :toggle split-view-height -10%   # Decrease split height
898
899
900       Similar to external commands, pager view commands can contain variable
901       names that will be substituted before the command is run.
902
903   Action names
904       Valid action names are described below. Note, all action names are
905       case-insensitive, and you may use -, _, and . interchangeably, e.g.
906       "view-main", "View.Main", and "VIEW_MAIN" are the same.
907
908       View switching
909           view-main     Show main view
910
911           view-diff     Show diff view
912
913           view-log      Show log view
914
915           view-reflog   Show reflog view
916
917           view-tree     Show tree view
918
919           view-blob     Show blob view
920
921           view-blame    Show blame view
922
923           view-refs     Show refs view
924
925
926           view-status   Show status view
927
928           view-stage    Show stage view
929
930           view-stash    Show stash view
931
932           view-grep     Show grep view
933
934           view-pager    Show pager view
935
936           view-help     Show help view
937
938
939       View manipulation
940           enter                Enter and open selected
941                                line
942
943           back                 Go back to the previous
944                                view state
945
946           next                 Move to next
947
948           previous             Move to previous
949
950           parent               Move to parent
951
952           view-next            Move focus to the next
953                                view
954
955           refresh              Reload and refresh view
956
957           maximize             Maximize the current view
958
959           view-close           Close the current view
960
961           view-close-no-quit   Close the current view
962                                without quitting
963
964           quit                 Close all views and quit
965
966
967       View-specific actions
968           status-update       Stage/unstage chunk or
969                               file changes
970
971           status-revert       Revert chunk or file
972                               changes
973
974           status-merge        Merge file using external
975                               tool
976
977           stage-update-line   Stage/unstage single line
978
979           stage-update-part   Stage/unstage part of a
980                               chunk
981
982           stage-split-chunk   Split current diff chunk
983
984
985       Cursor navigation
986           move-up               Move cursor one line up
987
988           move-down             Move cursor one line down
989
990
991
992           move-page-up          Move cursor one page up
993
994           move-page-down        Move cursor one page down
995
996           move-half-page-up     Move cursor half a page up
997
998           move-half-page-down   Move cursor half a page
999                                 down
1000
1001           move-first-line       Move cursor to first line
1002
1003           move-last-line        Move cursor to last line
1004
1005           move-next-merge       Move cursor to next merge
1006                                 commit
1007
1008           move-prev-merge       Move cursor to previous
1009                                 merge commit
1010
1011
1012       Scrolling
1013           scroll-line-up          Scroll one line up
1014
1015           scroll-line-down        Scroll one line down
1016
1017           scroll-page-up          Scroll one page up
1018
1019           scroll-page-down        Scroll one page down
1020
1021           scroll-half-page-up     Scroll half a page up
1022
1023           scroll-half-page-down   Scroll half a page down
1024
1025           scroll-first-col        Scroll to the first line
1026                                   columns
1027
1028           scroll-left             Scroll two columns left
1029
1030           scroll-right            Scroll two columns right
1031
1032
1033       Searching
1034           search        Search the view
1035
1036           search-back   Search backwards in the
1037                         view
1038
1039           find-next     Find next search match
1040
1041           find-prev     Find previous search match
1042
1043
1044       Misc
1045           edit            Open in editor
1046
1047           prompt          Open the prompt
1048
1049           options         Open the options menu
1050
1051           screen-redraw   Redraw the screen
1052
1053           stop-loading    Stop all loading views
1054
1055           show-version    Show version information
1056
1057
1058           none            Do nothing
1059
1060

COLOR COMMAND

1062       Color commands control highlighting and the user interface styles. If
1063       your terminal supports color, these commands can be used to assign
1064       foreground and background combinations to certain areas. Optionally, an
1065       attribute can be given as the last parameter. The syntax is:
1066
1067           color area fgcolor bgcolor [attributes]
1068
1069
1070       Examples:
1071
1072           # Override the default terminal colors to white on black.
1073           color default           white   black
1074           # Diff colors
1075           color diff-header       yellow  default
1076           color diff-index        blue    default
1077           color diff-chunk        magenta default
1078           color "Reported-by:"    green   default
1079           # View-specific color
1080           color tree.date         black   cyan    bold
1081
1082
1083       Or in the Git configuration files:
1084
1085           [tig "color"]
1086                   # A strange looking cursor line
1087                   cursor          = red   default underline
1088                   # UI colors
1089                   title-blur      = white blue
1090                   title-focus     = white blue    bold
1091           # View-specific color
1092           [tig "color.tree"]
1093                   date            = cyan  default bold
1094
1095
1096
1097       Area names
1098           Can be either a built-in area name or a custom quoted string. The
1099           latter allows custom color rules to be added for lines matching a
1100           quoted string. Valid built-in area names are described below. Note,
1101           all names are case-insensitive, and you may use -, and _
1102           interchangeably, e.g. "Diff-Header" and "DIFF_HEADER" are the same.
1103           View-specific colors can be defined by prefixing the view name to
1104           the area name, e.g. "stage.diff-chunk" and "diff.diff-chunk".
1105
1106       Color names
1107           Valid colors include: white, black, green, magenta, blue, cyan,
1108           yellow, red, default. Use default to refer to the default terminal
1109           colors, for example, to keep the background transparent when you
1110           are using a terminal with a transparent background.
1111
1112           Colors can also be specified using the keywords color0, color1,
1113           ..., colorN-1 (where N is the number of colors supported by your
1114           terminal). This is useful when you remap the colors for your
1115           display or want to enable colors supported by 88-color and
1116           256-color terminals. Note that the color prefix is optional. If you
1117           prefer, you can specify colors directly by their numbers 0, 1, ...,
1118           N-1 instead, just like in the configuration file of Git.
1119
1120       Attribute names
1121           Valid attributes include: normal, blink, bold, dim, reverse,
1122           standout, and underline. Note, not all attributes may be supported
1123           by the terminal.
1124
1125   UI colors
1126       The colors and attributes to be used for the text that is not
1127       highlighted or that specify the use of the default terminal colors can
1128       be controlled by setting the default color option.
1129
1130       Table 1. General
1131       default         Override default terminal
1132                       colors (see above).
1133
1134       cursor          The cursor line.
1135
1136       status          The status window showing
1137                       info messages.
1138
1139       title-focus     The title window for the
1140                       current view.
1141
1142       title-blur      The title window of any
1143                       backgrounded view.
1144
1145       search-result   Highlighted search result.
1146
1147       delimiter       Delimiter shown for
1148                       truncated lines.
1149
1150       header          The view header lines. Use
1151                       status.header to color the
1152                       staged, unstaged, and
1153                       untracked sections in the
1154                       status view. Use
1155                       help.header to color the
1156                       keymap sections in the
1157                       help view.
1158
1159       line-number     Line numbers.
1160
1161       id              The commit ID.
1162
1163       date            The author date.
1164
1165       author          The commit author.
1166
1167       mode            The file mode holding the
1168                       permissions and type.
1169
1170       overflow        Title text overflow.
1171
1172       directory       The directory name.
1173
1174       file            The file name.
1175
1176       file-size       File size.
1177
1178
1179       Table 2. Main view colors
1180       graph-commit     The commit dot in the
1181                        revision graph.
1182
1183
1184
1185
1186
1187
1188
1189
1190       palette-[0-13]   14 different colors, used
1191                        for distinguishing
1192                        branches or commits. By
1193                        default, the palette uses
1194                        the ASCII colors, where
1195                        the second half of them
1196                        have the bold attribute
1197                        enabled to give a brighter
1198                        color. Example: palette-0
1199                        = red
1200
1201       main-commit      The commit comment.
1202
1203       main-annotated   The commit comment of an
1204                        annotated commit.
1205
1206       main-head        Label of the current
1207                        branch.
1208
1209       main-remote      Label of a remote.
1210
1211       main-tracked     Label of the remote
1212                        tracked by the current
1213                        branch.
1214
1215       main-tag         Label of a signed tag.
1216
1217       main-local-tag   Label of a local tag.
1218
1219       main-ref         Label of any other
1220                        reference.
1221
1222       main-replace     Label of replaced
1223                        reference.
1224
1225
1226       Table 3. Status view
1227       stat-none        Empty status label.
1228
1229       stat-staged      Status flag of staged
1230                        files.
1231
1232       stat-unstaged    Status flag of unstaged
1233                        files.
1234
1235       stat-untracked   Status flag of untracked
1236                        files.
1237
1238
1239       Table 4. Help view
1240       help-group    Help group name.
1241
1242       help-action   Help action name.
1243
1244
1245   Highlighting
1246       Diff markup
1247           Options concerning diff start, chunks and lines added and deleted.
1248
1249       diff-header, diff-chunk, diff-stat, diff-add, diff-add2, diff-del,
1250       diff-del2, diff-add-highlight, diff-del-highlight
1251
1252       Enhanced Git diff markup
1253           Extra diff information emitted by the Git diff machinery, such as
1254           mode changes, rename detection, and similarity.
1255
1256       diff-oldmode, diff-newmode, diff-copy-from, diff-copy-to,
1257       diff-similarity, diff-index
1258
1259       Pretty print commit headers
1260           Commit diffs and the revision logs are usually formatted using
1261           pretty printed headers , unless --pretty=raw was given. This
1262           includes lines, such as merge info, commit ID, and author and
1263           committer date.
1264
1265       pp-refs, pp-reflog, pp-reflogmsg, pp-merge
1266
1267       Raw commit header
1268           Usually shown when --pretty=raw is given, however commit is pretty
1269           much omnipresent.
1270
1271       commit, parent, tree, author, committer
1272
1273       Commit message
1274           Most common trailer lines (e.g.  Signed-off-by) are colorized.
1275           Characters in the commit title exceeding a predefined width can be
1276           highlighted.
1277
1278       Tree markup
1279           Colors for information of the tree view.
1280
1281       tree-dir, tree-file
1282

SOURCE COMMAND

1284       Source commands make it possible to read additional configuration
1285       files. Sourced files are included in-place, meaning when a source
1286       command is encountered the file will be immediately read. Any commands
1287       later in the current configuration file will take precedence.
1288
1289       If the given path does not exist, tig will proceed with a warning. Give
1290       the -q parameter to suppress the warning.
1291
1292       The syntax is:
1293
1294           source [-q] path
1295
1296
1297       Examples:
1298
1299           source ~/.tig/colorscheme.tigrc
1300           source ~/.tig/keybindings.tigrc
1301
1302
1304       Copyright (c) 2006-2022 Jonas Fonseca <jonas.fonseca@gmail.com[1]>
1305
1306       This program is free software; you can redistribute it and/or modify it
1307       under the terms of the GNU General Public License as published by the
1308       Free Software Foundation; either version 2 of the License, or (at your
1309       option) any later version.
1310

SEE ALSO

1312       tig(1), tigmanual(7), git(7), git-config(1)
1313

NOTES

1315        1. jonas.fonseca@gmail.com
1316           mailto:jonas.fonseca@gmail.com
1317
1318
1319
1320Tig 2.5.7                         08/25/2022                          TIGRC(5)
Impressum