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       show-untracked (bool)
199           Whether to show also untracked changes in the main view.
200
201       vertical-split (mixed) [auto|<bool>]
202           Whether to split the view horizontally or vertically. "auto" (which
203           is the default) means that it will depend on the window dimensions.
204           When true vertical orientation is used, and false sets the
205           orientation to horizontal.
206
207       split-view-height (mixed)
208           The height of the bottom view in a horizontally split display. Can
209           be specified either as the number of rows, e.g.  5, or as a
210           percentage of the view height, e.g.  80%, where the maximum is
211           100%. It is always ensured that the smaller of the views is at
212           least four rows high. The default is 67%.
213
214       split-view-width (mixed)
215           Width of the right-most view in a vertically split display. Can be
216           specified either as the number of column, e.g.  5, or as a
217           percentage of the view width, e.g.  80%, where the maximum is 100%.
218           It is always ensured that the smaller of the views is at least four
219           columns wide. The default is 50%.
220
221       status-show-untracked-dirs (bool)
222           Show untracked directories contents in the status view (analog to
223           git ls-files --directory option). On by default.
224
225       status-show-untracked-files (bool)
226           Show untracked files in the status view (mirrors Git’s
227           status.showUntrackedFiles option). On by default.
228
229       tab-size (int)
230           Number of spaces per tab. The default is 8 spaces.
231
232       diff-context (int)
233           Number of context lines to show for diffs.
234
235       diff-highlight (mixed)
236           Whether to highlight diffs using Git’s diff-highlight program.
237           Defaults to false. When set to true then diff-highlight is used,
238           else the option value is used as the path. When this option is in
239           effect, highlighted regions are governed by color
240           diff-add-highlight and color diff-del-highlight.
241
242       ignore-space (mixed) [no|all|some|at-eol|<bool>]
243           Ignore space changes in diff view. By default no space changes are
244           ignored. Changing this to "all", "some" or "at-eol" is equivalent
245           to passing "--ignore-all-space", "--ignore-space" or
246           "--ignore-space-at-eol" respectively to git diff or git show.
247
248
249           Warning: when ignore-space is set to some, all or at-eol, then the
250           status-update and status-revert may fail when updating or reverting
251           chunks containing lines with space changes. Similarly,
252           stage-update-line may fail when updating a line adjacent to a line
253           with space changes
254
255       commit-order (enum) [auto|default|topo|date|author-date|reverse]
256           Commit ordering using the default (chronological reverse) order,
257           topological order, date order or reverse order. When set to "auto"
258           (which is the default), topological order is automatically used in
259           the main view when the commit graph is enabled. In repositories
260           with a long commit history it is advised to set this option to
261           "default" to speed up loading of the main view.
262
263       ignore-case (enum) [no|yes|smart-case]
264           Ignore case in searches. "smart-case" ignores case if the search
265           string doesn’t contain any uppercase letters. By default, the
266           search is case sensitive.
267
268       mailmap (bool)
269           Read canonical name and email addresses for authors and committers
270           from .mailmap. Off by default. See git-shortlog(1).
271
272       wrap-lines (bool)
273           Wrap long lines. By default, lines are not wrapped. Not compatible
274           with line numbers enabled.
275
276       focus-child (bool)
277           Whether to focus the child view when it is opened. When disabled
278           the focus will remain in the parent view, avoiding reloads of the
279           child view when navigating the parent view. True by default.
280
281       send-child-enter (bool)
282           Whether to send "enter" key presses to the child view, even if
283           parent view is active. When disabled the child view has to be
284           explicitly focused to receive the "enter" key presses. In practice
285           only relevant when set focus-child = no. True by default.
286
287       editor-line-number (bool)
288           Whether to pass the selected line number to the editor command. The
289           line number is passed as +<line-number> in front of the file name.
290           Example: vim +10 tig.c
291
292       history-size (int)
293           Size of the persistent ~/.tig_history file when compiled with
294           readline support. Default is 500. Set to 0 to disable.
295
296       mouse (bool)
297           Whether to enable mouse support. Off by default since it makes
298           selecting text from the terminal less intuitive. When enabled hold
299           down Shift (or Option on Mac) to select text. Mouse support
300           requires that ncurses itself support mouse events.
301
302       mouse-scroll (int)
303           Interval to scroll up or down using the mouse. The default is 3
304           lines. Mouse support requires that ncurses itself support mouse
305           events and that you have enabled mouse support in ~/.tigrc with set
306           mouse = true.
307
308       mouse-wheel-cursor (bool)
309           Whether to prefer moving the cursor to scrolling the view when
310           using the mouse wheel. Off by default. Combines well with set
311           mouse-scroll = 1. Mouse support requires that ncurses itself
312           support mouse events and that you have enabled mouse support in
313           ~/.tigrc with set mouse = true.
314
315       start-on-head (bool)
316           Start with cursor on HEAD commit.
317
318       refresh-mode (mixed) [manual|auto|after-command|periodic|<bool>]
319           Configures how views are refreshed based on modifications to
320           watched files in the repository. When set to manual, nothing is
321           refreshed automatically. When set to auto, views are refreshed when
322           a modification is detected in another view. When set to
323           after-command only refresh after returning from an external
324           command. When set to periodic, visible views are refreshed
325           periodically using refresh-interval.
326
327       refresh-interval (int)
328           Interval in seconds between view refresh update checks when
329           refresh-mode is set to periodic.
330
331       file-args (args)
332           Command line arguments referring to files. These are filtered using
333           git-rev-parse(1).
334
335       rev-args (args)
336           Command line arguments referring to revisions. These are filtered
337           using git-rev-parse(1).
338
339   View settings
340       The view settings define the order and options for the different
341       columns of a view. Each view setting expects a space-separated list of
342       column specifications. Column specifications starts with the column
343       type, and can optionally be followed by a colon (:) and a list of
344       column options. E.g. the following column specification defines an
345       author column displaying the author email and with a fixed width of 20
346       characters: author:email,width=20.
347
348       The first option value in a column specification is always the display
349       option. When no display value is given, yes is assumed. For display
350       options expecting an enumerated value this will automatically resolve
351       to the default enum value. For example, file-name will automatically
352       have its display setting resolve to auto.
353
354       Specifications can also be given for a single column, for example to
355       override the defaults in the system tigrc file. To override a single
356       column, use the column name as a suffix after the view setting name,
357       e.g. main-view-date will allow to set the date in the main view.
358
359       Examples:
360
361           # Enable both ID and line numbers in the blame view
362           set blame-view = date:default author:full file-name:auto id:yes,color \
363                            line-number:yes,interval=5 text
364
365           # Change grep view to be similar to `git grep` format
366           set grep-view = file-name:yes line-number:yes,interval=1 text
367
368           # Show file sizes as units
369           set tree-view = line-number:no,interval=5 mode author:full \
370                           file-size:units date:default id:no file-name
371
372           # Show line numbers for every 10th line in the pager view
373           set pager-view = line-number:yes,interval=10 text
374
375           # Shorthands to change view settings for a previously defined column
376           set main-view-date = custom
377           set main-view-date-format = "%Y-%m-%d %H:%M"
378           set blame-view-line-number = no
379           # Use Git's default commit order, even when the commit graph is enabled.
380           set commit-order = default
381
382
383       The following list shows which the available view settings and what
384       column types they support:
385
386       blob-view, diff-view, log-view, pager-view, stage-view
387           line-number, text
388
389       blame-view
390           author, date, file-name, id, line-number, text
391
392       grep-view
393           file-name, line-number, text
394
395       main-view, reflog-view
396           author, date, commit-title, id, line-number, ref
397
398       refs-view
399           author, date, commit-title, id, line-number, ref
400
401       stash-view
402           author, date, commit-title, id, line-number
403
404       status-view
405           file-name, line-number, status
406
407       tree-view
408           author, date, id, file-name, file-size, line-number, mode
409
410       Supported column types and their respective column options:
411
412       author
413
414           ·   display (mixed) [full|abbreviated|email|email-user|<bool>]: How
415               to display author names. If set to "abbreviated" author
416               initials will be shown.
417
418           ·   width (int): Fixed width for the column. When set to a value
419               between 1 and 10, the author name will be abbreviated to the
420               author’s initials. When set to zero, the width is automatically
421               sized to fit the content.
422
423           ·   maxwidth (int): Maximum width of the column. Permit
424               automatically sizing content, up to this limit.
425
426       commit-title
427
428           ·   graph (mixed) [no|v2|v1]: Whether to show the revision graph in
429               the main view on start-up. "v1" refers to the old graph
430               rendering, which is less accurate but faster and thus
431               recommended in large repositories. See also the line-graphics
432               options.
433
434           ·   refs (bool): Whether to show references (branches, tags, and
435               remotes) in the main view. Can be toggled.
436
437           ·   overflow (bool or int): Whether to highlight text in commit
438               titles exceeding a given width. When set to a boolean, it
439               enables or disables the highlighting using the default width of
440               50 character. When set to an int, the assigned value is used as
441               the maximum character width.
442
443       date
444
445           ·   display (mixed)
446               [relative|relative-compact|custom|default|<bool>]: How to
447               display dates. If set to "relative" or "relative-compact" a
448               relative date will be used, e.g. "2 minutes ago" or "2m". If
449               set to "custom", the strftime(3) string format specified in the
450               "format" option is used.
451
452           ·   local (bool): If true, use localtime(3) to convert to local
453               timezone. Note that relative dates always use local offsets.
454
455           ·   format (string): format string to pass to strftime(3) when
456               custom display mode has been selected.
457
458           ·   width (int): Fixed width for the column. When set to zero, the
459               width is automatically sized to fit the content.
460
461       file-name
462
463           ·   display (mixed) [auto|always|<bool>]: When to display file
464               names. If set to "auto" file names are shown only when needed,
465               e.g. when running: tig blame -C <file>.
466
467           ·   width (int): Width of the column. When set to zero, the width
468               is automatically sized to fit the content.
469
470           ·   maxwidth (int): Maximum width of the column. Permit
471               automatically sizing content, up to this limit.
472
473       file-size
474
475           ·   display (mixed) [default|units|<bool>]: How to display file
476               sizes. When set to "units", sizes are shown using binary
477               prefixes, e.g. 12524 bytes is shown as "12.2K".
478
479           ·   width (int): Fixed width for the filename column. When set to
480               zero, the width is automatically sized to fit the content.
481
482       id
483
484           ·   display (bool): Whether to show commit IDs in the main view.
485
486           ·   width (int) : Fixed width for the commit ID column. When unset
487               Tig will use the value of core.abbrev if found. See
488               git-config(1) on how to set core.abbrev. When set to zero the
489               width is automatically sized to fit the content of reflog (e.g.
490               ref/stash@{4}) IDs and otherwise default to 7.
491
492       line-number
493
494           ·   display (bool): Whether to show line numbers.
495
496           ·   interval (int): Interval between line numbers.
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       mode
502
503           ·   display (bool): Whether to show file modes.
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       ref
509
510           ·   display (bool): Whether to show the reference name.
511
512           ·   width (int): Fixed width for the column. When set to zero, the
513               width is automatically sized to fit the content.
514
515           ·   maxwidth (int): Maximum width of the column. Permit
516               automatically sizing content, up to this limit.
517
518       status
519
520           ·   display (mixed) [no|short|long|<bool>]: How to display the
521               status label.
522
523       text
524
525           ·   commit-title-overflow (bool or int): Whether to highlight
526               commit titles exceeding a given width in the diff view. When
527               set to a boolean, it enables or disables the highlighting using
528               the default width of 50 character. When set to an int, the
529               assigned value is used as the maximum character width.
530
531       All column options can be toggled. For display options, use the option
532       name as the prefix followed by a dash and the column name. E.g. :toggle
533       author-display will toggle the display option in the author column. For
534       all other options use the column name followed by a dash and then the
535       option name as the suffix. E.g. :toggle commit-title-graph will toggle
536       the graph option in the commit-title column. Alternatively, use the
537       option menu to manipulate options.
538

