add a %(text) variable
[tig.git] / doc / tigrc.5.adoc
blob4da4f5cb2b655e276bf106748f7045d496434a3f
1 tigrc(5)
2 ========
3 :docext: adoc
5 NAME
6 ----
7 tigrc - Tig configuration file
10 SYNOPSIS
11 --------
12 [verse]
13 _______________________________________________________________________
14 *set*   'variable' *=* 'value'
15 *bind*  'keymap' 'key' 'action'
16 *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
17 *source* 'path'
18 _______________________________________________________________________
21 DESCRIPTION
22 -----------
24 You can permanently set an option by putting it in the `~/.tigrc` file.  The
25 file consists of a series of 'commands'.  Each line of the file may contain
26 only one command.  Commands can span multiple lines if each line is
27 terminated by a backslash ('\') character. 
29 The hash mark ('#') is used as a 'comment' character. All text after the
30 comment character to the end of the line is ignored. You can use comments to
31 annotate your initialization file.
33 Certain options can be manipulated at runtime via the option menu. In
34 addition, options can also be toggled with the `:toggle` prompt command
35 or by entering the configuration command into the prompt.
37 Git configuration
38 -----------------
40 Alternatively to using `~/.tigrc`, Tig options can be set by putting them in
41 one of the Git configuration files, which are read by Tig on startup. See
42 'git-config(1)' for which files to use. The following example show the basic
43 syntax to use for settings, bindings and colors.
45 // TEST: gitconfig
46 --------------------------------------------------------------------------
47 [tig] show-changes = true
48 [tig "color"] cursor = yellow red bold 
49 [tig "bind"] generic = P parent
50 --------------------------------------------------------------------------
52 In addition to tig-specific options, the following Git options are read from
53 the Git configuration:
55 'color.*'::
57         Colors for the various UI types. Can be configured via the 'git-colors'
58         setting.
60 'core.abbrev'::
62         The width of the commit ID. See also 'id-width' option.
64 'core.editor'::
66         The editor command. Can be overridden by setting GIT_EDITOR.
68 'core.worktree'::
70         The path to the root of the working tree.
72 'gui.encoding'::
74         The encoding to use for displaying of file content.
76 'i18n.commitencoding'::
78         The encoding used for commits. The default is UTF-8.
80 Set command
81 -----------
83 A few selective variables can be configured via the set command. The syntax
84 is:
86 [verse]
87 *set* variables *=* value
89 Examples:
91 // TEST: tigrc
92 --------------------------------------------------------------------------
93 set commit-order = topo         # Order commits topologically
94 set git-colors = no             # Do not read Git's color settings.
95 set horizontal-scroll = 33%     # Scroll 33% of the view width
96 set blame-options = -C -C -C    # Blame lines from other files
98 # Wrap branch names with () and tags with <>
99 set reference-format = (branch) <tag>
101 # Configure blame view columns using command spanning multiple lines.
102 set blame-view = \
103         date:default \
104         author:abbreviated \
105         file-name:auto \
106         id:yes,color \
107         line-number:yes,interval=5 text
108 --------------------------------------------------------------------------
110 Or in the Git configuration files:
112 // TEST: gitconfig
113 --------------------------------------------------------------------------
114 [tig]
115         line-graphics = no      # Disable graphics characters
116         tab-size = 8            # Number of spaces per tab
117 --------------------------------------------------------------------------
119 The type of variables is either bool, int, string, or mixed.
121 Valid bool values::
123         To set a bool variable to true use either "1", "true", or "yes".
124         Any other value will set the variable to false.
126 Valid int values::
128         A non-negative integer.
130 Valid string values::
132         A string of characters. Optionally, use either ' or " as delimiters.
134 Valid mixed values::
136         These values are composites of the above types. The valid values are
137         specified in the description.
139 Variables
140 ~~~~~~~~~
142 The following variables can be set:
144 'diff-options' (string)::
146         A space separated string of diff options to use in the diff view.
147         git-show(1) is used for formatting and always passes --patch-with-stat.
148         This option overrides any options specified in the TIG_DIFF_OPTS
149         environment variable (described in manpage:tig[1]), but is itself
150         overridden by diff flags given on the command line invocation.
152 'blame-options' (string)::
154         A space separated string of default blame options. Can be used for
155         telling git-blame(1) how to detect the origin of lines. The options
156         are ignored when Tig is started in blame mode and given blame options
157         on the command line.
159 'log-options' (string)::
161         A space separated string of default options that should be passed to the
162         git-log(1) command used by the log view. Options can be overridden by
163         command line options. Used internally override custom `pretty.format'
164         settings that break the log view.
166 'main-options' (string)::
168         A space separated string of default options that should be passed to the
169         git-log(1) command used by the main view. Options can be overridden by
170         command line options.
172 'reference-format' (string)::
174         A space separated string of format strings used for formatting reference
175         names. Wrap the name of the reference type with the characters you would
176         like to use for formatting, e.g. `[tag]` and `<remote>`. If no format is
177         specified for `local-tag`, the format for `tag` is used. Similarly, if no
178         format is specified for `tracked-remote` the `remote` format is used.
179         Prefix with `hide:` to not show that reference type, e.g. `hide:remote`.
180         Supported reference types are:
181          - head                 : The current HEAD.
182          - tag                  : A signed tag.
183          - local-tag            : An unsigned tag.
184          - remote               : A remote.
185          - tracked-remote       : The remote tracked by current HEAD.
186          - replace              : A replaced reference.
187          - branch               : Any other reference.
189 'line-graphics' (mixed) [ascii|default|utf-8|<bool>]::
191         What type of character graphics for line drawing.
193 'horizontal-scroll' (mixed)::
195         Interval to scroll horizontally in each step. Can be specified either
196         as the number of columns, e.g. '5', or as a percentage of the view
197         width, e.g. '33%', where the maximum is 100%. For percentages it is
198         always ensured that at least one column is scrolled. The default is to
199         scroll '50%' of the view width.
201 'git-colors' (list)::
203         A space separated list of "key=value" pairs where the key is a Git color
204         name and the value is a Tig color name, e.g. "branch.current=main-head"
205         and "grep.filename=grep.file". Set to "no" to disable.
207 'show-notes' (mixed) [<reference>|<bool>]::
209         Whether to show notes for a commit. When set to a note reference the
210         reference is passed to `git show --notes=`. Notes are enabled by
211         default.
213 'show-changes' (bool)::
215         Whether to show staged and unstaged changes in the main view.
217 'vertical-split' (mixed) [auto|<bool>]::
219         Whether to split the view horizontally or vertically.
220         "auto" (which is the default) means that it will depend on the window
221         dimensions. When true vertical orientation is used, and false sets the
222         orientation to horizontal.
224 'split-view-height' (mixed)::
226         The height of the bottom view in a horizontally split display. Can be
227         specified either as the number of rows, e.g. '5', or as a percentage of
228         the view height, e.g. '80%', where the maximum is 100%. It is always
229         ensured that the smaller of the views is at least four rows high. The
230         default is '67%'.
232 'split-view-width' (mixed)::
234         Width of the right-most view in a vertically split display. Can be
235         specified either as the number of column, e.g. '5', or as a percentage
236         of the view width, e.g. '80%', where the maximum is 100%. It is always
237         ensured that the smaller of the views is at least four columns wide. The
238         default is '50%'.
240 'status-untracked-dirs' (bool)::
242         Show untracked directories contents in the status view (analog to
243         `git ls-files --directory` option). On by default.
245 'tab-size' (int)::
247         Number of spaces per tab. The default is 8 spaces.
249 'diff-context' (int)::
251         Number of context lines to show for diffs.
253 'ignore-space' (mixed) [no|all|some|at-eol|<bool>]::
255         Ignore space changes in diff view. By default no space changes are
256         ignored. Changing this to "all", "some" or "at-eol" is equivalent to
257         passing "--ignore-all-space", "--ignore-space" or
258         "--ignore-space-at-eol" respectively to `git diff` or `git show`.
260 'commit-order' (enum) [auto|default|topo|date|author-date|reverse]::
262         Commit ordering using the default (chronological reverse) order,
263         topological order, date order or reverse order. When set to "auto"
264         (which is the default), topological order is automatically used in the
265         main view when the commit graph is enabled. In repositories with a long
266         commit history it is advised to set this option to "default" to speed up
267         loading of the main view.
269 'ignore-case' (bool)::
271         Ignore case in searches. By default, the search is case sensitive.
273 'mailmap' (bool)::
275         Read canonical name and email addresses for authors and committers from
276         `.mailmap`. Off by default. See `git-shortlog(1)`.
278 'wrap-lines' (bool)::
280         Wrap long lines. By default, lines are not wrapped.
281         Not compatible with line numbers enabled.
283 'focus-child' (bool)::
285         Whether to focus the child view when it is opened. When disabled the
286         focus will remain in the parent view, avoiding reloads of the child
287         view when navigating the parent view. True by default.
289 'editor-line-number' (bool)::
291         Whether to pass the selected line number to the editor command. The
292         line number is passed as `+<line-number>` in front of the file name.
293         Example: `vim +10 tig.c`
295 'mouse' (bool)::
297         Whether to enable mouse support. Off by default since it makes selecting
298         text from the terminal less intuitive. When enabled hold down Shift (or
299         Option on Mac) to select text. Mouse support requires that ncurses
300         itself support mouse events.
302 'mouse-scroll' (int)::
304         Interval to scroll up or down using the mouse. The default is 3 lines.
305         Mouse support requires that ncurses itself support mouse events and that
306         you have enabled mouse support in ~/.tigrc with `set mouse = true`.
308 'refresh-mode' (mixed) [manual|auto|after-command|periodic|<bool>]::
310         Configures how views are refreshed based on modifications to watched
311         files in the repository. When set to 'manual', nothing is refreshed
312         automatically. When set to 'auto', views are refreshed when a
313         modification is detected. When set to 'after-command' only refresh after
314         returning from an external command. When set to 'periodic', visible
315         views are refreshed periodically using 'refresh-interval'.
317 'refresh-interval' (int)::
319         Interval in seconds between view refresh update checks when
320         'refresh-mode' is set to 'periodic'.
322 'file-args' (args)::
324         Command line arguments referring to files. These are filtered using
325         `git-rev-parse(1)`.
327 'rev-args' (args)::
329         Command line arguments referring to revisions. These are filtered using
330         `git-rev-parse(1)`.
332 View settings
333 ~~~~~~~~~~~~~
335 The view settings define the order and options for the different columns of a
336 view. Each view setting expects a space separated list of column specifications.
337 Column specifications starts with the column type, and can optionally be
338 followed by a colon (`:`) and a list of column options. E.g. the following
339 column specification defines an 'author' column displaying the author email and
340 with a maximum width of 20 characters: `author:email,width=20`.
342 The first option value in a column specification is always the 'display' option.
343 When no 'display' value is given, 'yes' is assumed. For 'display' options
344 expecting an enumerated value this will automatically resolve to the default
345 enum value. For example, `file-name` will automatically have its 'display'
346 setting resolve to 'auto'.
348 Specifications can also be given for a single column, for example to override
349 the defaults in the system tigrc file. To override a single column, use the
350 column name as a suffix after the view setting name, e.g. `main-view-date` will
351 allow to set the date in the main view.
353 Examples:
354 // TEST: tigrc
355 --------------------------------------------------------------------------
356 # Enable both ID and line numbers in the blame view
357 set blame-view = date:default author:full file-name:auto id:yes,color \
358                  line-number:yes,interval=5 text
360 # Change grep view to be similar to `git grep` format
361 set grep-view = file-name:yes line-number:yes,interval=1 text
363 # Show file sizes as units
364 set tree-view = line-number:no,interval=5 mode author:full \
365                 file-size:units date:default id:no file-name
367 # Show line numbers for every 10th line in the pager view
368 set pager-view = line-number:yes,interval=10 text
370 # Shorthands to change view settings for a previously defined column
371 set main-view-date = short
372 set blame-view-line-number = no
373 # Use Git's default commit order, even when the commit graph is enabled.
374 set commit-order = default
375 --------------------------------------------------------------------------
377 The following list shows which the available view settings and what column types
378 they support:
380 blob-view, diff-view, log-view, pager-view, stage-view:: line-number, text
381 blame-view:: author, date, file-name, id, line-number, text
382 grep-view:: file-name, line-number, text
383 main-view:: author, date, commit-title, id, line-number
384 refs-view:: author, date, commit-title, id, line-number, ref
385 stash-view:: author, date, commit-title, id, line-number
386 status-view:: file-name, line-number, status
387 tree-view:: author, date, id, file-name, file-size, line-number, mode
389 Supported column types and their respective column options:
391 author::
393         - 'display' (mixed) [full|abbreviated|email|email-user|<bool>]: How to
394           display author names. If set to "abbreviated" author initials will be
395           shown.
396         - 'width' (int): Width of the column. When set to a value between 1 and
397           10, the author name will be abbreviated to the author's initials.
398           When set to zero, the width is automatically sized to fit the content.
400 commit-title::
401         - 'graph' (mixed) [no|v2|v1]: Whether to show the revision graph in the
402           main view on start-up. "v1" refers to the old graph rendering, which
403           is less accurate but faster and thus recommended in large
404           repositories.  See also the 'line-graphics' options.
405         - 'refs' (bool): Whether to show references (branches, tags, and
406           remotes) in the main view. Can be toggled.
407         - 'overflow' (bool or int): Whether to highlight text in commit titles
408           exceeding a given width. When set to a boolean, it enables or disables
409           the highlighting using the default width of 50 character. When set to
410           an int, the assigned value is used as the maximum character width.
412 date::
413         - 'display' (mixed) [relative|short|default|local|<bool>]: How to
414           display dates. If set to "relative" a relative date will be used, e.g.
415           "2 minutes ago". If set to "short" no time information is shown.  If
416           set to "local", localtime(3) is used.
417         - 'width' (int): Width of the column. When set to zero, the width is
418           automatically sized to fit the content.
420 file-name::
421         - 'display' (mixed) [auto|always|<bool>]: When to display file names.
422           If set to "auto" file names are shown only when needed, e.g. when
423           running: tig blame -C <file>.
424         - 'width' (int): Width of the column. When set to zero, the width is
425           automatically sized to fit the content.
427 file-size::
428         - 'display' (mixed) [default|units|<bool>]: How to display file sizes.
429           When set to "units", sizes are shown using binary prefixes, e.g. 12524
430           bytes is shown as "12.2K".
431         - 'width' (int): Width of the filename column. When set to zero, the
432           width is automatically sized to fit the content.
434 id::
435         - 'display' (bool): Whether to show commit IDs in the main view.
436         - 'width' (int) : Width of the commit ID. When unset Tig will use the
437           value of 'core.abbrev' if found. See git-config(1) on how to set
438           'core.abbrev'. When set to zero the width is automatically sized to
439           fit the content of reflog (e.g.  `ref/stash@{4}`) IDs and otherwise
440           default to 7.
442 line-number::
443         - 'display' (bool): Whether to show line numbers.
444         - 'interval' (int): Interval between line numbers.
445         - 'width' (int): Width of the column. When set to zero, the width is
446           automatically sized to fit the content.
448 mode::
449         - 'display' (bool): Whether to show file modes.
450         - 'width' (int): Width of the column. When set to zero, the width is
451           automatically sized to fit the content.
453 ref::
454         - 'display' (bool): Whether to show the reference name.
455         - 'width' (int): Width of the column. When set to zero, the width is
456           automatically sized to fit the content.
458 status::
459         - 'display' (mixed) [no|short|long|<bool>]: How to display the status
460           label.
461         - 'width' (int): Width of the column. When set to zero, the width is
462           automatically sized to fit the content.
464 text::
465         - 'commit-title-overflow' (bool or int): Whether to highlight commit
466           titles exceeding a given width in the diff view. When set to a
467           boolean, it enables or disables the highlighting using the default
468           width of 50 character. When set to an int, the assigned value is used
469           as the maximum character width.
471 All column options can be toggled. For 'display' options, use the
472 option name as the prefix followed by a dash and the column name. E.g.
473 `:toggle author-display` will toggle the 'display' option in the 'author'
474 column. For all other options use the column name followed by a dash and
475 then the option name as the suffix. E.g. `:toggle commit-title-graph`
476 will toggle the 'graph' option in the 'commit-title' column. Alternatively,
477 use the option menu to manipulate options.
479 Bind command
480 ------------
482 Using bind commands, keys can be mapped to an action when pressed in a given
483 key map. The syntax is:
485 [verse]
486 *bind* 'keymap' 'key' 'action'
488 Examples:
489 // TEST: tigrc
490 --------------------------------------------------------------------------
491 # Add keybinding to quickly jump to the next diff chunk in the stage view
492 bind stage <Enter> :/^@@
494 # Disable the default mapping for running git-gc
495 bind generic G none
497 # User-defined external command to amend the last commit
498 bind status + !git commit --amend
500 # User-defined internal command that reloads ~/.tigrc
501 bind generic S :source ~/.tigrc
503 # UTF8-encoded characters can be used as key values.
504 bind generic Ã¸ @sh -c "printf '%s' %(commit) | pbcopy"
505 --------------------------------------------------------------------------
507 Or in the Git configuration files:
508 // TEST: gitconfig
509 --------------------------------------------------------------------------
510 [tig "bind"]
511         # 'unbind' the default quit key binding
512         main = Q none
513         # Cherry-pick current commit onto current branch
514         generic = C !git cherry-pick %(commit)
515 --------------------------------------------------------------------------
517 Keys are mapped by first searching the keybindings for the current view, then
518 the keybindings for the *generic* keymap, and last the default keybindings.
519 Thus, the view keybindings override the generic keybindings which override the
520 built-in keybindings.
524 Keymaps::
526 Valid keymaps are: *main*, *diff*, *log*, *help*, *pager*, *status*, *stage*,
527 *tree*, *blob*, *blame*, *refs*, *stash*, *grep* and *generic*. Use *generic*
528 to set key mapping in all keymaps. Use *search* to define keys for navigating
529 search results during search.
531 Key values::
533 Key values should never be quoted. Use either an ASCII or UTF8-encoded character
534 or one of the following symbolic key names. Symbolic key names are case
535 insensitive and starts with "<" and ends with ">". Use *<Hash>* to bind to the
536 `#` key, since the hash mark is used as a comment character. Use *<LessThan>* to
537 bind to the `<` key.
539 *<Enter>*, *<Space>*, *<Backspace>*, *<Tab>*, *<Escape>* or *<Esc>*, *<Left>*,
540 *<Right>*, *<Up>*, *<Down>*, *<Insert>* or *<Ins>*, *<Delete>* or *<Del>*,
541 *<Hash>*, *<LessThan>* or *<LT>*, *<Home>*, *<End>*, *<PageUp>* or *<PgUp>*,
542 *<PageDown>* or *<PgDown>*, *<F1>*, *<F2>*, *<F3>*, *<F4>*, *<F5>*, *<F6>*,
543 *<F7>*, *<F8>*, *<F9>*, *<F10>*, *<F11>*, *<F12>*.
545 To define key mappings with the `Ctrl` key, use `<Ctrl-key>`. In addition, key
546 combos consisting of an initial `Escape` key followed by a normal key value can
547 be bound using `<Esc>key`.
549 Examples:
550 // TEST: tigrc
551 --------------------------------------------------------------------------
552 bind main R             refresh
553 bind main <Down>        next
554 bind main <Ctrl-f>      scroll-page-down
555 bind main <Esc>o        options
556 --------------------------------------------------------------------------
558 Note that due to the way ncurses encodes `Ctrl` key mappings, `Ctrl-m` and
559 `Ctrl-i` cannot be bound as they conflict with 'Enter' and 'Tab' respectively.
560 Furthermore, ncurses does not allow to distinguish between `Ctrl-f` and
561 `Ctrl-F`. Finally, `Ctrl-z` is automatically used for process control and will
562 suspend Tig and open a subshell (use `fg` to reenter Tig).
564 Actions::
566 Actions are either specified as user-defined commands (external or internal) or
567 using action names as described in the following sections.
571 External user-defined command
572 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
574 These actions start with one or more of the following option flags followed by
575 the command that should be executed.
577 [frame="none",grid="none",cols="25<m,75<"]
578 |=============================================================================
579 |!                      |Run the command in the foreground with output shown.
580 |@                      |Run the command in the background with no output.
581 |?                      |Prompt the user before executing the command.
582 |<                      |Exit Tig after executing the command.
583 |=============================================================================
585 Unless otherwise specified, commands are run in the foreground with their
586 console output shown (as if '!' was specified). When multiple command options
587 are specified their behavior are combined, e.g. "?<git commit" will prompt the
588 user whether to execute the command and will exit Tig after completion.
590 Browsing state variables
591 ^^^^^^^^^^^^^^^^^^^^^^^^
593 User-defined commands can optionally refer to Tig's internal state using the
594 following variable names, which are substituted before commands are run:
596 [frame="none",grid="none",cols="25<m,75<"]
597 |=============================================================================
598 |%(head)                |The currently viewed 'head' ID. Defaults to HEAD
599 |%(commit)              |The currently selected commit ID.
600 |%(blob)                |The currently selected blob ID.
601 |%(branch)              |The currently selected branch name.
602 |%(remote)              |The currently selected remote name. For remote
603                          branches %(branch) will contain the branch name.
604 |%(tag)                 |The currently selected tag name.
605 |%(stash)               |The currently selected stash name.
606 |%(directory)           |The current directory path in the tree view or
607                          "." if undefined.
608 |%(file)                |The currently selected file.
609 |%(lineno)              |The currently selected line number. Defaults to 0.
610 |%(ref)                 |The reference given to blame or HEAD if undefined.
611 |%(revargs)             |The revision arguments passed on the command line.
612 |%(fileargs)            |The file arguments passed on the command line.
613 |%(cmdlineargs)         |All other options passed on the command line.
614 |%(diffargs)            |Options from 'diff-options' or 'TIG_DIFF_OPTS' used
615                          used by the diff view.
616 |%(blameargs)           |Options from 'blame-options' used by the blame view.
617 |%(logargs)             |Options from 'log-options' used by the log view.
618 |%(mainargs)            |Options from 'main-options' used by the main view.
619 |%(prompt)              |Prompt for the argument value. Optionally specify a
620                          custom prompt using `"%(prompt Enter branch name: )"`
621 |%(text)                |The text of the currently selected line.
622 |%(repo:head)           |The name of the checked out branch, e.g. `master`
623 |%(repo:head-id)        |The commit ID of the checked out branch.
624 |%(repo:remote)         |The remote associated with the checked out branch,
625                          e.g. `origin/master`.
626 |%(repo:cdup)           |The path to change directory to the repository root,
627                          e.g. `../`
628 |%(repo:prefix)         |The path prefix of the current work directory,
629                          e.g `subdir/`.
630 |%(repo:git-dir)        |The path to the Git directory, e.g. `/src/repo/.git`.
631 |%(repo:is-inside-work-tree)
632                         |Whether Tig is running inside a work tree,
633                          either `true` or `false`.
634 |=============================================================================
636 Examples:
637 // TEST: tigrc
638 --------------------------------------------------------------------------
639 # Save save the current commit as a patch file when the user selects a
640 # commit in the main view and presses 'S'.
641 bind main S !git format-patch -1 %(commit)
643 # Create and checkout a new branch; specify custom prompt
644 bind main B ?git checkout -b "%(prompt Enter new branch name: )"
645 --------------------------------------------------------------------------
647 Advanced shell-like commands
648 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
650 If your command requires use of dynamic features, such as subshells,
651 expansion of environment variables and process control, this can be achieved by
652 using a shell command:
654 .Configure a binding to copy the current commit ID to the clipboard.
655 // TEST: tigrc
656 --------------------------------------------------------------------------
657 bind generic I @sh -c "echo -n %(commit) | xclip -selection c"
658 --------------------------------------------------------------------------
660 Or by using a combination of Git aliases and Tig external commands. The
661 following example entries can be put in either the .gitconfig or .git/config
662 file:
664 .Git configuration which binds Tig keys to Git command aliases.
665 // TEST: gitconfig
666 --------------------------------------------------------------------------
667 [alias]
668         gitk-bg = !"gitk HEAD --not $(git rev-parse --remotes) &"
669         publish = !"for i in origin public; do git push $i; done"
670 [tig "bind"]
671         # @-prefix means that the console output will not be shown.
672         generic = V !@git gitk-bg
673         generic = > !git publish
674 --------------------------------------------------------------------------
676 Internal user-defined commands
677 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
679 Actions beginning with a ':' will be run and interpreted as internal commands
680 and act similar to commands run via Tig's prompt. Valid internal commands are
681 configuration file options (as described in this document) and pager view
682 commands. Examples:
684 // TEST: tigrc
685 --------------------------------------------------------------------------
686 # Reload ~/.tigrc when 'S' is pressed
687 bind generic S :source .tigrc
689 # Change diff view to show all commit changes regardless of file limitations
690 bind diff F :set diff-options = --full-diff
692 # Show the output of git-reflog(1) in the pager view
693 bind generic W :!git reflog
695 # Search for previous diff (c)hunk and next diff header
696 bind stage 2 :?^@@
697 bind stage D :/^diff --(git|cc)
699 bind main I :toggle id                          # Show/hide the ID column
700 bind diff D :toggle diff-options --minimal      # Use minimal diff algorithm
701 bind diff [ :toggle diff-context -3             # Decrease context (-U arg)
702 bind diff ] :toggle diff-context +3             # Increase context
703 bind generic V :toggle split-view-height -10%   # Decrease split height
704 --------------------------------------------------------------------------
706 Similar to external commands, pager view commands can contain variable names
707 that will be substituted before the command is run.
709 Action names
710 ~~~~~~~~~~~~
712 Valid action names are described below. Note, all action names are
713 case-insensitive, and you may use '-', '_', and '.' interchangeably, e.g.
714 "view-main", "View.Main", and "VIEW_MAIN" are the same.
716 ifndef::DOC_GEN_ACTIONS[]
717 View switching
718 ^^^^^^^^^^^^^^
720 [frame="none",grid="none",cols="25<m,75<"]
721 |=============================================================================
722 |view-main               |Show main view
723 |view-diff               |Show diff view
724 |view-log                |Show log view
725 |view-tree               |Show tree view
726 |view-blob               |Show blob view
727 |view-blame              |Show blame view
728 |view-refs               |Show refs view
729 |view-status             |Show status view
730 |view-stage              |Show stage view
731 |view-stash              |Show stash view
732 |view-grep               |Show grep view
733 |view-pager              |Show pager view
734 |view-help               |Show help view
735 |=============================================================================
737 View manipulation
738 ^^^^^^^^^^^^^^^^^
740 [frame="none",grid="none",cols="25<m,75<"]
741 |=============================================================================
742 |enter                   |Enter and open selected line
743 |back                    |Go back to the previous view state
744 |next                    |Move to next
745 |previous                |Move to previous
746 |parent                  |Move to parent
747 |view-next               |Move focus to the next view
748 |refresh                 |Reload and refresh view
749 |maximize                |Maximize the current view
750 |view-close              |Close the current view
751 |quit                    |Close all views and quit
752 |=============================================================================
754 View specific actions
755 ^^^^^^^^^^^^^^^^^^^^^
757 [frame="none",grid="none",cols="25<m,75<"]
758 |=============================================================================
759 |status-update           |Stage/unstage chunk or file changes
760 |status-revert           |Revert chunk or file changes
761 |status-merge            |Merge file using external tool
762 |stage-update-line       |Stage/unstage single line
763 |stage-split-chunk       |Split current diff chunk
764 |=============================================================================
766 Cursor navigation
767 ^^^^^^^^^^^^^^^^^
769 [frame="none",grid="none",cols="25<m,75<"]
770 |=============================================================================
771 |move-up                 |Move cursor one line up
772 |move-down               |Move cursor one line down
773 |move-page-down          |Move cursor one page down
774 |move-page-up            |Move cursor half a page up
775 |move-half-page-down     |Move cursor half a page down
776 |move-half-page-up       |Move cursor one page up
777 |move-first-line         |Move cursor to first line
778 |move-last-line          |Move cursor to last line
779 |=============================================================================
781 Scrolling
782 ^^^^^^^^^
784 [frame="none",grid="none",cols="25<m,75<"]
785 |=============================================================================
786 |scroll-line-up          |Scroll one line up
787 |scroll-line-down        |Scroll one line down
788 |scroll-page-up          |Scroll one page up
789 |scroll-page-down        |Scroll one page down
790 |scroll-first-col        |Scroll to the first line columns
791 |scroll-left             |Scroll two columns left
792 |scroll-right            |Scroll two columns right
793 |=============================================================================
795 Searching
796 ^^^^^^^^^
798 [frame="none",grid="none",cols="25<m,75<"]
799 |=============================================================================
800 |search                  |Search the view
801 |search-back             |Search backwards in the view
802 |find-next               |Find next search match
803 |find-prev               |Find previous search match
804 |=============================================================================
806 Misc
807 ^^^^
809 [frame="none",grid="none",cols="25<m,75<"]
810 |=============================================================================
811 |edit                    |Open in editor
812 |prompt                  |Open the prompt
813 |options                 |Open the options menu
814 |screen-redraw           |Redraw the screen
815 |stop-loading            |Stop all loading views
816 |show-version            |Show version information
817 |none                    |Do nothing
818 |=============================================================================
819 endif::DOC_GEN_ACTIONS[]
821 Color command
822 -------------
824 Color commands control highlighting and the user interface styles. If your
825 terminal supports color, these commands can be used to assign foreground and
826 background combinations to certain areas. Optionally, an attribute can be
827 given as the last parameter. The syntax is:
829 [verse]
830 *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
832 Examples:
833 // TEST: tigrc
834 ------------------------------------------------------------------------------
835 # Override the default terminal colors to white on black.
836 color default           white   black
837 # Diff colors
838 color diff-header       yellow  default
839 color diff-index        blue    default
840 color diff-chunk        magenta default
841 color "Reported-by:"    green   default
842 # View specific color
843 color tree.date         black   cyan    bold
844 --------------------------------------------------------------------------
846 Or in the Git configuration files:
847 // TEST: gitconfig
848 --------------------------------------------------------------------------
849 [tig "color"]
850         # A strange looking cursor line
851         cursor          = red   default underline
852         # UI colors
853         title-blur      = white blue
854         title-focus     = white blue    bold
855 # View specific color
856 [tig "color.tree"]
857         date            = cyan  default bold
858 ------------------------------------------------------------------------------
860 Area names::
862         Can be either a built-in area name or a custom quoted string. The
863         latter allows custom color rules to be added for lines matching a
864         quoted string.
865         Valid built-in area names are described below. Note, all names are
866         case-insensitive, and you may use '-', and '_' interchangeably,
867         e.g. "Diff-Header" and "DIFF_HEADER" are the same.
868         View specific colors can be defined by prefixing the view name to
869         the area name, e.g. "stage.diff-chunk" and "diff.diff-chunk".
871 Color names::
873         Valid colors include: *white*, *black*, *green*, *magenta*, *blue*,
874         *cyan*, *yellow*, *red*, *default*. Use *default* to refer to the
875         default terminal colors, for example, to keep the background
876         transparent when you are using a terminal with a transparent
877         background.
879 Colors can also be specified using the keywords *color0*, *color1*, ...,
880 *colorN-1* (where *N* is the number of colors supported by your terminal).
881 This is useful when you remap the colors for your display or want to enable
882 colors supported by 88-color and 256-color terminals. Note that the 'color'
883 prefix is optional. If you prefer, you can specify colors directly by their
884 numbers *0*, *1*, ..., *N-1* instead, just like in the configuration file of
885 Git.
887 Attribute names::
889         Valid attributes include: *normal*, *blink*, *bold*, *dim*, *reverse*,
890         *standout*, and *underline*. Note, not all attributes may be supported
891         by the terminal.
893 UI colors
894 ~~~~~~~~~
896 The colors and attributes to be used for the text that is not highlighted or
897 that specify the use of the default terminal colors can be controlled by
898 setting the *default* color option.
900 .General
901 [frame="none",grid="none",cols="25<m,75<"]
902 |=============================================================================
903 |default                |Override default terminal colors (see above).
904 |cursor                 |The cursor line.
905 |status                 |The status window showing info messages.
906 |title-focus            |The title window for the current view.
907 |title-blur             |The title window of any backgrounded view.
908 |search-result          |Highlighted search result.
909 |delimiter              |Delimiter shown for truncated lines.
910 |header                 |The view header lines. Use 'status.header' to color
911                          the staged, unstaged, and untracked sections in the
912                          status view. Use 'help.header' to color the keymap
913                          sections in the help view.
914 |line-number            |Line numbers.
915 |id                     |The commit ID.
916 |date                   |The author date.
917 |author                 |The commit author.
918 |mode                   |The file mode holding the permissions and type.
919 |overflow               |Title text overflow.
920 |directory              |The directory name.
921 |file                   |The file name.
922 |file-size              |File size.
923 |=============================================================================
925 .Main view colors
926 [frame="none",grid="none",cols="25<m,75<"]
927 |=============================================================================
928 |graph-commit           |The commit dot in the revision graph.
929 |palette-[0-13]         |14 different colors, used for distinguishing branches
930                          or commits. By default, the palette uses the ASCII
931                          colors, where the second half of them have the bold
932                          attribute enabled to give a brighter color.
933                          Example: palette-0 = red
934 |main-commit            |The commit comment.
935 |main-head              |Label of the current branch.
936 |main-remote            |Label of a remote.
937 |main-tracked           |Label of the remote tracked by the current branch.
938 |main-tag               |Label of a signed tag.
939 |main-local-tag         |Label of a local tag.
940 |main-ref               |Label of any other reference.
941 |main-replace           |Label of replaced reference.
942 |=============================================================================
944 .Status view
945 [frame="none",grid="none",cols="25<m,75<"]
946 |=============================================================================
947 |stat-none              |Empty status label.
948 |stat-staged            |Status flag of staged files.
949 |stat-unstaged          |Status flag of unstaged files.
950 |stat-untracked         |Status flag of untracked files.
951 |=============================================================================
953 .Help view
954 [frame="none",grid="none",cols="25<m,75<"]
955 |=============================================================================
956 |help-group             |Help group name.
957 |help-action            |Help action name.
958 |=============================================================================
960 Highlighting
961 ~~~~~~~~~~~~
965 Diff markup::
967 Options concerning diff start, chunks and lines added and deleted.
969 *diff-header*, *diff-chunk*, *diff-add*, *diff-add2*, *diff-del*,
970 *diff-del2*
972 Enhanced Git diff markup::
974 Extra diff information emitted by the Git diff machinery, such as mode
975 changes, rename detection, and similarity.
977 *diff-oldmode*, *diff-newmode*, *diff-copy-from*, *diff-copy-to*,
978 *diff-similarity*, *diff-index*
980 Pretty print commit headers::
982 Commit diffs and the revision logs are usually formatted using pretty printed
983 headers , unless `--pretty=raw` was given. This includes lines, such as merge
984 info, commit ID, and author and committer date.
986 *pp-refs*, *pp-reflog*, *pp-reflogmsg*, *pp-merge*
988 Raw commit header::
990 Usually shown when `--pretty=raw` is given, however 'commit' is pretty much
991 omnipresent.
993 *commit*, *parent*, *tree*, *author*, *committer*
995 Commit message::
997 `Signed-off-by`, `Acked-by`, `Reviewed-by` and `Tested-by` lines are colorized.
998 Characters in the commit title exceeding a predefined width can be highlighted.
1001 Tree markup::
1003 Colors for information of the tree view.
1005 *tree-dir*, *tree-file*
1009 Source command
1010 -------------
1012 Source commands make it possible to read additional configuration files.
1013 Sourced files are included in-place, meaning when a 'source' command is
1014 encountered the file will be immediately read. Any commands later in the
1015 current configuration file will take precedence. The syntax is:
1017 [verse]
1018 *source* 'path'
1020 Examples:
1021 // TEST: tigrc
1022 --------------------------------------------------------------------------
1023 source ~/.tig/colorscheme.tigrc
1024 source ~/.tig/keybindings.tigrc
1025 --------------------------------------------------------------------------
1027 COPYRIGHT
1028 ---------
1029 Copyright (c) 2006-2014 Jonas Fonseca <jonas.fonseca@gmail.com>
1031 This program is free software; you can redistribute it and/or modify
1032 it under the terms of the GNU General Public License as published by
1033 the Free Software Foundation; either version 2 of the License, or
1034 (at your option) any later version.
1036 SEE ALSO
1037 --------
1038 ifndef::backend-docbook[]
1039 link:tig.1.{docext}[tig(1)],
1040 link:manual.{docext}[the Tig manual],
1041 endif::backend-docbook[]
1042 ifdef::backend-docbook[]
1043 manpage:tig[1],
1044 manpage:tigmanual[7],
1045 endif::backend-docbook[]
1046 git(7), git-config(1)