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       pager-autoscroll (bool)
322           Whether to scroll automatically the pager view while loading. Move
323           the cursor out of the last line to stop scrolling and back in to
324           resume.
325
326       pgrp (bool)
327           Make tig process-group leader when starting and clean all processes
328           when exiting. Off by default. Do not enable this option if you are
329           using a Zsh version affected by zsh-workers/43379. Run xclip with
330           setsid to keep clipboard content after exiting tig. If you are
331           using git-credential-cache helper, set option
332           credentialCache.ignoreSIGHUP.
333
334       start-on-head (bool)
335           Start with cursor on HEAD commit.
336
337       refresh-mode (mixed) [manual|auto|after-command|periodic|<bool>]
338           Configures how views are refreshed based on modifications to
339           watched files in the repository. When set to manual, nothing is
340           refreshed automatically. When set to auto, views are refreshed when
341           a modification is detected in another view. When set to
342           after-command only refresh after returning from an external
343           command. When set to periodic, visible views are refreshed
344           periodically using refresh-interval.
345
346       refresh-interval (int)
347           Interval in seconds between view refresh update checks when
348           refresh-mode is set to periodic.
349
350       file-args (args)
351           Command line arguments referring to files. These are filtered using
352           git-rev-parse(1).
353
354       rev-args (args)
355           Command line arguments referring to revisions. These are filtered
356           using git-rev-parse(1).
357
358   View settings
359       The view settings define the order and options for the different
360       columns of a view. Each view setting expects a space-separated list of
361       column specifications. Column specifications starts with the column
362       type, and can optionally be followed by a colon (:) and a list of
363       column options. E.g. the following column specification defines an
364       author column displaying the author email and with a fixed width of 20
365       characters: author:email,width=20.
366
367       The first option value in a column specification is always the display
368       option. When no display value is given, yes is assumed. For display
369       options expecting an enumerated value this will automatically resolve
370       to the default enum value. For example, file-name will automatically
371       have its display setting resolve to auto.
372
373       Specifications can also be given for a single column, for example to
374       override the defaults in the system tigrc file. To override a single
375       column, use the column name as a suffix after the view setting name,
376       e.g. main-view-date will allow to set the date in the main view.
377
378       Examples:
379
380           # Enable both ID and line numbers in the blame view
381           set blame-view = date:default author:full file-name:auto id:yes,color \
382                            line-number:yes,interval=5 text
383
384           # Change grep view to be similar to `git grep` format
385           set grep-view = file-name:yes line-number:yes,interval=1 text
386
387           # Show file sizes as units
388           set tree-view = line-number:no,interval=5 mode author:full \
389                           file-size:units date:default id:no file-name
390
391           # Show line numbers for every 10th line in the pager view
392           set pager-view = line-number:yes,interval=10 text
393
394           # Shorthands to change view settings for a previously defined column
395           set main-view-date = custom
396           set main-view-date-format = "%Y-%m-%d %H:%M"
397           set blame-view-line-number = no
398           # Use Git's default commit order, even when the commit graph is enabled.
399           set commit-order = default
400
401
402       The following list shows which the available view settings and what
403       column types they support:
404
405       blob-view, diff-view, log-view, pager-view, stage-view
406           line-number, text
407
408       blame-view
409           author, date, file-name, id, line-number, text
410
411       grep-view
412           file-name, line-number, text
413
414       main-view, reflog-view
415           author, date, commit-title, id, line-number, ref
416
417       refs-view
418           author, date, commit-title, id, line-number, ref
419
420       stash-view
421           author, date, commit-title, id, line-number
422
423       status-view
424           file-name, line-number, status
425
426       tree-view
427           author, date, id, file-name, file-size, line-number, mode
428
429       Supported column types and their respective column options:
430
431       author
432
433display (mixed) [full|abbreviated|email|email-user|<bool>]: How
434               to display author names. If set to "abbreviated" author
435               initials will be shown.
436
437width (int): Fixed width for the column. When set to a value
438               between 1 and 10, the author name will be abbreviated to the
439               author’s initials. When set to zero, the width is automatically
440               sized to fit the content.
441
442maxwidth (int): Maximum width of the column. Permit
443               automatically sizing content, up to this limit. Can be
444               specified either as the number of columns, e.g.  15, or as a
445               percentage of the view width, e.g.  20%, where the maximum is
446               100%.
447
448       commit-title
449
450graph (mixed) [no|v2|v1]: Whether to show the revision graph in
451               the main view on start-up. "v1" refers to the old graph
452               rendering, which is less accurate but faster and thus
453               recommended in large repositories. See also the line-graphics
454               options.
455
456refs (bool): Whether to show references (branches, tags, and
457               remotes) in the main view. Can be toggled.
458
459overflow (bool or int): Whether to highlight text in commit
460               titles exceeding a given width. When set to a boolean, it
461               enables or disables the highlighting using the default width of
462               50 character. When set to an int, the assigned value is used as
463               the maximum character width.
464
465       date
466
467display (mixed)
468               [relative|relative-compact|custom|default|<bool>]: How to
469               display dates. If set to "relative" or "relative-compact" a
470               relative date will be used, e.g. "2 minutes ago" or "2m". If
471               set to "custom", the strftime(3) string format specified in the
472               "format" option is used.
473
474local (bool): If true, use localtime(3) to convert to local
475               timezone. Note that relative dates always use local offsets.
476
477format (string): format string to pass to strftime(3) when
478               custom display mode has been selected.
479
480width (int): Fixed width for the column. When set to zero, the
481               width is automatically sized to fit the content.
482
483       file-name
484
485display (mixed) [auto|always|<bool>]: When to display file
486               names. If set to "auto" file names are shown only when needed,
487               e.g. when running: tig blame -C <file>.
488
489width (int): Width of the column. When set to zero, the width
490               is automatically sized to fit the content.
491
492maxwidth (int): Maximum width of the column. Permit
493               automatically sizing content, up to this limit. Can be
494               specified either as the number of columns, e.g.  15, or as a
495               percentage of the view width, e.g.  20%, where the maximum is
496               100%.
497
498       file-size
499
500display (mixed) [default|units|<bool>]: How to display file
501               sizes. When set to "units", sizes are shown using binary
502               prefixes, e.g. 12524 bytes is shown as "12.2K".
503
504width (int): Fixed width for the filename column. When set to
505               zero, the width is automatically sized to fit the content.
506
507       id
508
509display (bool): Whether to show commit IDs in the main view.
510
511width (int) : Fixed width for the commit ID column. When unset
512               Tig will use the value of core.abbrev if found. See
513               git-config(1) on how to set core.abbrev. When set to zero the
514               width is automatically sized to fit the content of reflog (e.g.
515               ref/stash@{4}) IDs and otherwise default to 7.
516
517       line-number
518
519display (bool): Whether to show line numbers.
520
521interval (int): Interval between line numbers.
522
523width (int): Fixed width for the column. When set to zero, the
524               width is automatically sized to fit the content.
525
526       mode
527
528display (bool): Whether to show file modes.
529
530width (int): Fixed width for the column. When set to zero, the
531               width is automatically sized to fit the content.
532
533       ref
534
535display (bool): Whether to show the reference name.
536
537width (int): Fixed width for the column. When set to zero, the
538               width is automatically sized to fit the content.
539
540maxwidth (int): Maximum width of the column. Permit
541               automatically sizing content, up to this limit. Can be
542               specified either as the number of columns, e.g.  15, or as a
543               percentage of the view width, e.g.  20%, where the maximum is
544               100%.
545
546       status
547
548display (mixed) [no|short|long|<bool>]: How to display the
549               status label.
550
551       text
552
553commit-title-overflow (bool or int): Whether to highlight
554               commit titles exceeding a given width in the diff view. When
555               set to a boolean, it enables or disables the highlighting using
556               the default width of 50 character. When set to an int, the
557               assigned value is used as the maximum character width.
558
559       All column options can be toggled. For display options, use the option
560       name as the prefix followed by a dash and the column name. E.g. :toggle
561       author-display will toggle the display option in the author column. For
562       all other options use the column name followed by a dash and then the
563       option name as the suffix. E.g. :toggle commit-title-graph will toggle
564       the graph option in the commit-title column. Alternatively, use the
565       option menu to manipulate options.
566

