1TIGRC(5) Tig Manual TIGRC(5)
2
3
4
6 tigrc - Tig configuration file
7
9 set variable = value
10 bind keymap key action
11 color area fgcolor bgcolor [attributes]
12 source path
13
14
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
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
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 pgrp (bool)
316 Make tig process-group leader when starting and clean all processes
317 when exiting. Off by default. Do not enable this option if you are
318 using a Zsh version affected by zsh-workers/43379. Run xclip with
319 setsid to keep clipboard content after exiting tig. If you are
320 using git-credential-cache helper, set option
321 credentialCache.ignoreSIGHUP.
322
323 start-on-head (bool)
324 Start with cursor on HEAD commit.
325
326 refresh-mode (mixed) [manual|auto|after-command|periodic|<bool>]
327 Configures how views are refreshed based on modifications to
328 watched files in the repository. When set to manual, nothing is
329 refreshed automatically. When set to auto, views are refreshed when
330 a modification is detected in another view. When set to
331 after-command only refresh after returning from an external
332 command. When set to periodic, visible views are refreshed
333 periodically using refresh-interval.
334
335 refresh-interval (int)
336 Interval in seconds between view refresh update checks when
337 refresh-mode is set to periodic.
338
339 file-args (args)
340 Command line arguments referring to files. These are filtered using
341 git-rev-parse(1).
342
343 rev-args (args)
344 Command line arguments referring to revisions. These are filtered
345 using git-rev-parse(1).
346
347 View settings
348 The view settings define the order and options for the different
349 columns of a view. Each view setting expects a space-separated list of
350 column specifications. Column specifications starts with the column
351 type, and can optionally be followed by a colon (:) and a list of
352 column options. E.g. the following column specification defines an
353 author column displaying the author email and with a fixed width of 20
354 characters: author:email,width=20.
355
356 The first option value in a column specification is always the display
357 option. When no display value is given, yes is assumed. For display
358 options expecting an enumerated value this will automatically resolve
359 to the default enum value. For example, file-name will automatically
360 have its display setting resolve to auto.
361
362 Specifications can also be given for a single column, for example to
363 override the defaults in the system tigrc file. To override a single
364 column, use the column name as a suffix after the view setting name,
365 e.g. main-view-date will allow to set the date in the main view.
366
367 Examples:
368
369 # Enable both ID and line numbers in the blame view
370 set blame-view = date:default author:full file-name:auto id:yes,color \
371 line-number:yes,interval=5 text
372
373 # Change grep view to be similar to `git grep` format
374 set grep-view = file-name:yes line-number:yes,interval=1 text
375
376 # Show file sizes as units
377 set tree-view = line-number:no,interval=5 mode author:full \
378 file-size:units date:default id:no file-name
379
380 # Show line numbers for every 10th line in the pager view
381 set pager-view = line-number:yes,interval=10 text
382
383 # Shorthands to change view settings for a previously defined column
384 set main-view-date = custom
385 set main-view-date-format = "%Y-%m-%d %H:%M"
386 set blame-view-line-number = no
387 # Use Git's default commit order, even when the commit graph is enabled.
388 set commit-order = default
389
390
391 The following list shows which the available view settings and what
392 column types they support:
393
394 blob-view, diff-view, log-view, pager-view, stage-view
395 line-number, text
396
397 blame-view
398 author, date, file-name, id, line-number, text
399
400 grep-view
401 file-name, line-number, text
402
403 main-view, reflog-view
404 author, date, commit-title, id, line-number, ref
405
406 refs-view
407 author, date, commit-title, id, line-number, ref
408
409 stash-view
410 author, date, commit-title, id, line-number
411
412 status-view
413 file-name, line-number, status
414
415 tree-view
416 author, date, id, file-name, file-size, line-number, mode
417
418 Supported column types and their respective column options:
419
420 author
421
422 · display (mixed) [full|abbreviated|email|email-user|<bool>]: How
423 to display author names. If set to "abbreviated" author
424 initials will be shown.
425
426 · width (int): Fixed width for the column. When set to a value
427 between 1 and 10, the author name will be abbreviated to the
428 author’s initials. When set to zero, the width is automatically
429 sized to fit the content.
430
431 · maxwidth (int): Maximum width of the column. Permit
432 automatically sizing content, up to this limit.
433
434 commit-title
435
436 · graph (mixed) [no|v2|v1]: Whether to show the revision graph in
437 the main view on start-up. "v1" refers to the old graph
438 rendering, which is less accurate but faster and thus
439 recommended in large repositories. See also the line-graphics
440 options.
441
442 · refs (bool): Whether to show references (branches, tags, and
443 remotes) in the main view. Can be toggled.
444
445 · overflow (bool or int): Whether to highlight text in commit
446 titles exceeding a given width. When set to a boolean, it
447 enables or disables the highlighting using the default width of
448 50 character. When set to an int, the assigned value is used as
449 the maximum character width.
450
451 date
452
453 · display (mixed)
454 [relative|relative-compact|custom|default|<bool>]: How to
455 display dates. If set to "relative" or "relative-compact" a
456 relative date will be used, e.g. "2 minutes ago" or "2m". If
457 set to "custom", the strftime(3) string format specified in the
458 "format" option is used.
459
460 · local (bool): If true, use localtime(3) to convert to local
461 timezone. Note that relative dates always use local offsets.
462
463 · format (string): format string to pass to strftime(3) when
464 custom display mode has been selected.
465
466 · width (int): Fixed width for the column. When set to zero, the
467 width is automatically sized to fit the content.
468
469 file-name
470
471 · display (mixed) [auto|always|<bool>]: When to display file
472 names. If set to "auto" file names are shown only when needed,
473 e.g. when running: tig blame -C <file>.
474
475 · width (int): Width of the column. When set to zero, the width
476 is automatically sized to fit the content.
477
478 · maxwidth (int): Maximum width of the column. Permit
479 automatically sizing content, up to this limit.
480
481 file-size
482
483 · display (mixed) [default|units|<bool>]: How to display file
484 sizes. When set to "units", sizes are shown using binary
485 prefixes, e.g. 12524 bytes is shown as "12.2K".
486
487 · width (int): Fixed width for the filename column. When set to
488 zero, the width is automatically sized to fit the content.
489
490 id
491
492 · display (bool): Whether to show commit IDs in the main view.
493
494 · width (int) : Fixed width for the commit ID column. When unset
495 Tig will use the value of core.abbrev if found. See
496 git-config(1) on how to set core.abbrev. When set to zero the
497 width is automatically sized to fit the content of reflog (e.g.
498 ref/stash@{4}) IDs and otherwise default to 7.
499
500 line-number
501
502 · display (bool): Whether to show line numbers.
503
504 · interval (int): Interval between line numbers.
505
506 · width (int): Fixed width for the column. When set to zero, the
507 width is automatically sized to fit the content.
508
509 mode
510
511 · display (bool): Whether to show file modes.
512
513 · width (int): Fixed width for the column. When set to zero, the
514 width is automatically sized to fit the content.
515
516 ref
517
518 · display (bool): Whether to show the reference name.
519
520 · width (int): Fixed width for the column. When set to zero, the
521 width is automatically sized to fit the content.
522
523 · maxwidth (int): Maximum width of the column. Permit
524 automatically sizing content, up to this limit.
525
526 status
527
528 · display (mixed) [no|short|long|<bool>]: How to display the
529 status label.
530
531 text
532
533 · commit-title-overflow (bool or int): Whether to highlight
534 commit titles exceeding a given width in the diff view. When
535 set to a boolean, it enables or disables the highlighting using
536 the default width of 50 character. When set to an int, the
537 assigned value is used as the maximum character width.
538
539 All column options can be toggled. For display options, use the option
540 name as the prefix followed by a dash and the column name. E.g. :toggle
541 author-display will toggle the display option in the author column. For
542 all other options use the column name followed by a dash and then the
543 option name as the suffix. E.g. :toggle commit-title-graph will toggle
544 the graph option in the commit-title column. Alternatively, use the
545 option menu to manipulate options.
546
548 Using bind commands, keys can be mapped to an action when pressed in a
549 given key map. The syntax is:
550
551 bind keymap key action
552
553
554 Examples:
555
556 # Add keybinding to quickly jump to the next diff chunk in the stage view
557 bind stage <Enter> :/^@@
558
559 # Disable the default mapping for running git-gc
560 bind generic G none
561
562 # User-defined external command to amend the last commit
563 bind status + !git commit --amend
564
565 # User-defined internal command that reloads ~/.tigrc
566 bind generic S :source ~/.tigrc
567
568 # UTF8-encoded characters can be used as key values.
569 bind generic ø @sh -c "printf '%s' %(commit) | pbcopy"
570
571
572 Or in the Git configuration files:
573
574 [tig "bind"]
575 # 'unbind' the default quit key binding
576 main = Q none
577 # Cherry-pick current commit onto current branch
578 generic = C !git cherry-pick %(commit)
579
580
581 Keys are mapped by first searching the keybindings for the current
582 view, then the keybindings for the generic keymap, and last the default
583 keybindings. Thus, the view keybindings override the generic
584 keybindings which override the built-in keybindings.
585
586 Keybindings at the line-entry prompt are typically governed by the
587 readline library, and are configured separately in ~/.inputrc. See
588 readline(1). Tig respects but does not require an $if tig section in
589 ~/.inputrc.
590
591 Keymaps
592 Valid keymaps are: main, diff, log, reflog, help, pager, status,
593 stage, tree, blob, blame, refs, stash, grep and generic. Use
594 generic to set key mapping in all keymaps. Use search to define
595 keys for navigating search results during search.
596
597 Key values
598 Key values should never be quoted. Use either an ASCII or
599 UTF8-encoded character or one of the following symbolic key names.
600 Symbolic key names are case insensitive and starts with "<" and
601 ends with ">". Use <Hash> to bind to the # key, since the hash mark
602 is used as a comment character. Use <LessThan> to bind to the <
603 key.
604
605 <Enter>, <Space>, <Backspace>, <Tab>, <Escape> or <Esc>, <Left>,
606 <Right>, <Up>, <Down>, <Insert> or <Ins>, <Delete> or <Del>, <Hash>,
607 <LessThan> or <LT>, <Home>, <End>, <PageUp> or <PgUp>, <PageDown> or
608 <PgDown>, <ScrollBack> or <SBack>, <ScrollFwd> or <SFwd>, <ShiftTab> or
609 <BackTab>, <ShiftLeft>, <ShiftRight>, <ShiftDelete> or <ShiftDel>,
610 <ShiftHome>, <ShiftEnd>, <SingleQuote>, <DoubleQuote>, <F1> ... <F19>
611
612 To define key mappings with the Ctrl key, use <Ctrl-key>. In addition,
613 key combos consisting of an initial Escape key followed by a normal key
614 value can be bound using <Esc>key.
615
616 Examples:
617
618 bind main R refresh
619 bind main <Down> next
620 bind main <Ctrl-f> scroll-page-down
621 bind main <Esc>o options
622 bind main <ShiftTab> parent
623
624
625 Notes
626
627 · Tig reads keystrokes via ncurses and is subject to various
628 limitations. See ncurses(3x) and terminfo(5) (or termcap).
629
630 · Ctrl-m and Ctrl-i cannot be bound as they conflict with Enter and
631 Tab respectively.
632
633 · Case differences cannot be distinguished in control sequences such
634 as Ctrl-f and Ctrl-F.
635
636 · Ctrl-<Space> is typically translated to Ctrl-@, which is available
637 for binding.
638
639 · Only some subset of special symbolic keys such as <ShiftTab> will
640 be available in any given terminal emulator.
641
642 · Ctrl-z is automatically used for process control and will suspend
643 Tig and open a subshell (use fg to reenter Tig).
644
645 Actions
646 Actions are either specified as user-defined commands (external
647 or internal) or using action names as described in the
648 following sections.
649
650 External user-defined command
651 These actions start with one or more of the following option flags
652 followed by the command that should be executed.
653
654
655 ! Run the command in the
656 foreground with output
657 shown.
658
659 @ Run the command in the
660 background with no output.
661
662 + Run the command
663 synchronously, and echo
664 the first line of output
665 to the status bar.
666
667 ? Prompt the user before
668 executing the command.
669
670 < Exit Tig after executing
671 the command.
672
673 > Re-open Tig instantly in
674 the last displayed view
675 after executing the
676 command.
677
678
679 Unless otherwise specified, commands are run in the foreground with
680 their console output shown (as if ! was specified). When multiple
681 command options are specified their behavior are combined, e.g. "?<git
682 commit" will prompt the user whether to execute the command and will
683 exit Tig after completion.
684
685 Browsing state variables
686 User-defined commands can optionally refer to Tig’s internal state
687 using the following variable names, which are substituted before
688 commands are run:
689
690
691 %(head) The currently viewed head
692 ID. Defaults to HEAD
693
694 %(commit) The currently selected
695 commit ID.
696
697 %(blob) The currently selected
698 blob ID.
699
700 %(branch) The currently selected
701 branch name.
702
703 %(remote) The currently selected
704 remote name. For remote
705 branches %(branch) will
706 contain the branch name.
707
708 %(tag) The currently selected tag
709 name.
710
711 %(refname) The currently selected
712 reference name including
713 the remote name for remote
714 branches.
715
716 %(stash) The currently selected
717 stash name.
718
719 %(directory) The current directory path
720 in the tree view or "." if
721 undefined.
722
723 %(file) The currently selected
724 file.
725
726 %(lineno) The currently selected
727 line number. Defaults to
728 0.
729
730 %(ref) The reference given to
731 blame or HEAD if
732 undefined.
733
734 %(revargs) The revision arguments
735 passed on the command
736 line.
737
738 %(fileargs) The file arguments passed
739 on the command line.
740
741 %(cmdlineargs) All other options passed
742 on the command line.
743
744 %(diffargs) Options from diff-options
745 or TIG_DIFF_OPTS used by
746 the diff and stage view.
747
748
749
750 %(blameargs) Options from blame-options
751 used by the blame view.
752
753 %(logargs) Options from log-options
754 used by the log view.
755
756 %(mainargs) Options from main-options
757 used by the main view.
758
759 %(prompt) Prompt for the argument
760 value. Optionally specify
761 a custom prompt using
762 "%(prompt Enter branch
763 name: )"
764
765 %(text) The text of the currently
766 selected line.
767
768 %(repo:head) The name of the checked
769 out branch, e.g. master
770
771 %(repo:head-id) The commit ID of the
772 checked out branch.
773
774 %(repo:remote) The remote associated with
775 the checked out branch,
776 e.g. origin/master.
777
778 %(repo:cdup) The path to change
779 directory to the
780 repository root, e.g. ../
781
782 %(repo:prefix) The path prefix of the
783 current work directory,
784 e.g subdir/.
785
786 %(repo:git-dir) The path to the Git
787 directory, e.g.
788 /src/repo/.git.
789
790 %(repo:worktree) The worktree path, if
791 defined.
792
793 %(repo:is-inside-work-tree) Whether Tig is running
794 inside a work tree, either
795 true or false.
796
797
798 Examples:
799
800 # Save the current commit as a patch file when the user selects a commit
801 # in the main view and presses 'S'.
802 bind main S !git format-patch -1 %(commit)
803
804 # Create and checkout a new branch; specify custom prompt
805 bind main B ?git checkout -b "%(prompt Enter new branch name: )"
806
807 # Show commit statistics for the author under the cursor
808 bind main U +sh -c 'git --no-pager shortlog -s --author="$(git show -s --format=%aE %(commit))" </dev/tty'
809
810
811 Advanced shell-like commands
812 If your command requires use of dynamic features, such as
813 subshells, expansion of environment variables and process control,
814 this can be achieved by using a shell command:
815
816 Example 1. Configure a binding to copy the current commit ID to the
817 clipboard.
818
819 bind generic I @sh -c "echo -n %(commit) | xclip -selection c"
820
821
822
823 Or by using a combination of Git aliases and Tig external commands.
824 The following example entries can be put in either the .gitconfig
825 or .git/config file:
826
827 Example 2. Git configuration which binds Tig keys to Git command
828 aliases.
829
830 [alias]
831 gitk-bg = !"gitk HEAD --not $(git rev-parse --remotes) &"
832 publish = !"for i in origin public; do git push $i; done"
833 [tig "bind"]
834 # @-prefix means that the console output will not be shown.
835 generic = V !@git gitk-bg
836 generic = > !git publish
837
838
839
840 Internal user-defined commands
841 Actions beginning with a : will be run and interpreted as internal
842 commands and act similar to commands run via Tig’s prompt. Valid
843 internal commands are configuration file options (as described in this
844 document) and pager view commands. Examples:
845
846 # Reload ~/.tigrc when 'S' is pressed
847 bind generic S :source .tigrc
848
849 # Change diff view to show all commit changes regardless of file limitations
850 bind diff F :set diff-options = --full-diff
851
852 # Show the output of git-reflog(1) in the pager view
853 bind generic W :!git reflog
854
855 # Search for previous diff (c)hunk and next diff header
856 bind stage 2 :?^@@
857 bind stage D :/^diff --(git|cc)
858
859 bind main I :toggle id # Show/hide the ID column
860 bind diff D :toggle diff-options --minimal # Use minimal diff algorithm
861 bind diff [ :toggle diff-context -3 # Decrease context (-U arg)
862 bind diff ] :toggle diff-context +3 # Increase context
863 bind generic V :toggle split-view-height -10% # Decrease split height
864
865
866 Similar to external commands, pager view commands can contain variable
867 names that will be substituted before the command is run.
868
869 Action names
870 Valid action names are described below. Note, all action names are
871 case-insensitive, and you may use -, _, and . interchangeably, e.g.
872 "view-main", "View.Main", and "VIEW_MAIN" are the same.
873
874 View switching
875 view-main Show main view
876
877 view-diff Show diff view
878
879 view-log Show log view
880
881 view-reflog Show reflog view
882
883 view-tree Show tree view
884
885
886 view-blob Show blob view
887
888 view-blame Show blame view
889
890 view-refs Show refs view
891
892 view-status Show status view
893
894 view-stage Show stage view
895
896 view-stash Show stash view
897
898 view-grep Show grep view
899
900 view-pager Show pager view
901
902 view-help Show help view
903
904
905 View manipulation
906 enter Enter and open selected
907 line
908
909 back Go back to the previous
910 view state
911
912 next Move to next
913
914 previous Move to previous
915
916 parent Move to parent
917
918 view-next Move focus to the next
919 view
920
921 refresh Reload and refresh view
922
923 maximize Maximize the current view
924
925 view-close Close the current view
926
927 view-close-no-quit Close the current view
928 without quitting
929
930 quit Close all views and quit
931
932
933 View-specific actions
934 status-update Stage/unstage chunk or
935 file changes
936
937 status-revert Revert chunk or file
938 changes
939
940 status-merge Merge file using external
941 tool
942
943 stage-update-line Stage/unstage single line
944
945 stage-split-chunk Split current diff chunk
946
947
948 Cursor navigation
949 move-up Move cursor one line up
950
951 move-down Move cursor one line down
952
953
954 move-page-down Move cursor one page down
955
956 move-page-up Move cursor half a page up
957
958 move-half-page-down Move cursor half a page
959 down
960
961 move-half-page-up Move cursor one page up
962
963 move-first-line Move cursor to first line
964
965 move-last-line Move cursor to last line
966
967 move-next-merge Move cursor to next merge
968 commit
969
970 move-prev-merge Move cursor to previous
971 merge commit
972
973
974 Scrolling
975 scroll-line-up Scroll one line up
976
977 scroll-line-down Scroll one line down
978
979 scroll-page-up Scroll one page up
980
981 scroll-page-down Scroll one page down
982
983 scroll-first-col Scroll to the first line
984 columns
985
986 scroll-left Scroll two columns left
987
988 scroll-right Scroll two columns right
989
990
991 Searching
992 search Search the view
993
994 search-back Search backwards in the
995 view
996
997 find-next Find next search match
998
999 find-prev Find previous search match
1000
1001
1002 Misc
1003 edit Open in editor
1004
1005 prompt Open the prompt
1006
1007 options Open the options menu
1008
1009 screen-redraw Redraw the screen
1010
1011 stop-loading Stop all loading views
1012
1013 show-version Show version information
1014
1015 none Do nothing
1016
1017
1019 Color commands control highlighting and the user interface styles. If
1020 your terminal supports color, these commands can be used to assign
1021 foreground and background combinations to certain areas. Optionally, an
1022 attribute can be given as the last parameter. The syntax is:
1023
1024 color area fgcolor bgcolor [attributes]
1025
1026
1027 Examples:
1028
1029 # Override the default terminal colors to white on black.
1030 color default white black
1031 # Diff colors
1032 color diff-header yellow default
1033 color diff-index blue default
1034 color diff-chunk magenta default
1035 color "Reported-by:" green default
1036 # View-specific color
1037 color tree.date black cyan bold
1038
1039
1040 Or in the Git configuration files:
1041
1042 [tig "color"]
1043 # A strange looking cursor line
1044 cursor = red default underline
1045 # UI colors
1046 title-blur = white blue
1047 title-focus = white blue bold
1048 # View-specific color
1049 [tig "color.tree"]
1050 date = cyan default bold
1051
1052
1053
1054 Area names
1055 Can be either a built-in area name or a custom quoted string. The
1056 latter allows custom color rules to be added for lines matching a
1057 quoted string. Valid built-in area names are described below. Note,
1058 all names are case-insensitive, and you may use -, and _
1059 interchangeably, e.g. "Diff-Header" and "DIFF_HEADER" are the same.
1060 View-specific colors can be defined by prefixing the view name to
1061 the area name, e.g. "stage.diff-chunk" and "diff.diff-chunk".
1062
1063 Color names
1064 Valid colors include: white, black, green, magenta, blue, cyan,
1065 yellow, red, default. Use default to refer to the default terminal
1066 colors, for example, to keep the background transparent when you
1067 are using a terminal with a transparent background.
1068
1069 Colors can also be specified using the keywords color0, color1,
1070 ..., colorN-1 (where N is the number of colors supported by your
1071 terminal). This is useful when you remap the colors for your
1072 display or want to enable colors supported by 88-color and
1073 256-color terminals. Note that the color prefix is optional. If you
1074 prefer, you can specify colors directly by their numbers 0, 1, ...,
1075 N-1 instead, just like in the configuration file of Git.
1076
1077 Attribute names
1078 Valid attributes include: normal, blink, bold, dim, reverse,
1079 standout, and underline. Note, not all attributes may be supported
1080 by the terminal.
1081
1082 UI colors
1083 The colors and attributes to be used for the text that is not
1084 highlighted or that specify the use of the default terminal colors can
1085 be controlled by setting the default color option.
1086
1087 Table 1. General
1088 default Override default terminal
1089 colors (see above).
1090
1091 cursor The cursor line.
1092
1093 status The status window showing
1094 info messages.
1095
1096 title-focus The title window for the
1097 current view.
1098
1099 title-blur The title window of any
1100 backgrounded view.
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
1157
1158
1159 main-head Label of the current
1160 branch.
1161
1162 main-remote Label of a remote.
1163
1164 main-tracked Label of the remote
1165 tracked by the current
1166 branch.
1167
1168 main-tag Label of a signed tag.
1169
1170 main-local-tag Label of a local tag.
1171
1172 main-ref Label of any other
1173 reference.
1174
1175 main-replace Label of replaced
1176 reference.
1177
1178
1179 Table 3. Status view
1180 stat-none Empty status label.
1181
1182 stat-staged Status flag of staged
1183 files.
1184
1185 stat-unstaged Status flag of unstaged
1186 files.
1187
1188 stat-untracked Status flag of untracked
1189 files.
1190
1191
1192 Table 4. Help view
1193 help-group Help group name.
1194
1195 help-action Help action name.
1196
1197
1198 Highlighting
1199 Diff markup
1200 Options concerning diff start, chunks and lines added and deleted.
1201
1202 diff-header, diff-chunk, diff-add, diff-add2, diff-del, diff-del2,
1203 diff-add-highlight, diff-del-highlight
1204
1205 Enhanced Git diff markup
1206 Extra diff information emitted by the Git diff machinery, such as
1207 mode changes, rename detection, and similarity.
1208
1209 diff-oldmode, diff-newmode, diff-copy-from, diff-copy-to,
1210 diff-similarity, diff-index
1211
1212 Pretty print commit headers
1213 Commit diffs and the revision logs are usually formatted using
1214 pretty printed headers , unless --pretty=raw was given. This
1215 includes lines, such as merge info, commit ID, and author and
1216 committer date.
1217
1218 pp-refs, pp-reflog, pp-reflogmsg, pp-merge
1219
1220 Raw commit header
1221 Usually shown when --pretty=raw is given, however commit is pretty
1222 much omnipresent.
1223
1224 commit, parent, tree, author, committer
1225
1226 Commit message
1227 Signed-off-by, Acked-by, Reviewed-by and Tested-by lines are
1228 colorized. Characters in the commit title exceeding a predefined
1229 width can be highlighted.
1230
1231 Tree markup
1232 Colors for information of the tree view.
1233
1234 tree-dir, tree-file
1235
1237 Source commands make it possible to read additional configuration
1238 files. Sourced files are included in-place, meaning when a source
1239 command is encountered the file will be immediately read. Any commands
1240 later in the current configuration file will take precedence.
1241
1242 If the given path does not exist, tig will proceed with a warning. Give
1243 the -q parameter to suppress the warning.
1244
1245 The syntax is:
1246
1247 source [-q] path
1248
1249
1250 Examples:
1251
1252 source ~/.tig/colorscheme.tigrc
1253 source ~/.tig/keybindings.tigrc
1254
1255
1257 Copyright (c) 2006-2014 Jonas Fonseca <jonas.fonseca@gmail.com[1]>
1258
1259 This program is free software; you can redistribute it and/or modify it
1260 under the terms of the GNU General Public License as published by the
1261 Free Software Foundation; either version 2 of the License, or (at your
1262 option) any later version.
1263
1265 tig(1), tigmanual(7), git(7), git-config(1)
1266
1268 1. jonas.fonseca@gmail.com
1269 mailto:jonas.fonseca@gmail.com
1270
1271
1272
1273Tig 2.5.1 04/08/2020 TIGRC(5)