BIND COMMAND

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

COLOR COMMAND

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

SOURCE COMMAND

1236       Source commands make it possible to read additional configuration
1237       files. Sourced files are included in-place, meaning when a source
1238       command is encountered the file will be immediately read. Any commands
1239       later in the current configuration file will take precedence.
1240
1241       If the given path does not exist, tig will proceed with a warning. Give
1242       the -q parameter to suppress the warning.
1243
1244       The syntax is:
1245
1246           source [-q] path
1247
1248
1249       Examples:
1250
1251           source ~/.tig/colorscheme.tigrc
1252           source ~/.tig/keybindings.tigrc
1253
1254
1256       Copyright (c) 2006-2014 Jonas Fonseca <jonas.fonseca@gmail.com[1]>
1257
1258       This program is free software; you can redistribute it and/or modify it
1259       under the terms of the GNU General Public License as published by the
1260       Free Software Foundation; either version 2 of the License, or (at your
1261       option) any later version.
1262

SEE ALSO

1264       tig(1), tigmanual(7), git(7), git-config(1)
1265

NOTES

1267        1. jonas.fonseca@gmail.com
1268           mailto:jonas.fonseca@gmail.com
1269
1270
1271
1272Tig 2.5.0                         11/16/2019                          TIGRC(5)
Impressum