BIND COMMAND

568       Using bind commands, keys can be mapped to an action when pressed in a
569       given key map. The syntax is:
570
571           bind keymap key action
572
573
574       Examples:
575
576           # Add keybinding to quickly jump to the next diff chunk in the stage view
577           bind stage <Enter> :/^@@
578
579           # Disable the default mapping for running git-gc
580           bind generic G none
581
582           # User-defined external command to amend the last commit
583           bind status + !git commit --amend
584
585           # User-defined internal command that reloads ~/.tigrc
586           bind generic S :source ~/.tigrc
587
588           # UTF8-encoded characters can be used as key values.
589           bind generic ø @sh -c "printf '%s' %(commit) | pbcopy"
590
591
592       Or in the Git configuration files:
593
594           [tig "bind"]
595                   # 'unbind' the default quit key binding
596                   main = Q none
597                   # Cherry-pick current commit onto current branch
598                   generic = C !git cherry-pick %(commit)
599
600
601       Keys are mapped by first searching the keybindings for the current
602       view, then the keybindings for the generic keymap, and last the default
603       keybindings. Thus, the view keybindings override the generic
604       keybindings which override the built-in keybindings.
605
606       Keybindings at the line-entry prompt are typically governed by the
607       readline library, and are configured separately in ~/.inputrc. See
608       readline(1). Tig respects but does not require an $if tig section in
609       ~/.inputrc.
610
611       Keymaps
612           Valid keymaps are: main, diff, log, reflog, help, pager, status,
613           stage, tree, blob, blame, refs, stash, grep and generic. Use
614           generic to set key mapping in all keymaps (which may still be
615           overridden by a specific view keybinding). Use search to define
616           keys for navigating search results during search.
617
618       Key values
619           Key values should never be quoted. Use either an ASCII or
620           UTF8-encoded character or one of the following symbolic key names.
621           Symbolic key names are case insensitive and starts with "<" and
622           ends with ">". Use <Hash> to bind to the # key, since the hash mark
623           is used as a comment character. Use <LessThan> to bind to the <
624           key.
625
626       <Enter>, <Space>, <Backspace>, <Tab>, <Escape> or <Esc>, <Left>,
627       <Right>, <Up>, <Down>, <Insert> or <Ins>, <Delete> or <Del>, <Hash>,
628       <LessThan> or <LT>, <Home>, <End>, <PageUp> or <PgUp>, <PageDown> or
629       <PgDown>, <ScrollBack> or <SBack>, <ScrollFwd> or <SFwd>, <ShiftTab> or
630       <BackTab>, <ShiftLeft>, <ShiftRight>, <ShiftDelete> or <ShiftDel>,
631       <ShiftHome>, <ShiftEnd>, <SingleQuote>, <DoubleQuote>, <F1> ... <F19>
632
633       To define key mappings with the Ctrl key, use <Ctrl-key>. In addition,
634       key combos consisting of an initial Escape key followed by a normal key
635       value can be bound using <Esc>key.
636
637       Examples:
638
639           bind main R             refresh
640           bind main <Down>        next
641           bind main <Ctrl-f>      scroll-page-down
642           bind main <Esc>o        options
643           bind main <ShiftTab>    parent
644
645
646       Notes
647
648       •   Tig reads keystrokes via ncurses and is subject to various
649           limitations. See ncurses(3x) and terminfo(5) (or termcap).
650
651       •   Ctrl-m and Ctrl-i cannot be bound as they conflict with Enter and
652           Tab respectively.
653
654       •   Case differences cannot be distinguished in control sequences such
655           as Ctrl-f and Ctrl-F.
656
657       •   Ctrl-<Space> is typically translated to Ctrl-@, which is available
658           for binding.
659
660       •   Only some subset of special symbolic keys such as <ShiftTab> will
661           be available in any given terminal emulator.
662
663       •   Ctrl-z is automatically used for process control and will suspend
664           Tig and open a subshell (use fg to reenter Tig).
665
666           Actions
667               Actions are either specified as user-defined commands (external
668               or internal) or using action names as described in the
669               following sections.
670
671   External user-defined command
672       These actions start with one or more of the following option flags
673       followed by the command that should be executed.
674
675
676       !   Run the command in the
677           foreground with output
678           shown.
679
680       @   Run the command in the
681           background with no output.
682
683       +   Run the command
684           synchronously, and echo
685           the first line of output
686           to the status bar.
687
688       ?   Prompt the user before
689           executing the command.
690
691       <   Exit Tig after executing
692           the command.
693
694       >   Re-open Tig instantly in
695           the last displayed view
696           after executing the
697           command.
698
699
700       Unless otherwise specified, commands are run in the foreground with
701       their console output shown (as if ! was specified). When multiple
702       command options are specified their behavior are combined, e.g. "?<git
703       commit" will prompt the user whether to execute the command and will
704       exit Tig after completion.
705
706       Note that if you want to use pipes or redirection in your commands then
707       you must run them in a subshell, i.e. embed your commands in sh -c
708       '<commands>'.
709
710       Browsing state variables
711           User-defined commands can optionally refer to Tig’s internal state
712           using the following variable names, which are substituted before
713           commands are run:
714
715
716           %(head)                       The currently viewed head
717                                         ID. Defaults to HEAD
718
719           %(commit)                     The currently selected
720                                         commit ID.
721
722           %(blob)                       The currently selected
723                                         blob ID.
724
725
726
727
728           %(branch)                     The currently selected
729                                         branch name.
730
731           %(remote)                     The currently selected
732                                         remote name. For remote
733                                         branches %(branch) will
734                                         contain the branch name.
735
736           %(tag)                        The currently selected tag
737                                         name.
738
739           %(refname)                    The currently selected
740                                         reference name including
741                                         the remote name for remote
742                                         branches.
743
744           %(stash)                      The currently selected
745                                         stash name.
746
747           %(directory)                  The current directory path
748                                         in the tree view or "." if
749                                         undefined.
750
751           %(file)                       The currently selected
752                                         file.
753
754           %(file_old)                   The old filename of the
755                                         currently selected file.
756
757           %(lineno)                     The currently selected
758                                         line number. Defaults to
759                                         0.
760
761           %(lineno_old)                 The currently selected
762                                         line number, before the
763                                         diff was applied. Defaults
764                                         to 0.
765
766           %(ref)                        The reference given to
767                                         blame or HEAD if
768                                         undefined.
769
770           %(revargs)                    The revision arguments
771                                         passed on the command
772                                         line.
773
774           %(fileargs)                   The file arguments passed
775                                         on the command line.
776
777           %(cmdlineargs)                All other options passed
778                                         on the command line.
779
780           %(diffargs)                   Options from diff-options
781                                         or TIG_DIFF_OPTS used by
782                                         the diff and stage view.
783
784           %(blameargs)                  Options from blame-options
785                                         used by the blame view.
786
787           %(logargs)                    Options from log-options
788                                         used by the log view.
789
790           %(mainargs)                   Options from main-options
791                                         used by the main view.
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 column of the
801                                         currently 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           # Custom color
1082           color "/(note|warning|error):/" yellow  default bold
1083
1084
1085       Or in the Git configuration files:
1086
1087           [tig "color"]
1088                   # A strange looking cursor line
1089                   cursor          = red   default underline
1090                   # UI colors
1091                   title-blur      = white blue
1092                   title-focus     = white blue    bold
1093           # View-specific color
1094           [tig "color.tree"]
1095                   date            = cyan  default bold
1096
1097
1098
1099       Area names
1100           Can be either a built-in area name or a custom quoted string. The
1101           latter allows custom color rules to be added for lines matching a
1102           quoted string. Strings of the form "/.../" are interpreted as
1103           regular expressions. Valid built-in area names are described below.
1104           Note, all names are case-insensitive, and you may use -, and _
1105           interchangeably, e.g. "Diff-Header" and "DIFF_HEADER" are the same.
1106           View-specific colors can be defined by prefixing the view name to
1107           the area name, e.g. "stage.diff-chunk" and "diff.diff-chunk".
1108
1109       Color names
1110           Valid colors include: white, black, green, magenta, blue, cyan,
1111           yellow, red, default. Use default to refer to the default terminal
1112           colors, for example, to keep the background transparent when you
1113           are using a terminal with a transparent background.
1114
1115           Colors can also be specified using the keywords color0, color1,
1116           ..., colorN-1 (where N is the number of colors supported by your
1117           terminal). This is useful when you remap the colors for your
1118           display or want to enable colors supported by 88-color and
1119           256-color terminals. Note that the color prefix is optional. If you
1120           prefer, you can specify colors directly by their numbers 0, 1, ...,
1121           N-1 instead, just like in the configuration file of Git.
1122
1123       Attribute names
1124           Valid attributes include: normal, blink, bold, dim, reverse,
1125           standout, and underline. Note, not all attributes may be supported
1126           by the terminal.
1127
1128   UI colors
1129       The colors and attributes to be used for the text that is not
1130       highlighted or that specify the use of the default terminal colors can
1131       be controlled by setting the default color option.
1132
1133       Table 1. General
1134       default         Override default terminal
1135                       colors (see above).
1136
1137       cursor          The cursor line.
1138
1139       status          The status window showing
1140                       info messages.
1141
1142       title-focus     The title window for the
1143                       current view.
1144
1145       title-blur      The title window of any
1146                       backgrounded view.
1147
1148       search-result   Highlighted search result.
1149
1150       delimiter       Delimiter shown for
1151                       truncated lines.
1152
1153       header          The view header lines. Use
1154                       status.header to color the
1155                       staged, unstaged, and
1156                       untracked sections in the
1157                       status view. Use
1158                       help.header to color the
1159                       keymap sections in the
1160                       help view.
1161
1162       line-number     Line numbers.
1163
1164       id              The commit ID.
1165
1166       date            The author date.
1167
1168       author          The commit author.
1169
1170       mode            The file mode holding the
1171                       permissions and type.
1172
1173       overflow        Title text overflow.
1174
1175       directory       The directory name.
1176
1177       file            The file name.
1178
1179       file-size       File size.
1180
1181
1182       Table 2. Main view colors
1183       graph-commit     The commit dot in the
1184                        revision graph.
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.8                         02/04/2023                          TIGRC(5)
Impressum