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 GIT_EDITOR.
56
57       core.worktree
58           The path to the root of the working tree.
59
60       gui.encoding
61           The encoding to use for displaying of file content.
62
63       i18n.commitencoding
64           The encoding used for commits. The default is UTF-8.
65

SET COMMAND

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

BIND COMMAND

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

COLOR COMMAND

998       Color commands control highlighting and the user interface styles. If
999       your terminal supports color, these commands can be used to assign
1000       foreground and background combinations to certain areas. Optionally, an
1001       attribute can be given as the last parameter. The syntax is:
1002
1003           color area fgcolor bgcolor [attributes]
1004
1005
1006       Examples:
1007
1008           # Override the default terminal colors to white on black.
1009           color default           white   black
1010           # Diff colors
1011           color diff-header       yellow  default
1012           color diff-index        blue    default
1013           color diff-chunk        magenta default
1014           color "Reported-by:"    green   default
1015           # View-specific color
1016           color tree.date         black   cyan    bold
1017
1018
1019       Or in the Git configuration files:
1020
1021           [tig "color"]
1022                   # A strange looking cursor line
1023                   cursor          = red   default underline
1024                   # UI colors
1025                   title-blur      = white blue
1026                   title-focus     = white blue    bold
1027           # View-specific color
1028           [tig "color.tree"]
1029                   date            = cyan  default bold
1030
1031
1032
1033       Area names
1034           Can be either a built-in area name or a custom quoted string. The
1035           latter allows custom color rules to be added for lines matching a
1036           quoted string. Valid built-in area names are described below. Note,
1037           all names are case-insensitive, and you may use -, and _
1038           interchangeably, e.g. "Diff-Header" and "DIFF_HEADER" are the same.
1039           View-specific colors can be defined by prefixing the view name to
1040           the area name, e.g. "stage.diff-chunk" and "diff.diff-chunk".
1041
1042       Color names
1043           Valid colors include: white, black, green, magenta, blue, cyan,
1044           yellow, red, default. Use default to refer to the default terminal
1045           colors, for example, to keep the background transparent when you
1046           are using a terminal with a transparent background.
1047
1048           Colors can also be specified using the keywords color0, color1,
1049           ..., colorN-1 (where N is the number of colors supported by your
1050           terminal). This is useful when you remap the colors for your
1051           display or want to enable colors supported by 88-color and
1052           256-color terminals. Note that the color prefix is optional. If you
1053           prefer, you can specify colors directly by their numbers 0, 1, ...,
1054           N-1 instead, just like in the configuration file of Git.
1055
1056       Attribute names
1057           Valid attributes include: normal, blink, bold, dim, reverse,
1058           standout, and underline. Note, not all attributes may be supported
1059           by the terminal.
1060
1061   UI colors
1062       The colors and attributes to be used for the text that is not
1063       highlighted or that specify the use of the default terminal colors can
1064       be controlled by setting the default color option.
1065
1066       Table 1. General
1067       default         Override default terminal
1068                       colors (see above).
1069
1070       cursor          The cursor line.
1071
1072       status          The status window showing
1073                       info messages.
1074
1075       title-focus     The title window for the
1076                       current view.
1077
1078       title-blur      The title window of any
1079                       backgrounded view.
1080
1081       search-result   Highlighted search result.
1082
1083       delimiter       Delimiter shown for
1084                       truncated lines.
1085
1086
1087
1088
1089
1090       header          The view header lines. Use
1091                       status.header to color the
1092                       staged, unstaged, and
1093                       untracked sections in the
1094                       status view. Use
1095                       help.header to color the
1096                       keymap sections in the
1097                       help view.
1098
1099       line-number     Line numbers.
1100
1101       id              The commit ID.
1102
1103       date            The author date.
1104
1105       author          The commit author.
1106
1107       mode            The file mode holding the
1108                       permissions and type.
1109
1110       overflow        Title text overflow.
1111
1112       directory       The directory name.
1113
1114       file            The file name.
1115
1116       file-size       File size.
1117
1118
1119       Table 2. Main view colors
1120       graph-commit     The commit dot in the
1121                        revision graph.
1122
1123       palette-[0-13]   14 different colors, used
1124                        for distinguishing
1125                        branches or commits. By
1126                        default, the palette uses
1127                        the ASCII colors, where
1128                        the second half of them
1129                        have the bold attribute
1130                        enabled to give a brighter
1131                        color. Example: palette-0
1132                        = red
1133
1134       main-commit      The commit comment.
1135
1136       main-head        Label of the current
1137                        branch.
1138
1139       main-remote      Label of a remote.
1140
1141       main-tracked     Label of the remote
1142                        tracked by the current
1143                        branch.
1144
1145       main-tag         Label of a signed tag.
1146
1147       main-local-tag   Label of a local tag.
1148
1149       main-ref         Label of any other
1150                        reference.
1151
1152       main-replace     Label of replaced
1153                        reference.
1154
1155
1156       Table 3. Status view
1157       stat-none
1158                        Empty status label.
1159
1160       stat-staged      Status flag of staged
1161                        files.
1162
1163       stat-unstaged    Status flag of unstaged
1164                        files.
1165
1166       stat-untracked   Status flag of untracked
1167                        files.
1168
1169
1170       Table 4. Help view
1171       help-group    Help group name.
1172
1173       help-action   Help action name.
1174
1175
1176   Highlighting
1177       Diff markup
1178           Options concerning diff start, chunks and lines added and deleted.
1179
1180       diff-header, diff-chunk, diff-add, diff-add2, diff-del, diff-del2,
1181       diff-add-highlight, diff-del-highlight
1182
1183       Enhanced Git diff markup
1184           Extra diff information emitted by the Git diff machinery, such as
1185           mode changes, rename detection, and similarity.
1186
1187       diff-oldmode, diff-newmode, diff-copy-from, diff-copy-to,
1188       diff-similarity, diff-index
1189
1190       Pretty print commit headers
1191           Commit diffs and the revision logs are usually formatted using
1192           pretty printed headers , unless --pretty=raw was given. This
1193           includes lines, such as merge info, commit ID, and author and
1194           committer date.
1195
1196       pp-refs, pp-reflog, pp-reflogmsg, pp-merge
1197
1198       Raw commit header
1199           Usually shown when --pretty=raw is given, however commit is pretty
1200           much omnipresent.
1201
1202       commit, parent, tree, author, committer
1203
1204       Commit message
1205
1206           Signed-off-by, Acked-by, Reviewed-by and Tested-by lines are
1207           colorized. Characters in the commit title exceeding a predefined
1208           width can be highlighted.
1209
1210       Tree markup
1211           Colors for information of the tree view.
1212
1213       tree-dir, tree-file
1214

SOURCE COMMAND

1216       Source commands make it possible to read additional configuration
1217       files. Sourced files are included in-place, meaning when a source
1218       command is encountered the file will be immediately read. Any commands
1219       later in the current configuration file will take precedence.
1220
1221       If the given path does not exist, tig will proceed with a warning. Give
1222       the -q parameter to suppress the warning.
1223
1224       The syntax is:
1225
1226           source [-q] path
1227
1228
1229       Examples:
1230
1231           source ~/.tig/colorscheme.tigrc
1232           source ~/.tig/keybindings.tigrc
1233
1234
1236       Copyright (c) 2006-2014 Jonas Fonseca <jonas.fonseca@gmail.com[1]>
1237
1238       This program is free software; you can redistribute it and/or modify it
1239       under the terms of the GNU General Public License as published by the
1240       Free Software Foundation; either version 2 of the License, or (at your
1241       option) any later version.
1242

SEE ALSO

1244       tig(1), tigmanual(7), git(7), git-config(1)
1245

NOTES

1247        1. jonas.fonseca@gmail.com
1248           mailto:jonas.fonseca@gmail.com
1249
1250
1251
1252Tig 2.4.1                         07/26/2018                          TIGRC(5)
Impressum