diff: get pathname of combined diff headers
[tig.git] / tigrc.5.txt
blob8fc4d888acc9bc0d2807273569eb018bd6a1bbd4
1 tigrc(5)
2 ========
4 NAME
5 ----
6 tigrc - tig configuration file
9 SYNOPSIS
10 --------
11 [verse]
12 *set*   'variable' *=* 'value'
13 *bind*  'keymap' 'key' 'action'
14 *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
15 *source* 'path'
18 DESCRIPTION
19 -----------
21 You can permanently set an option by putting it in the `~/.tigrc` file.  The
22 file consists of a series of 'commands'.  Each line of the file may contain
23 only one command.
25 The hash mark ('#') is used as a 'comment' character. All text after the
26 comment character to the end of the line is ignored. You can use comments to
27 annotate your initialization file.
29 Git configuration
30 -----------------
32 Alternatively to using `~/.tigrc`, tig options can be set by putting them in
33 one of the git configuration files, which are read by tig on startup. See
34 'git-config(1)' for which files to use. The following example show the basic
35 syntax to use for settings, bindings and colors.
37 --------------------------------------------------------------------------
38 [tig] show-rev-graph = true
39 [tig "color"] cursor = yellow red bold 
40 [tig "bind"] generic = P parent
41 --------------------------------------------------------------------------
43 In addition to tig-specific options, the following git options are read from
44 the git configuration:
46 'color.*'::
48         Colors for the various UI types. Can be completely disabled by setting
49         'read-git-colors'.
51 'core.abbrev'::
53         The width of the commit ID. See also 'id-width' option.
55 'core.editor'::
57         The editor command. Can be overridden by setting GIT_EDITOR.
59 'core.worktree'::
61         The path to the root of the working tree.
63 'gui.encoding'::
65         The encoding to use for displaying of file content.
67 Set command
68 -----------
70 A few selective variables can be configured via the set command. The syntax
71 is:
73 [verse]
74 *set* variables *=* value
76 Examples:
78 --------------------------------------------------------------------------
79 set show-author = abbreviated   # Show abbreviated author names.
80 set show-date = relative        # Show relative commit date.
81 set show-rev-graph = yes        # Show revision graph?
82 set show-refs = yes             # Show references?
83 set commit-order = topo         # Order commits topologically
84 set read-git-colors = no        # Do not read git's color settings.
85 set show-line-numbers = no      # Show line numbers?
86 set line-number-interval = 5    # Interval between line numbers
87 set horizontal-scroll = 33%     # Scroll 33% of the view width
88 set blame-options = -C -C -C    # Blame lines from other files
89 --------------------------------------------------------------------------
91 Or in the git configuration files:
93 --------------------------------------------------------------------------
94 [tig]
95         show-date = yes         # Show commit date?
96         author-width = 10       # Set width of the author column
97         line-graphics = no      # Disable graphics characters
98         tab-size = 8            # Number of spaces per tab
99 --------------------------------------------------------------------------
101 The type of variables is either bool, int, string, or mixed.
103 Valid bool values::
105         To set a bool variable to true use either "1", "true", or "yes".
106         Any other value will set the variable to false.
108 Valid int values::
110         A non-negative integer.
112 Valid string values::
114         A string of characters. Optionally, use either ' or " as delimiters.
116 Valid mixed values::
118         These values are composites of the above types. The valid values are
119         specified in the description.
121 Variables
122 ~~~~~~~~~
124 The following variables can be set:
126 'author-width' (int)::
128         Width of the author column. When set to 5 or below, the author name
129         will be abbreviated to the author's initials.
132 'filename-width' (int)::
134         Width of the filename column.
136 'id-width' (int)::
138         Width of the commit ID. When unset tig will use the value of
139         'core.abbrev' if found or default to 7.  See git-config(1) on how to
140         set 'core.abbrev'.
142 'blame-options' (string)::
144         A space separated string of extra blame options. Can be used for
145         telling git-blame(1) how to detect the origin of lines. The value
146         is ignored when tig is started in blame mode and given blame options
147         on the command line.
149 'line-graphics' (mixed) [ "ascii" | "default" | "utf-8" | bool]::
151         What type of character graphics for line drawing.
153 'line-number-interval' (int)::
155         Interval between line numbers. Note, you have to toggle on line
156         numbering with ".".  The default is to number every fifth line.
158 'horizontal-scroll' (mixed)::
160         Interval to scroll horizontally in each step. Can be specified either
161         as the number of columns, e.g. '5', or as a percentage of the view
162         width, e.g. '33%', where the maximum is 100%. For percentages it is
163         always ensured that at least one column is scrolled. The default is to
164         scroll '50%' of the view width.
166 'read-git-colors' (bool)::
168         Whether to read git's color settings. True by default.
170 'show-author' (mixed) ["abbreviated" | "full" | bool]::
172         How to display author names. If set to "abbreviated" author initials
173         will be shown. Can be toggled.
175 'show-filename' (mixed) ["auto" | "always" | bool]::
177         When to display file names. If set to "auto" file names are shown
178         only when needed, e.g. when running: tig blame -C <file>.
180 'show-date' (mixed) ["relative" | "short" | "default" | "local" | bool]::
182         Whether and how to show date. If set to "relative" a relative date will be
183         used, e.g. "2 minutes ago". If set to "short" no time information is
184         shown. If set to "local", localtime(3) is used. Can be toggled.
186 'show-notes' (mixed) [note reference | bool]::
188         Whether to show notes for a commit. When set to a note reference the
189         reference is passed to `git show --notes=`. Notes are enabled by
190         default.
192 'show-refs' (bool)::
194         Whether to show references (branches, tags, and remotes) in the main
195         view on start-up. Can be toggled.
197 'show-id' (bool)::
199         Whether to show commit IDs in the main view. Disabled by default. Can
200         be toggled. See also 'id-width' option.
202 'show-rev-graph' (bool)::
204         Whether to show revision graph in the main view on start-up.
205         Can be toggled. See also line-graphics options.
207 'show-changes' (bool)::
209         Whether to show staged and unstaged changes in the main view.
210         Can be toggled.
212 'vertical-split' (bool)::
214         Whether to split the view horizontally or vertically.
216 'split-view-height' (mixed)::
218         Height of the lower view in a split view. Can be specified either as
219         the number of rows, e.g. '5', or as a percentage of the view height,
220         e.g. '80%', where the maximum is 100%. It is always ensured that the
221         smaller of the views is at least four rows high. The default is a view
222         height of '66%'.
224 'status-untracked-dirs' (bool)::
226         Show untracked directories contents in the status view (analog to
227         `git ls-files --directory` option). On by default.
229 'tab-size' (int)::
231         Number of spaces per tab. The default is 8 spaces.
233 'diff-context' (int)::
235         Number of context lines to show for diffs.
237 'ignore-space' (mixed) ["no" | "all" | "some" | "at-eol" | bool]::
239     Ignore space changes in diff view. By default no space changes are ignored.
240     Changing this to "all", "some" or "at-eol" is equivalent to passing
241     "--ignore-all-space", "--ignore-space" or "--ignore-space-at-eol"
242     respectively to `git diff` or `git show`.
244 'commit-order' (mixed) ["default" | "topo" | "date" | "reverse" | bool]::
246         Commit ordering using the default (chronological reverse) order,
247         topological order, date order or reverse order. The default order is
248         used when the option is set to false, and topo order when set to true.
250 'ignore-case' (bool)::
252         Ignore case in searches. By default, the search is case sensitive.
254 'wrap-lines' (bool)::
256         Wrap long lines. By default, lines are not wrapped.
257         Not compatible with line numbers enabled.
259 Bind command
260 ------------
262 Using bind commands keys can be mapped to an action when pressed in a given
263 key map. The syntax is:
265 [verse]
266 *bind* 'keymap' 'key' 'action'
268 Examples:
270 --------------------------------------------------------------------------
271 # A few keybindings
272 bind main w scroll-line-up
273 bind main s scroll-line-down
274 bind main space enter
275 bind diff a previous
276 bind diff d next
277 bind diff b move-first-line
278 # An external command to update from upstream
279 bind generic F !git fetch
280 --------------------------------------------------------------------------
282 Or in the git configuration files:
284 --------------------------------------------------------------------------
285 [tig "bind"]
286         # 'unbind' the default quit key binding
287         main = Q none
288         # Cherry-pick current commit onto current branch
289         generic = C !git cherry-pick %(commit)
290 --------------------------------------------------------------------------
292 Keys are mapped by first searching the keybindings for the current view, then
293 the keybindings for the *generic* keymap, and last the default keybindings.
294 Thus, the view keybindings shadow the generic keybindings which Shadow the
295 built-in keybindings.
299 Keymaps::
301 Valid keymaps are: *main*, *diff*, *log*, *help*, *pager*, *status*, *stage*,
302 *tree*, *blob*, *blame*, *branch*, and *generic*.  Use *generic* to set key
303 mapping in all keymaps.
305 Key values::
307 Key values should never be quoted. Use either the ASCII value or one of the
308 following symbolic key names. Symbolic key names are case insensitive, Use
309 *Hash* to bind to the `#` key, since the hash mark is used as a comment
310 character.
312 *Enter*, *Space*, *Backspace*, *Tab*, *Escape*, *Left*, *Right*, *Up*, *Down*,
313 *Insert*, *Delete*, *Hash*, *Home*, *End*, *PageUp*, *PageDown*, *F1*, *F2*, *F3*,
314 *F4*, *F5*, *F6*, *F7*, *F8*, *F9*, *F10*, *F11*, *F12*.
316 Action names::
318 Valid action names are described below. Note, all names are
319 case-insensitive, and you may use '-', '_', and '.' interchangeably,
320 e.g. "view-main", "View.Main", and "VIEW_MAIN" are the same.
324 Actions
325 ~~~~~~~
327 Apart from the action names listed below, all actions starting with a '!' will
328 be available as an external command. External commands can contain variable
329 names that will be substituted before the command is run. Valid variable names
330 are:
332 .Browsing state variables
333 [frame="none",grid="none",cols="25<m,75<"]
334 |=============================================================================
335 |%(head)                |The currently viewed 'head' ID. Defaults to HEAD
336 |%(commit)              |The currently selected commit ID.
337 |%(blob)                |The currently selected blob ID.
338 |%(branch)              |The currently selected branch name.
339 |%(directory)           |The current directory path in the tree view;
340                          empty for the root directory.
341 |%(file)                |The currently selected file.
342 |%(ref)                 |The reference given to blame or HEAD if undefined.
343 |%(revargs)             |The revision arguments passed on the command line.
344 |%(fileargs)            |The file arguments passed on the command line.
345 |%(diffargs)            |The diff options passed on the command line.
346 |%(prompt)              |Prompt for the argument value.
347 |=============================================================================
349 As an example, the following external command will save the current commit as
350 a patch file: "!git format-patch -1 %(commit)". If your external command
351 requires use of dynamic features, such as subshells, expansion of environment
352 variables and process control, this can be achieved by using a shell command:
354 .Configure a binding in ~/.tigrc to put a commit ID in the clipboard.
355 --------------------------------------------------------------------------
356 bind generic I !@sh -c "echo -n %(commit) | xclip -selection c"
357 --------------------------------------------------------------------------
359 Or by using a combination of git aliases and tig external commands. The
360 following example entries can be put in either the .gitconfig or .git/config
361 file:
363 .Git configuration which binds tig keys to git command aliasas.
364 --------------------------------------------------------------------------
365 [alias]
366         gitk-bg = !"gitk HEAD --not $(git rev-parse --remotes) &"
367         publish = !"for i in origin public; do git push $i; done"
368 [tig "bind"]
369         # @-prefix means that the console output will not be shown.
370         generic = V !@git gitk-bg
371         generic = > !git publish
372 --------------------------------------------------------------------------
374 By default, commands are run in the foreground with their console output
375 shown. For different behavior, commands can be prefixed with one or more of
376 the following control flags to specify how it should be executed:
378 .External command control flags
379 [frame="none",grid="none",cols="25<m,75<"]
380 |=============================================================================
381 |@                      |Run the command in the background with no output.
382 |?                      |Prompt the user before executing the command.
383 |<                      |Exit tig after executing the command.
384 |=============================================================================
386 Control flags can be combined, e.g. "!?<git commit" will prompt whether to
387 execute the command and will exit tig after completion.
389 .View switching
390 [frame="none",grid="none",cols="25<m,75<"]
391 |=============================================================================
392 |view-main              |Show main view
393 |view-diff              |Show diff view
394 |view-log               |Show log view
395 |view-tree              |Show tree view
396 |view-blob              |Show blob view
397 |view-blame             |Show blame view
398 |view-branch            |Show branch view
399 |view-status            |Show status view
400 |view-stage             |Show stage view
401 |view-pager             |Show pager view
402 |view-help              |Show help page
403 |=============================================================================
405 .View manipulation
406 [frame="none",grid="none",cols="25<m,75<"]
407 |=============================================================================
408 |enter                  |Enter current line and scroll
409 |next                   |Move to next
410 |previous               |Move to previous
411 |parent                 |Move to parent
412 |view-next              |Move focus to next view
413 |refresh                |Reload and refresh view
414 |maximize               |Maximize the current view
415 |view-close             |Close the current view
416 |quit                   |Close all views and quit
417 |=============================================================================
419 .View specific actions
420 [frame="none",grid="none",cols="25<m,75<"]
421 |=============================================================================
422 |status-update          |Update file status
423 |status-merge           |Resolve unmerged file
424 |stage-update-line      |Stage single line
425 |stage-next             |Find next chunk to stage
426 |diff-context-up        |Increase the diff context
427 |diff-context-down      |Decrease the diff context
428 |=============================================================================
430 .Cursor navigation
431 [frame="none",grid="none",cols="25<m,75<"]
432 |=============================================================================
433 |move-up                |Move cursor one line up
434 |move-down              |Move cursor one line down
435 |move-page-down         |Move cursor one page down
436 |move-page-up           |Move cursor one page up
437 |move-first-line        |Move cursor to first line
438 |move-last-line         |Move cursor to last line
439 |=============================================================================
441 .Scrolling
442 [frame="none",grid="none",cols="25<m,75<"]
443 |=============================================================================
444 |scroll-line-up         |Scroll one line up
445 |scroll-line-down       |Scroll one line down
446 |scroll-page-up         |Scroll one page up
447 |scroll-page-down       |Scroll one page down
448 |scroll-first-col       |Scroll to the first column
449 |scroll-left            |Scroll one column left
450 |scroll-right           |Scroll one column right
451 |=============================================================================
453 .Searching
454 [frame="none",grid="none",cols="25<m,75<"]
455 |=============================================================================
456 |search                 |Search the view
457 |search-back            |Search backwards in the view
458 |find-next              |Find next search match
459 |find-prev              |Find previous search match
460 |=============================================================================
462 .Misc
463 [frame="none",grid="none",cols="25<m,75<"]
464 |=============================================================================
465 |prompt                 |Bring up the prompt
466 |screen-redraw          |Redraw the screen
467 |screen-resize          |Resize the screen
468 |show-version           |Show version information
469 |stop-loading           |Stop all loading views
470 |options                |Open options menu
471 |toggle-lineno          |Toggle line numbers
472 |toggle-date            |Toggle date display
473 |toggle-author          |Toggle author display
474 |toggle-filename        |Toggle file name display
475 |toggle-rev-graph       |Toggle revision graph visualization
476 |toggle-graphic         |Toggle (line) graphics mode
477 |toggle-refs            |Toggle reference display
478 |edit                   |Open in editor
479 |none                   |Do nothing
480 |=============================================================================
483 Color command
484 -------------
486 Color commands control highlighting and the user interface styles. If your
487 terminal supports color, these commands can be used to assign foreground and
488 background combinations to certain areas. Optionally, an attribute can be
489 given as the last parameter. The syntax is:
491 [verse]
492 *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
494 Examples:
496 ------------------------------------------------------------------------------
497 # Override the default terminal colors to white on black.
498 color default           white   black
499 # Diff colors
500 color diff-header       yellow  default
501 color diff-index        blue    default
502 color diff-chunk        magenta default
503 color "Reported-by:"    green   default
504 --------------------------------------------------------------------------
506 Or in the git configuration files:
508 --------------------------------------------------------------------------
509 [tig "color"]
510         # A strange looking cursor line
511         cursor          red     default underline
512         # UI colors
513         title-blur      white   blue
514         title-focus     white   blue    bold
515 ------------------------------------------------------------------------------
517 Area names::
519         Can be either a built-in area name or a custom quoted string. The
520         latter allows custom color rules to be added for lines matching a
521         quoted string.
522         Valid built-in area names are described below. Note, all names are
523         case-insensitive, and you may use '-', '_', and '.' interchangeably,
524         e.g. "Diff-Header", "DIFF_HEADER", and "diff.header" are the same.
526 Color names::
528         Valid colors include: *white*, *black*, *green*, *magenta*, *blue*,
529         *cyan*, *yellow*, *red*, *default*. Use *default* to refer to the
530         default terminal colors. This is recommended for background colors if
531         you are using a terminal with a transparent background.
533 Colors can also be specified using the keywords color0, color1, ..., colorN-1
534 (N being the number of colors supported by your terminal). This is useful when
535 you remap the colors for your display or want to enable colors supported by
536 256-color terminals.
538 Attribute names::
540         Valid attributes include: *normal*, *blink*, *bold*, *dim*, *reverse*,
541         *standout*, and *underline*. Note, not all attributes may be supported
542         by the terminal.
544 UI colors
545 ~~~~~~~~~
547 The colors and attributes to be used for the text that is not highlighted or
548 that specify the use of the default terminal colors can be controlled by
549 setting the *default* color option.
551 .General
552 [frame="none",grid="none",cols="25<m,75<"]
553 |=============================================================================
554 |default                |Override default terminal colors (see above).
555 |cursor                 |The cursor line.
556 |status                 |The status window showing info messages.
557 |title-focus            |The title window for the current view.
558 |title-blur             |The title window of any backgrounded view.
559 |delimiter              |Delimiter shown for truncated lines.
560 |line-number            |Line numbers.
561 |id                     |The commit ID.
562 |date                   |The commit date.
563 |author                 |The commit author.
564 |mode                   |The file mode holding the permissions and type.
565 |=============================================================================
567 .Main view colors
568 [frame="none",grid="none",cols="25<m,75<"]
569 |=============================================================================
570 |graph-commit           |The commit dot in the revision graph.
571 |palette-[0-6]          |7 different colors,
572 used for distinguishing branches or commits.
573 example: palette-0 = red
574 |main-commit            |The commit comment.
575 |main-head              |Label of the current branch.
576 |main-remote            |Label of a remote.
577 |main-tracked           |Label of the remote tracked by the current branch.
578 |main-tag               |Label of a signed tag.
579 |main-local-tag         |Label of a local tag.
580 |main-ref               |Label of any other reference.
581 |=============================================================================
583 .Status view
584 [frame="none",grid="none",cols="25<m,75<"]
585 |=============================================================================
586 |stat-head              |The "On branch"-line.
587 |stat-section           |Status section titles,
588 |stat-staged            |Status flag of staged files.
589 |stat-unstaged          |Status flag of unstaged files.
590 |stat-untracked         |Status flag of untracked files.
591 |=============================================================================
593 .Tree view
594 [frame="none",grid="none",cols="25<m,75<"]
595 |=============================================================================
596 |tree-head              |The "Directory /"-line
597 |tree-dir               |The directory name.
598 |tree-file              |The file name.
599 |=============================================================================
601 Highlighting
602 ~~~~~~~~~~~~
606 Diff markup::
608 Options concerning diff start, chunks and lines added and deleted.
610 *diff-header*, *diff-chunk*, *diff-add*, *diff-del*
612 Enhanced git diff markup::
614 Extra diff information emitted by the git diff machinery, such as mode
615 changes, rename detection, and similarity.
617 *diff-oldmode*, *diff-newmode*, *diff-copy-from*, *diff-copy-to*,
618 *diff-rename-from*, *diff-rename-to*, *diff-deleted-file-mode*,
619 *diff-similarity*, *diff-dissimilarity* *diff-tree*, *diff-index*, *diff-stat*
621 Pretty print commit headers::
623 Commit diffs and the revision logs are usually formatted using pretty printed
624 headers , unless `--pretty=raw` was given. This includes lines, such as merge
625 info, commit ID, and author and committer date.
627 *pp-author*, *pp-commit*, *pp-merge*, *pp-date*, *pp-adate*, *pp-cdate*,
628 *pp-refs*
630 Raw commit header::
632 Usually shown when `--pretty=raw` is given, however 'commit' is pretty much
633 omnipresent.
635 *commit*, *parent*, *tree*, *author*, *committer*
637 Commit message::
639 `Signed-off-by`, `Acked-by`, `Reviewed-by` and `Tested-by` lines are colorized.
641 *signoff*, *acked*, *reviewed*, *tested*
643 Tree markup::
645 Colors for information of the tree view.
647 *tree-dir*, *tree-file*
651 Source command
652 -------------
654 Source commands make it possible to read additional configuration files.
655 Sourced files are included in-place, meaning when a 'source' command is
656 encountered the file will be immediately read. Any commands later in the
657 current configuration file will take precedence. The syntax is:
659 [verse]
660 *source* 'path'
662 Examples:
664 ------------------------------------------------------------------------------
665 source ~/.tig/colorscheme.tigrc
666 source ~/.tig/keybindings.tigrc
667 --------------------------------------------------------------------------
669 COPYRIGHT
670 ---------
671 Copyright (c) 2006-2012 Jonas Fonseca <fonseca@diku.dk>
673 This program is free software; you can redistribute it and/or modify
674 it under the terms of the GNU General Public License as published by
675 the Free Software Foundation; either version 2 of the License, or
676 (at your option) any later version.
678 SEE ALSO
679 --------
680 manpage:tig[1], manpage:tigmanual[7], git-config(1),
681 and the http://jonas.nitro.dk/tig/manual.html[tig manual].