parse_view_config: drop unused variables
[tig.git] / doc / tigrc.5.adoc
blob99940e4cd807bf0c46595c9c2284fdb24ad8a53e
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 Git configuration
34 -----------------
36 Alternatively to using `~/.tigrc`, Tig options can be set by putting them in
37 one of the Git configuration files, which are read by Tig on startup. See
38 'git-config(1)' for which files to use. The following example show the basic
39 syntax to use for settings, bindings and colors.
41 // TEST: gitconfig
42 --------------------------------------------------------------------------
43 [tig] show-changes = true
44 [tig "color"] cursor = yellow red bold 
45 [tig "bind"] generic = P parent
46 --------------------------------------------------------------------------
48 In addition to tig-specific options, the following Git options are read from
49 the Git configuration:
51 'color.*'::
53         Colors for the various UI types. Can be configured via the 'git-colors'
54         setting.
56 'core.abbrev'::
58         The width of the commit ID. See also 'id-width' option.
60 'core.editor'::
62         The editor command. Can be overridden by setting GIT_EDITOR.
64 'core.worktree'::
66         The path to the root of the working tree.
68 'gui.encoding'::
70         The encoding to use for displaying of file content.
72 'i18n.commitencoding'::
74         The encoding used for commits. The default is UTF-8.
76 Set command
77 -----------
79 A few selective variables can be configured via the set command. The syntax
80 is:
82 [verse]
83 *set* variables *=* value
85 Examples:
87 // TEST: tigrc
88 --------------------------------------------------------------------------
89 set commit-order = topo         # Order commits topologically
90 set git-colors = no             # Do not read Git's color settings.
91 set horizontal-scroll = 33%     # Scroll 33% of the view width
92 set blame-options = -C -C -C    # Blame lines from other files
94 # Wrap branch names with () and tags with <>
95 set reference-format = (branch) <tag>
97 # Configure blame view columns using command spanning multiple lines.
98 set blame-view = \
99         date:default \
100         author:abbreviated \
101         file-name:auto \
102         id:yes,color \
103         line-number:yes,interval=5 text
104 --------------------------------------------------------------------------
106 Or in the Git configuration files:
108 // TEST: gitconfig
109 --------------------------------------------------------------------------
110 [tig]
111         line-graphics = no      # Disable graphics characters
112         tab-size = 8            # Number of spaces per tab
113 --------------------------------------------------------------------------
115 The type of variables is either bool, int, string, or mixed.
117 Valid bool values::
119         To set a bool variable to true use either "1", "true", or "yes".
120         Any other value will set the variable to false.
122 Valid int values::
124         A non-negative integer.
126 Valid string values::
128         A string of characters. Optionally, use either ' or " as delimiters.
130 Valid mixed values::
132         These values are composites of the above types. The valid values are
133         specified in the description.
135 Variables
136 ~~~~~~~~~
138 The following variables can be set:
140 'diff-options' (string)::
142         A space separated string of diff options to use in the diff view.
143         git-show(1) is used for formatting and always passes --patch-with-stat.
144         This option overrides any options specified in the TIG_DIFF_OPTS
145         environment variable (described in manpage:tig[1]), but is itself
146         overridden by diff flags given on the command line invocation.
148 'blame-options' (string)::
150         A space separated string of extra blame options. Can be used for
151         telling git-blame(1) how to detect the origin of lines. The value
152         is ignored when Tig is started in blame mode and given blame options
153         on the command line.
155 'reference-format' (string)::
157         A space separated string of format strings used for formatting reference
158         names. Wrap the name of the reference type with the characters you would
159         like to use for formatting, e.g. `[tag]` and `<remote>`. If no format is
160         specified for `local-tag`, the format for `tag` is used. Similarly, if no
161         format is specified for `tracked-remote` the `remote` format is used.
162         Prefix with `hide:` to not show that reference type, e.g. `hide:remote`.
163         Supported reference types are:
164          - head                 : The current HEAD.
165          - tag                  : A signed tag.
166          - local-tag            : An unsigned tag.
167          - remote               : A remote.
168          - tracked-remote       : The remote tracked by current HEAD.
169          - replace              : A replaced reference.
170          - branch               : Any other reference.
172 'line-graphics' (mixed) [ascii|default|utf-8|<bool>]::
174         What type of character graphics for line drawing.
176 'horizontal-scroll' (mixed)::
178         Interval to scroll horizontally in each step. Can be specified either
179         as the number of columns, e.g. '5', or as a percentage of the view
180         width, e.g. '33%', where the maximum is 100%. For percentages it is
181         always ensured that at least one column is scrolled. The default is to
182         scroll '50%' of the view width.
184 'git-colors' (list)::
186         A space separated list of "key=value" pairs where the key is a Git color
187         name and the value is a Tig color name, e.g. "branch.current=main-head"
188         and "grep.filename=grep.file". Set to "no" to disable.
190 'show-notes' (mixed) [<reference>|<bool>]::
192         Whether to show notes for a commit. When set to a note reference the
193         reference is passed to `git show --notes=`. Notes are enabled by
194         default.
196 'show-changes' (bool)::
198         Whether to show staged and unstaged changes in the main view.
200 'vertical-split' (mixed) [auto|<bool>]::
202         Whether to split the view horizontally or vertically.
203         "auto" (which is the default) means that it will depend on the window
204         dimensions. When true vertical orientation is used, and false sets the
205         orientation to horizontal.
207 'split-view-height' (mixed)::
209         The height of the bottom view in a horizontally split display. Can be
210         specified either as the number of rows, e.g. '5', or as a percentage of
211         the view height, e.g. '80%', where the maximum is 100%. It is always
212         ensured that the smaller of the views is at least four rows high. The
213         default is '67%'.
215 'split-view-width' (mixed)::
217         Width of the right-most view in a vertically split display. Can be
218         specified either as the number of column, e.g. '5', or as a percentage
219         of the view width, e.g. '80%', where the maximum is 100%. It is always
220         ensured that the smaller of the views is at least four columns wide. The
221         default is '50%'.
223 'status-untracked-dirs' (bool)::
225         Show untracked directories contents in the status view (analog to
226         `git ls-files --directory` option). On by default.
228 'tab-size' (int)::
230         Number of spaces per tab. The default is 8 spaces.
232 'diff-context' (int)::
234         Number of context lines to show for diffs.
236 'ignore-space' (mixed) [no|all|some|at-eol|<bool>]::
238         Ignore space changes in diff view. By default no space changes are
239         ignored. Changing this to "all", "some" or "at-eol" is equivalent to
240         passing "--ignore-all-space", "--ignore-space" or
241         "--ignore-space-at-eol" respectively to `git diff` or `git show`.
243 'commit-order' (mixed) [default|topo|date|author-date|reverse|<bool>]::
245         Commit ordering using the default (chronological reverse) order,
246         topological order, date order or reverse order. The default order is
247         used when the option is set to false, and topo order when set to true.
248         Note that topological order is automatically used in the main view when
249         the commit graph is enabled and the commit order is set to the default.
251 'ignore-case' (bool)::
253         Ignore case in searches. By default, the search is case sensitive.
255 'wrap-lines' (bool)::
257         Wrap long lines. By default, lines are not wrapped.
258         Not compatible with line numbers enabled.
260 'focus-child' (bool)::
262         Whether to focus the child view when it is opened. When disabled the
263         focus will remain in the parent view, avoiding reloads of the child
264         view when navigating the parent view. True by default.
266 'editor-line-number' (bool)::
268         Whether to pass the selected line number to the editor command. The
269         line number is passed as `+<line-number>` in front of the file name.
270         Example: `vim +10 tig.c`
272 'mouse' (bool)::
274         Whether to enable mouse support. Off by default since it makes selecting
275         text from the terminal less intuitive. When enabled hold down Shift (or
276         Option on Mac) to select text. Mouse support requires that ncurses
277         itself support mouse events.
279 'mouse-scroll' (int)::
281         Interval to scroll up or down using the mouse. The default is 3 lines.
282         Mouse support requires that ncurses itself support mouse events and that
283         you have enabled mouse support in ~/.tigrc with `set mouse = true`.
285 'refresh-mode' (mixed) [manual|auto|after-command|periodic|<bool>]::
287         Configures how views are refreshed based on modifications to watched
288         files in the repository. When set to 'manual', nothing is refreshed
289         automatically. When set to 'auto', views are refreshed when a
290         modification is detected. When set to 'after-command' only refresh after
291         returning from an external command. When set to 'periodic', visible
292         views are refreshed periodically using 'refresh-interval'.
294 'refresh-interval' (int)::
296         Interval in seconds between view refresh update checks when
297         'refresh-mode' is set to 'periodic'.
299 'file-args' (args)::
301         Command line arguments referring to files. These are filtered using
302         `git-rev-parse(1)`.
304 'rev-args' (args)::
306         Command line arguments referring to revisions. These are filtered using
307         `git-rev-parse(1)`.
309 'cmdline-args' (args)::
311         All remaining command line arguments that are not either filtered into
312         'file-args' or 'rev-args'.
314 View settings
315 ~~~~~~~~~~~~~
317 The view settings define the order and options for the different columns of a
318 view. Each view setting expects a space separated list of column specifications.
319 Column specifications starts with the column type, and can optionally be
320 followed by a colon (`:`) and a list of column options. E.g. the following
321 column specification defines an 'author' column displaying the author email and
322 with a maximum width of 20 characters: `author:email,width=20`.
324 The first option value in a column specification is always the 'display' option.
325 When no 'display' value is given, 'yes' is assumed. For 'display' options
326 expecting an enumerated value this will automatically resolve to the default
327 enum value. For example, `file-name` will automatically have its 'display'
328 setting resolve to 'auto'.
330 Specifications can also be given for a single column, for example to override
331 the defaults in the system tigrc file. To override a single column, use the
332 column name as a suffix after the view setting name, e.g. `main-view-date` will
333 allow to set the date in the main view.
335 Examples:
336 // TEST: tigrc
337 --------------------------------------------------------------------------
338 # Enable both ID and line numbers in the blame view
339 set blame-view = date:default author:full file-name:auto id:yes,color \
340                  line-number:yes,interval=5 text
342 # Change grep view to be similar to `git grep` format
343 set grep-view = file-name:yes line-number:yes,interval=1 text
345 # Show file sizes as units
346 set tree-view = line-number:no,interval=5 mode author:full \
347                 file-size:units date:default id:no file-name
349 # Show line numbers for every 10th line in the pager view
350 set pager-view = line-number:yes,interval=10 text
352 # Shorthands to change view settings for a previously defined column
353 set main-view-date = short
354 set blame-view-line-number = no
355 # Do not automatically use topo-order for the commit graph
356 set main-view-commit-title-graph = no-topo
357 --------------------------------------------------------------------------
359 The following list shows which the available view settings and what column types
360 they support:
362 blob-view, diff-view, log-view, pager-view, stage-view:: line-number, text
363 blame-view:: author, date, file-name, id, line-number, text
364 grep-view:: file-name, line-number, text
365 main-view:: author, date, commit-title, id, line-number
366 refs-view:: author, date, commit-title, id, line-number, ref
367 stash-view:: author, date, commit-title, id, line-number
368 status-view:: file-name, line-number, status
369 tree-view:: author, date, id, file-name, file-size, line-number, mode
371 Supported column types and their respective column options:
373 author::
375         - 'display' (mixed) [full|abbreviated|email|email-user|<bool>]: How to
376           display author names. If set to "abbreviated" author initials will be
377           shown.
378         - 'width' (int): Width of the column. When set to a value between 1 and
379           10, the author name will be abbreviated to the author's initials.
380           When set to zero, the width is automatically sized to fit the content.
382 commit-title::
383         - 'graph' (mixed) [no|yes|no-topo]: Whether to show the revision graph
384           in the main view on start-up. If set to "no-topo" topo-order is not
385           automatically enabled. See also the 'line-graphics' options.
386         - 'refs' (bool): Whether to show references (branches, tags, and
387           remotes) in the main view. Can be toggled.
388         - 'overflow' (bool or int): Whether to highlight text in commit titles
389           exceeding a given width. When set to a boolean, it enables or disables
390           the highlighting using the default width of 50 character. When set to
391           an int, the assigned value is used as the maximum character width.
393 date::
394         - 'display' (mixed) [relative|short|default|local|<bool>]: How to
395           display dates. If set to "relative" a relative date will be used, e.g.
396           "2 minutes ago". If set to "short" no time information is shown.  If
397           set to "local", localtime(3) is used.
398         - 'width' (int): Width of the column. When set to zero, the width is
399           automatically sized to fit the content.
401 file-name::
402         - 'display' (mixed) [auto|always|<bool>]: When to display file names.
403           If set to "auto" file names are shown only when needed, e.g. when
404           running: tig blame -C <file>.
405         - 'width' (int): Width of the column. When set to zero, the width is
406           automatically sized to fit the content.
408 file-size::
409         - 'display' (mixed) [default|units|<bool>]: How to display file sizes.
410           When set to "units", sizes are shown using binary prefixes, e.g. 12524
411           bytes is shown as "12.2K".
412         - 'width' (int): Width of the filename column. When set to zero, the
413           width is automatically sized to fit the content.
415 id::
416         - 'display' (bool): Whether to show commit IDs in the main view.
417         - 'width' (int) : Width of the commit ID. When unset Tig will use the
418           value of 'core.abbrev' if found. See git-config(1) on how to set
419           'core.abbrev'. When set to zero the width is automatically sized to
420           fit the content of reflog (e.g.  `ref/stash@{4}`) IDs and otherwise
421           default to 7.
423 line-number::
424         - 'display' (bool): Whether to show line numbers.
425         - 'interval' (int): Interval between line numbers.
426         - 'width' (int): Width of the column. When set to zero, the width is
427           automatically sized to fit the content.
429 mode::
430         - 'display' (bool): Whether to show file modes.
431         - 'width' (int): Width of the column. When set to zero, the width is
432           automatically sized to fit the content.
434 ref::
435         - 'display' (bool): Whether to show the reference name.
436         - 'width' (int): Width of the column. When set to zero, the width is
437           automatically sized to fit the content.
439 status::
440         - 'display' (mixed) [no|short|long|<bool>]: How to display the status
441           label.
442         - 'width' (int): Width of the column. When set to zero, the width is
443           automatically sized to fit the content.
445 text::
446         - 'commit-title-overflow' (bool or int): Whether to highlight commit
447           titles exceeding a given width in the diff view. When set to a
448           boolean, it enables or disables the highlighting using the default
449           width of 50 character. When set to an int, the assigned value is used
450           as the maximum character width.
452 All column options can be toggled. For 'display' options, use the
453 option name as the prefix followed by a dash and the column name. E.g.
454 `:toggle author-display` will toggle the 'display' option in the 'author'
455 column. For all other options use the column name followed by a dash and
456 then the option name as the suffix. E.g. `:toggle commit-title-graph`
457 will toggle the 'graph' option in the 'commit-title' column.
459 Bind command
460 ------------
462 Using bind commands, keys can be mapped to an action when pressed in a given
463 key map. The syntax is:
465 [verse]
466 *bind* 'keymap' 'key' 'action'
468 Examples:
469 // TEST: tigrc
470 --------------------------------------------------------------------------
471 # Add keybinding to quickly jump to the next diff chunk in the stage view
472 bind stage <Enter> :/^@@
474 # Disable the default mapping for running git-gc
475 bind generic G none
477 # User-defined external command to amend the last commit
478 bind status + !git commit --amend
480 # User-defined internal command that reloads ~/.tigrc
481 bind generic S :source ~/.tigrc
483 # UTF8-encoded characters can be used as key values.
484 bind generic Ã¸ @sh -c "printf '%s' %(commit) | pbcopy"
485 --------------------------------------------------------------------------
487 Or in the Git configuration files:
488 // TEST: gitconfig
489 --------------------------------------------------------------------------
490 [tig "bind"]
491         # 'unbind' the default quit key binding
492         main = Q none
493         # Cherry-pick current commit onto current branch
494         generic = C !git cherry-pick %(commit)
495 --------------------------------------------------------------------------
497 Keys are mapped by first searching the keybindings for the current view, then
498 the keybindings for the *generic* keymap, and last the default keybindings.
499 Thus, the view keybindings override the generic keybindings which override the
500 built-in keybindings.
504 Keymaps::
506 Valid keymaps are: *main*, *diff*, *log*, *help*, *pager*, *status*, *stage*,
507 *tree*, *blob*, *blame*, *refs*, *stash*, *grep* and *generic*. Use *generic*
508 to set key mapping in all keymaps.
510 Key values::
512 Key values should never be quoted. Use either an ASCII or UTF8-encoded character
513 or one of the following symbolic key names. Symbolic key names are case
514 insensitive and starts with "<" and ends with ">". Use *<Hash>* to bind to the
515 `#` key, since the hash mark is used as a comment character. Use *<LessThan>* to
516 bind to the `<` key.
518 *<Enter>*, *<Space>*, *<Backspace>*, *<Tab>*, *<Escape>* or *<Esc>*, *<Left>*,
519 *<Right>*, *<Up>*, *<Down>*, *<Insert>* or *<Ins>*, *<Delete>* or *<Del>*,
520 *<Hash>*, *<LessThan>* or *<LT>*, *<Home>*, *<End>*, *<PageUp>* or *<PgUp>*,
521 *<PageDown>* or *<PgDown>*, *<F1>*, *<F2>*, *<F3>*, *<F4>*, *<F5>*, *<F6>*,
522 *<F7>*, *<F8>*, *<F9>*, *<F10>*, *<F11>*, *<F12>*.
524 To define key mappings with the `Ctrl` key, use `<Ctrl-key>`. In addition, key
525 combos consisting of an initial `Escape` key followed by a normal key value can
526 be bound using `<Esc>key`.
528 Examples:
529 // TEST: tigrc
530 --------------------------------------------------------------------------
531 bind main R             refresh
532 bind main <Down>        next
533 bind main <Ctrl-f>      scroll-page-down
534 bind main <Esc>o        options
535 --------------------------------------------------------------------------
537 Note that due to the way ncurses encodes `Ctrl` key mappings, `Ctrl-m` and
538 `Ctrl-i` cannot be bound as they conflict with 'Enter' and 'Tab' respectively.
539 Furthermore, ncurses does not allow to distinguish between `Ctrl-f` and
540 `Ctrl-F`. Finally, `Ctrl-z` is automatically used for process control and will
541 suspend Tig and open a subshell (use `fg` to reenter Tig).
543 Actions::
545 Actions are either specified as user-defined commands (external or internal) or
546 using action names as described in the following sections.
550 External user-defined command
551 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
553 These actions start with one or more of the following option flags followed by
554 the command that should be executed.
556 [frame="none",grid="none",cols="25<m,75<"]
557 |=============================================================================
558 |!                      |Run the command in the foreground with output shown.
559 |@                      |Run the command in the background with no output.
560 |?                      |Prompt the user before executing the command.
561 |<                      |Exit Tig after executing the command.
562 |=============================================================================
564 Unless otherwise specified, commands are run in the foreground with their
565 console output shown (as if '!' was specified). When multiple command options
566 are specified their behavior are combined, e.g. "?<git commit" will prompt the
567 user whether to execute the command and will exit Tig after completion.
569 Browsing state variables
570 ^^^^^^^^^^^^^^^^^^^^^^^^
572 User-defined commands can optionally refer to Tig's internal state using the
573 following variable names, which are substituted before commands are run:
575 [frame="none",grid="none",cols="25<m,75<"]
576 |=============================================================================
577 |%(head)                |The currently viewed 'head' ID. Defaults to HEAD
578 |%(commit)              |The currently selected commit ID.
579 |%(blob)                |The currently selected blob ID.
580 |%(branch)              |The currently selected branch name.
581 |%(remote)              |The currently selected remote name. For remote
582                          branches %(branch) will contain the branch name.
583 |%(tag)                 |The currently selected tag name.
584 |%(stash)               |The currently selected stash name.
585 |%(directory)           |The current directory path in the tree view or
586                          "." if undefined.
587 |%(file)                |The currently selected file.
588 |%(lineno)              |The currently selected line number. Defaults to 0.
589 |%(ref)                 |The reference given to blame or HEAD if undefined.
590 |%(revargs)             |The revision arguments passed on the command line.
591 |%(fileargs)            |The file arguments passed on the command line.
592 |%(cmdlineargs)         |All other options passed on the command line.
593 |%(diffargs)            |The diff options from 'diff-options' or 'TIG_DIFF_OPTS'
594 |%(prompt)              |Prompt for the argument value. Optionally specify a
595                          custom prompt using `"%(prompt Enter branch name: )"`
596 |=============================================================================
598 Examples:
599 // TEST: tigrc
600 --------------------------------------------------------------------------
601 # Save save the current commit as a patch file when the user selects a
602 # commit in the main view and presses 'S'.
603 bind main S !git format-patch -1 %(commit)
605 # Create and checkout a new branch; specify custom prompt
606 bind main B ?git checkout -b "%(prompt Enter new branch name: )"
607 --------------------------------------------------------------------------
609 Advanced shell-like commands
610 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
612 If your command requires use of dynamic features, such as subshells,
613 expansion of environment variables and process control, this can be achieved by
614 using a shell command:
616 .Configure a binding to copy the current commit ID to the clipboard.
617 // TEST: tigrc
618 --------------------------------------------------------------------------
619 bind generic I @sh -c "echo -n %(commit) | xclip -selection c"
620 --------------------------------------------------------------------------
622 Or by using a combination of Git aliases and Tig external commands. The
623 following example entries can be put in either the .gitconfig or .git/config
624 file:
626 .Git configuration which binds Tig keys to Git command aliases.
627 // TEST: gitconfig
628 --------------------------------------------------------------------------
629 [alias]
630         gitk-bg = !"gitk HEAD --not $(git rev-parse --remotes) &"
631         publish = !"for i in origin public; do git push $i; done"
632 [tig "bind"]
633         # @-prefix means that the console output will not be shown.
634         generic = V !@git gitk-bg
635         generic = > !git publish
636 --------------------------------------------------------------------------
638 Internal user-defined commands
639 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
641 Actions beginning with a ':' will be run and interpreted as internal commands
642 and act similar to commands run via Tig's prompt. Valid internal commands are
643 configuration file options (as described in this document) and pager view
644 commands. Examples:
646 // TEST: tigrc
647 --------------------------------------------------------------------------
648 # Reload ~/.tigrc when 'S' is pressed
649 bind generic S :source .tigrc
651 # Change diff view to show all commit changes regardless of file limitations
652 bind diff F :set diff-options = --full-diff
654 # Show the output of git-reflog(1) in the pager view
655 bind generic W :!git reflog
657 # Search for previous diff (c)hunk and next diff header
658 bind stage 2 :?^@@
659 bind stage D :/^diff --(git|cc)
661 bind main I :toggle id                          # Show/hide the ID column
662 bind diff D :toggle diff-options --minimal      # Use minimal diff algorithm
663 bind diff [ :toggle diff-context -3             # Decrease context (-U arg)
664 bind diff ] :toggle diff-context +3             # Increase context
665 bind generic V :toggle split-view-height -10%   # Decrease split height
666 --------------------------------------------------------------------------
668 Similar to external commands, pager view commands can contain variable names
669 that will be substituted before the command is run.
671 Action names
672 ~~~~~~~~~~~~
674 Valid action names are described below. Note, all action names are
675 case-insensitive, and you may use '-', '_', and '.' interchangeably, e.g.
676 "view-main", "View.Main", and "VIEW_MAIN" are the same.
678 ifndef::DOC_GEN_ACTIONS[]
679 View switching
680 ^^^^^^^^^^^^^^
682 [frame="none",grid="none",cols="25<m,75<"]
683 |=============================================================================
684 |view-main               |Show main view
685 |view-diff               |Show diff view
686 |view-log                |Show log view
687 |view-tree               |Show tree view
688 |view-blob               |Show blob view
689 |view-blame              |Show blame view
690 |view-refs               |Show refs view
691 |view-status             |Show status view
692 |view-stage              |Show stage view
693 |view-stash              |Show stash view
694 |view-grep               |Show grep view
695 |view-pager              |Show pager view
696 |view-help               |Show help view
697 |=============================================================================
699 View manipulation
700 ^^^^^^^^^^^^^^^^^
702 [frame="none",grid="none",cols="25<m,75<"]
703 |=============================================================================
704 |enter                   |Enter and open selected line
705 |back                    |Go back to the previous view state
706 |next                    |Move to next
707 |previous                |Move to previous
708 |parent                  |Move to parent
709 |view-next               |Move focus to the next view
710 |refresh                 |Reload and refresh view
711 |maximize                |Maximize the current view
712 |view-close              |Close the current view
713 |quit                    |Close all views and quit
714 |=============================================================================
716 View specific actions
717 ^^^^^^^^^^^^^^^^^^^^^
719 [frame="none",grid="none",cols="25<m,75<"]
720 |=============================================================================
721 |status-update           |Stage/unstage chunk or file changes
722 |status-revert           |Revert chunk or file changes
723 |status-merge            |Merge file using external tool
724 |stage-update-line       |Stage/unstage single line
725 |stage-split-chunk       |Split current diff chunk
726 |=============================================================================
728 Cursor navigation
729 ^^^^^^^^^^^^^^^^^
731 [frame="none",grid="none",cols="25<m,75<"]
732 |=============================================================================
733 |move-up                 |Move cursor one line up
734 |move-down               |Move cursor one line down
735 |move-page-up            |Move cursor one page up
736 |move-page-down          |Move cursor one page down
737 |move-half-page-up       |Move cursor half a page up
738 |move-half-page-down     |Move cursor half a page down
739 |move-first-line         |Move cursor to first line
740 |move-last-line          |Move cursor to last line
741 |=============================================================================
743 Scrolling
744 ^^^^^^^^^
746 [frame="none",grid="none",cols="25<m,75<"]
747 |=============================================================================
748 |scroll-line-up          |Scroll one line up
749 |scroll-line-down        |Scroll one line down
750 |scroll-page-up          |Scroll one page up
751 |scroll-page-down        |Scroll one page down
752 |scroll-first-col        |Scroll to the first line columns
753 |scroll-left             |Scroll two columns left
754 |scroll-right            |Scroll two columns right
755 |=============================================================================
757 Searching
758 ^^^^^^^^^
760 [frame="none",grid="none",cols="25<m,75<"]
761 |=============================================================================
762 |search                  |Search the view
763 |search-back             |Search backwards in the view
764 |find-next               |Find next search match
765 |find-prev               |Find previous search match
766 |=============================================================================
768 Option manipulation
769 ^^^^^^^^^^^^^^^^^^^
771 In addition to the actions below, options can also be toggled with the
772 `:toggle` prompt command.
774 [frame="none",grid="none",cols="25<m,75<"]
775 |=============================================================================
776 |options                 |Open the options menu
777 |=============================================================================
779 Misc
780 ^^^^
782 [frame="none",grid="none",cols="25<m,75<"]
783 |=============================================================================
784 |edit                    |Open in editor
785 |prompt                  |Open the prompt
786 |screen-redraw           |Redraw the screen
787 |stop-loading            |Stop all loading views
788 |show-version            |Show version information
789 |none                    |Do nothing
790 |=============================================================================
791 endif::DOC_GEN_ACTIONS[]
793 Color command
794 -------------
796 Color commands control highlighting and the user interface styles. If your
797 terminal supports color, these commands can be used to assign foreground and
798 background combinations to certain areas. Optionally, an attribute can be
799 given as the last parameter. The syntax is:
801 [verse]
802 *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
804 Examples:
805 // TEST: tigrc
806 ------------------------------------------------------------------------------
807 # Override the default terminal colors to white on black.
808 color default           white   black
809 # Diff colors
810 color diff-header       yellow  default
811 color diff-index        blue    default
812 color diff-chunk        magenta default
813 color "Reported-by:"    green   default
814 # View specific color
815 color tree.date         black   cyan    bold
816 --------------------------------------------------------------------------
818 Or in the Git configuration files:
819 // TEST: gitconfig
820 --------------------------------------------------------------------------
821 [tig "color"]
822         # A strange looking cursor line
823         cursor          = red   default underline
824         # UI colors
825         title-blur      = white blue
826         title-focus     = white blue    bold
827 # View specific color
828 [tig "color.tree"]
829         date            = cyan  default bold
830 ------------------------------------------------------------------------------
832 Area names::
834         Can be either a built-in area name or a custom quoted string. The
835         latter allows custom color rules to be added for lines matching a
836         quoted string.
837         Valid built-in area names are described below. Note, all names are
838         case-insensitive, and you may use '-', and '_' interchangeably,
839         e.g. "Diff-Header" and "DIFF_HEADER" are the same.
840         View specific colors can be defined by prefixing the view name to
841         the area name, e.g. "stage.diff-chunk" and "diff.diff-chunk".
843 Color names::
845         Valid colors include: *white*, *black*, *green*, *magenta*, *blue*,
846         *cyan*, *yellow*, *red*, *default*. Use *default* to refer to the
847         default terminal colors, for example, to keep the background
848         transparent when you are using a terminal with a transparent
849         background.
851 Colors can also be specified using the keywords *color0*, *color1*, ...,
852 *colorN-1* (where *N* is the number of colors supported by your terminal).
853 This is useful when you remap the colors for your display or want to enable
854 colors supported by 88-color and 256-color terminals. Note that the 'color'
855 prefix is optional. If you prefer, you can specify colors directly by their
856 numbers *0*, *1*, ..., *N-1* instead, just like in the configuration file of
857 Git.
859 Attribute names::
861         Valid attributes include: *normal*, *blink*, *bold*, *dim*, *reverse*,
862         *standout*, and *underline*. Note, not all attributes may be supported
863         by the terminal.
865 UI colors
866 ~~~~~~~~~
868 The colors and attributes to be used for the text that is not highlighted or
869 that specify the use of the default terminal colors can be controlled by
870 setting the *default* color option.
872 .General
873 [frame="none",grid="none",cols="25<m,75<"]
874 |=============================================================================
875 |default                |Override default terminal colors (see above).
876 |cursor                 |The cursor line.
877 |status                 |The status window showing info messages.
878 |title-focus            |The title window for the current view.
879 |title-blur             |The title window of any backgrounded view.
880 |delimiter              |Delimiter shown for truncated lines.
881 |header                 |The view header lines. Use 'status.header' to color
882                          the staged, unstaged, and untracked sections in the
883                          status view. Use 'help.header' to color the keymap
884                          sections in the help view.
885 |line-number            |Line numbers.
886 |id                     |The commit ID.
887 |date                   |The author date.
888 |author                 |The commit author.
889 |mode                   |The file mode holding the permissions and type.
890 |overflow               |Title text overflow.
891 |directory              |The directory name.
892 |file                   |The file name.
893 |file-size              |File size.
894 |=============================================================================
896 .Main view colors
897 [frame="none",grid="none",cols="25<m,75<"]
898 |=============================================================================
899 |graph-commit           |The commit dot in the revision graph.
900 |palette-[0-13]         |14 different colors, used for distinguishing branches
901                          or commits. By default, the palette uses the ASCII
902                          colors, where the second half of them have the bold
903                          attribute enabled to give a brighter color.
904                          Example: palette-0 = red
905 |main-commit            |The commit comment.
906 |main-head              |Label of the current branch.
907 |main-remote            |Label of a remote.
908 |main-tracked           |Label of the remote tracked by the current branch.
909 |main-tag               |Label of a signed tag.
910 |main-local-tag         |Label of a local tag.
911 |main-ref               |Label of any other reference.
912 |main-replace           |Label of replaced reference.
913 |=============================================================================
915 .Status view
916 [frame="none",grid="none",cols="25<m,75<"]
917 |=============================================================================
918 |stat-none              |Empty status label.
919 |stat-staged            |Status flag of staged files.
920 |stat-unstaged          |Status flag of unstaged files.
921 |stat-untracked         |Status flag of untracked files.
922 |=============================================================================
924 .Help view
925 [frame="none",grid="none",cols="25<m,75<"]
926 |=============================================================================
927 |help-group             |Help group name.
928 |help-action            |Help action name.
929 |=============================================================================
931 Highlighting
932 ~~~~~~~~~~~~
936 Diff markup::
938 Options concerning diff start, chunks and lines added and deleted.
940 *diff-header*, *diff-chunk*, *diff-add*, *diff-add2*, *diff-del*,
941 *diff-del2*
943 Enhanced Git diff markup::
945 Extra diff information emitted by the Git diff machinery, such as mode
946 changes, rename detection, and similarity.
948 *diff-oldmode*, *diff-newmode*, *diff-copy-from*, *diff-copy-to*,
949 *diff-similarity*, *diff-index*
951 Pretty print commit headers::
953 Commit diffs and the revision logs are usually formatted using pretty printed
954 headers , unless `--pretty=raw` was given. This includes lines, such as merge
955 info, commit ID, and author and committer date.
957 *pp-refs*, *pp-reflog*, *pp-reflogmsg*, *pp-merge*
959 Raw commit header::
961 Usually shown when `--pretty=raw` is given, however 'commit' is pretty much
962 omnipresent.
964 *commit*, *parent*, *tree*, *author*, *committer*
966 Commit message::
968 `Signed-off-by`, `Acked-by`, `Reviewed-by` and `Tested-by` lines are colorized.
969 Characters in the commit title exceeding a predefined width can be highlighted.
972 Tree markup::
974 Colors for information of the tree view.
976 *tree-dir*, *tree-file*
980 Source command
981 -------------
983 Source commands make it possible to read additional configuration files.
984 Sourced files are included in-place, meaning when a 'source' command is
985 encountered the file will be immediately read. Any commands later in the
986 current configuration file will take precedence. The syntax is:
988 [verse]
989 *source* 'path'
991 Examples:
992 // TEST: tigrc
993 --------------------------------------------------------------------------
994 source ~/.tig/colorscheme.tigrc
995 source ~/.tig/keybindings.tigrc
996 --------------------------------------------------------------------------
998 COPYRIGHT
999 ---------
1000 Copyright (c) 2006-2014 Jonas Fonseca <jonas.fonseca@gmail.com>
1002 This program is free software; you can redistribute it and/or modify
1003 it under the terms of the GNU General Public License as published by
1004 the Free Software Foundation; either version 2 of the License, or
1005 (at your option) any later version.
1007 SEE ALSO
1008 --------
1009 ifndef::backend-docbook[]
1010 link:tig.1.{docext}[tig(1)],
1011 link:manual.{docext}[the Tig manual],
1012 endif::backend-docbook[]
1013 ifdef::backend-docbook[]
1014 manpage:tig[1],
1015 manpage:tigmanual[7],
1016 endif::backend-docbook[]
1017 git(7), git-config(1)