main: add toggle for commit title overflow
[tig.git] / tigrc.5.txt
blob62cc0e013b24aa0d73c3734b7bf3b4587771445a
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 'i18n.commitencoding'::
69         The encoding used for commits. The default is UTF-8.
71 Set command
72 -----------
74 A few selective variables can be configured via the set command. The syntax
75 is:
77 [verse]
78 *set* variables *=* value
80 Examples:
82 --------------------------------------------------------------------------
83 set show-author = abbreviated   # Show abbreviated author names.
84 set show-date = relative        # Show relative commit date.
85 set show-rev-graph = yes        # Show revision graph?
86 set show-refs = yes             # Show references?
87 set commit-order = topo         # Order commits topologically
88 set read-git-colors = no        # Do not read git's color settings.
89 set show-line-numbers = no      # Show line numbers?
90 set line-number-interval = 5    # Interval between line numbers
91 set horizontal-scroll = 33%     # Scroll 33% of the view width
92 set blame-options = -C -C -C    # Blame lines from other files
93 --------------------------------------------------------------------------
95 Or in the git configuration files:
97 --------------------------------------------------------------------------
98 [tig]
99         show-date = yes         # Show commit date?
100         author-width = 10       # Set width of the author column
101         line-graphics = no      # Disable graphics characters
102         tab-size = 8            # Number of spaces per tab
103 --------------------------------------------------------------------------
105 The type of variables is either bool, int, string, or mixed.
107 Valid bool values::
109         To set a bool variable to true use either "1", "true", or "yes".
110         Any other value will set the variable to false.
112 Valid int values::
114         A non-negative integer.
116 Valid string values::
118         A string of characters. Optionally, use either ' or " as delimiters.
120 Valid mixed values::
122         These values are composites of the above types. The valid values are
123         specified in the description.
125 Variables
126 ~~~~~~~~~
128 The following variables can be set:
130 'author-width' (int)::
132         Width of the author column. When set to 5 or below, the author name
133         will be abbreviated to the author's initials.
136 'filename-width' (int)::
138         Width of the filename column.
140 'id-width' (int)::
142         Width of the commit ID. When unset tig will use the value of
143         'core.abbrev' if found or default to 7.  See git-config(1) on how to
144         set 'core.abbrev'.
146 'diff-options' (string)::
148         A space separate string of diff options to use in the diff view.
149         git-show(1) is used for formatting and always passes --patch-with-stat.
150         This option overrides any options specified in the TIG_DIFF_OPTS
151         environment variable (described in manpage:tig[1]), but is itself
152         overridden by diff flags given on the command line invocation.
154 'blame-options' (string)::
156         A space separated string of extra blame options. Can be used for
157         telling git-blame(1) how to detect the origin of lines. The value
158         is ignored when tig is started in blame mode and given blame options
159         on the command line.
161 'line-graphics' (mixed) [ "ascii" | "default" | "utf-8" | bool]::
163         What type of character graphics for line drawing.
165 'line-number-interval' (int)::
167         Interval between line numbers. Note, you have to toggle on line
168         numbering with ".".  The default is to number every fifth line.
170 'horizontal-scroll' (mixed)::
172         Interval to scroll horizontally in each step. Can be specified either
173         as the number of columns, e.g. '5', or as a percentage of the view
174         width, e.g. '33%', where the maximum is 100%. For percentages it is
175         always ensured that at least one column is scrolled. The default is to
176         scroll '50%' of the view width.
178 'read-git-colors' (bool)::
180         Whether to read git's color settings. True by default.
182 'show-author' (mixed) ["full", "abbreviated" | "email" | "email-user" | bool]::
184         How to display author names. If set to "abbreviated" author initials
185         will be shown. Can be toggled.
187 'show-filename' (mixed) ["auto" | "always" | bool]::
189         When to display file names. If set to "auto" file names are shown
190         only when needed, e.g. when running: tig blame -C <file>.
192 'show-date' (mixed) ["relative" | "short" | "default" | "local" | bool]::
194         Whether and how to show date. If set to "relative" a relative date will be
195         used, e.g. "2 minutes ago". If set to "short" no time information is
196         shown. If set to "local", localtime(3) is used. Can be toggled.
198 'show-notes' (mixed) [note reference | bool]::
200         Whether to show notes for a commit. When set to a note reference the
201         reference is passed to `git show --notes=`. Notes are enabled by
202         default.
204 'show-refs' (bool)::
206         Whether to show references (branches, tags, and remotes) in the main
207         view on start-up. Can be toggled.
209 'show-id' (bool)::
211         Whether to show commit IDs in the main view. Disabled by default. Can
212         be toggled. See also 'id-width' option.
214 'title-overflow' (mixed) [bool | int]::
216         Whether to highlight text in commit titles exceeding a given width.
217         When set to a boolean, it enables/disables the highlighting using the
218         default width of 50 character. When set to an int, the assigned value
219         is used as the maximum character width.
221 'show-rev-graph' (bool)::
223         Whether to show revision graph in the main view on start-up.
224         Can be toggled. See also line-graphics options.
226 'show-changes' (bool)::
228         Whether to show staged and unstaged changes in the main view.
229         Can be toggled.
231 'show-line-numbers' (bool)::
233         Whether to show line numbers. Can be toggled.
235 'vertical-split' (bool)::
237         Whether to split the view horizontally or vertically.
239 'split-view-height' (mixed)::
241         Height of the lower view in a split view. Can be specified either as
242         the number of rows, e.g. '5', or as a percentage of the view height,
243         e.g. '80%', where the maximum is 100%. It is always ensured that the
244         smaller of the views is at least four rows high. The default is a view
245         height of '66%'.
247 'status-untracked-dirs' (bool)::
249         Show untracked directories contents in the status view (analog to
250         `git ls-files --directory` option). On by default.
252 'tab-size' (int)::
254         Number of spaces per tab. The default is 8 spaces.
256 'diff-context' (int)::
258         Number of context lines to show for diffs.
260 'ignore-space' (mixed) ["no" | "all" | "some" | "at-eol" | bool]::
262     Ignore space changes in diff view. By default no space changes are ignored.
263     Changing this to "all", "some" or "at-eol" is equivalent to passing
264     "--ignore-all-space", "--ignore-space" or "--ignore-space-at-eol"
265     respectively to `git diff` or `git show`.
267 'commit-order' (mixed) ["default" | "topo" | "date" | "reverse" | bool]::
269         Commit ordering using the default (chronological reverse) order,
270         topological order, date order or reverse order. The default order is
271         used when the option is set to false, and topo order when set to true.
273 'ignore-case' (bool)::
275         Ignore case in searches. By default, the search is case sensitive.
277 'wrap-lines' (bool)::
279         Wrap long lines. By default, lines are not wrapped.
280         Not compatible with line numbers enabled.
282 'focus-child' (bool)::
284         Whether to focus the child view when it is opened. When disabled the
285         focus will remain in the parent view, avoiding reloads of the child
286         view when navigating the parent view. True by default.
288 'editor-line-number' (bool)::
290         Whether to pass the selected line number to the editor command. The
291         line number is passed as `+<line-number>` in front of the file name.
292         Example: `vim +10 tig.c`
294 Bind command
295 ------------
297 Using bind commands keys can be mapped to an action when pressed in a given
298 key map. The syntax is:
300 [verse]
301 *bind* 'keymap' 'key' 'action'
303 Examples:
305 --------------------------------------------------------------------------
306 # A few keybindings
307 bind main w scroll-line-up
308 bind main s scroll-line-down
309 bind main space enter
310 bind diff a previous
311 bind diff d next
312 bind diff b move-first-line
313 # An external command to update from upstream
314 bind generic F !git fetch
315 --------------------------------------------------------------------------
317 Or in the git configuration files:
319 --------------------------------------------------------------------------
320 [tig "bind"]
321         # 'unbind' the default quit key binding
322         main = Q none
323         # Cherry-pick current commit onto current branch
324         generic = C !git cherry-pick %(commit)
325 --------------------------------------------------------------------------
327 Keys are mapped by first searching the keybindings for the current view, then
328 the keybindings for the *generic* keymap, and last the default keybindings.
329 Thus, the view keybindings shadow the generic keybindings which Shadow the
330 built-in keybindings.
334 Keymaps::
336 Valid keymaps are: *main*, *diff*, *log*, *help*, *pager*, *status*, *stage*,
337 *tree*, *blob*, *blame*, *branch*, and *generic*.  Use *generic* to set key
338 mapping in all keymaps.
340 Key values::
342 Key values should never be quoted. Use either the ASCII value or one of the
343 following symbolic key names. Symbolic key names are case insensitive, Use
344 *Hash* to bind to the `#` key, since the hash mark is used as a comment
345 character.
347 *Enter*, *Space*, *Backspace*, *Tab*, *Escape*, *Left*, *Right*, *Up*, *Down*,
348 *Insert*, *Delete*, *Hash*, *Home*, *End*, *PageUp*, *PageDown*, *F1*, *F2*, *F3*,
349 *F4*, *F5*, *F6*, *F7*, *F8*, *F9*, *F10*, *F11*, *F12*.
351 Action names::
353 Valid action names are described below. Note, all names are
354 case-insensitive, and you may use '-', '_', and '.' interchangeably,
355 e.g. "view-main", "View.Main", and "VIEW_MAIN" are the same.
359 Actions
360 ~~~~~~~
362 Apart from the action names listed below, all actions starting with a '!' or
363 ':' are treated specially.
365 Actions beginning with a ':' will run an internal tig command.  These internal
366 commands are those which you put in a configuration file or type at the tig
367 prompt.  As an example, "bind generic S :source .tigrc" will source a .tigrc
368 file in the current directory when 'S' is pressed.
370 Actions beginning with a '!' will be available as an external command. External
371 commands can contain variable names that will be substituted before the command
372 is run. Valid variable names are:
374 .Browsing state variables
375 [frame="none",grid="none",cols="25<m,75<"]
376 |=============================================================================
377 |%(head)                |The currently viewed 'head' ID. Defaults to HEAD
378 |%(commit)              |The currently selected commit ID.
379 |%(blob)                |The currently selected blob ID.
380 |%(branch)              |The currently selected branch name.
381 |%(directory)           |The current directory path in the tree view;
382                          empty for the root directory.
383 |%(file)                |The currently selected file.
384 |%(ref)                 |The reference given to blame or HEAD if undefined.
385 |%(revargs)             |The revision arguments passed on the command line.
386 |%(fileargs)            |The file arguments passed on the command line.
387 |%(diffargs)            |The diff options passed on the command line.
388 |%(prompt)              |Prompt for the argument value.
389 |=============================================================================
391 As an example, the following external command will save the current commit as
392 a patch file: "!git format-patch -1 %(commit)". If your external command
393 requires use of dynamic features, such as subshells, expansion of environment
394 variables and process control, this can be achieved by using a shell command:
396 .Configure a binding in ~/.tigrc to put a commit ID in the clipboard.
397 --------------------------------------------------------------------------
398 bind generic I !@sh -c "echo -n %(commit) | xclip -selection c"
399 --------------------------------------------------------------------------
401 Or by using a combination of git aliases and tig external commands. The
402 following example entries can be put in either the .gitconfig or .git/config
403 file:
405 .Git configuration which binds tig keys to git command aliases.
406 --------------------------------------------------------------------------
407 [alias]
408         gitk-bg = !"gitk HEAD --not $(git rev-parse --remotes) &"
409         publish = !"for i in origin public; do git push $i; done"
410 [tig "bind"]
411         # @-prefix means that the console output will not be shown.
412         generic = V !@git gitk-bg
413         generic = > !git publish
414 --------------------------------------------------------------------------
416 By default, commands are run in the foreground with their console output
417 shown. For different behavior, commands can be prefixed with one or more of
418 the following control flags to specify how it should be executed:
420 .External command control flags
421 [frame="none",grid="none",cols="25<m,75<"]
422 |=============================================================================
423 |@                      |Run the command in the background with no output.
424 |?                      |Prompt the user before executing the command.
425 |<                      |Exit tig after executing the command.
426 |=============================================================================
428 Control flags can be combined, e.g. "!?<git commit" will prompt whether to
429 execute the command and will exit tig after completion.
431 .View switching
432 [frame="none",grid="none",cols="25<m,75<"]
433 |=============================================================================
434 |view-main              |Show main view
435 |view-diff              |Show diff view
436 |view-log               |Show log view
437 |view-tree              |Show tree view
438 |view-blob              |Show blob view
439 |view-blame             |Show blame view
440 |view-branch            |Show branch view
441 |view-status            |Show status view
442 |view-stage             |Show stage view
443 |view-pager             |Show pager view
444 |view-help              |Show help page
445 |=============================================================================
447 .View manipulation
448 [frame="none",grid="none",cols="25<m,75<"]
449 |=============================================================================
450 |enter                  |Enter current line and scroll
451 |next                   |Move to next
452 |previous               |Move to previous
453 |parent                 |Move to parent
454 |view-next              |Move focus to next view
455 |refresh                |Reload and refresh view
456 |maximize               |Maximize the current view
457 |view-close             |Close the current view
458 |quit                   |Close all views and quit
459 |=============================================================================
461 .View specific actions
462 [frame="none",grid="none",cols="25<m,75<"]
463 |=============================================================================
464 |status-update          |Update file status
465 |status-merge           |Resolve unmerged file
466 |stage-update-line      |Stage single line
467 |stage-next             |Find next chunk to stage
468 |diff-context-up        |Increase the diff context
469 |diff-context-down      |Decrease the diff context
470 |=============================================================================
472 .Cursor navigation
473 [frame="none",grid="none",cols="25<m,75<"]
474 |=============================================================================
475 |move-up                |Move cursor one line up
476 |move-down              |Move cursor one line down
477 |move-page-down         |Move cursor one page down
478 |move-page-up           |Move cursor one page up
479 |move-first-line        |Move cursor to first line
480 |move-last-line         |Move cursor to last line
481 |=============================================================================
483 .Scrolling
484 [frame="none",grid="none",cols="25<m,75<"]
485 |=============================================================================
486 |scroll-line-up         |Scroll one line up
487 |scroll-line-down       |Scroll one line down
488 |scroll-page-up         |Scroll one page up
489 |scroll-page-down       |Scroll one page down
490 |scroll-first-col       |Scroll to the first column
491 |scroll-left            |Scroll one column left
492 |scroll-right           |Scroll one column right
493 |=============================================================================
495 .Searching
496 [frame="none",grid="none",cols="25<m,75<"]
497 |=============================================================================
498 |search                 |Search the view
499 |search-back            |Search backwards in the view
500 |find-next              |Find next search match
501 |find-prev              |Find previous search match
502 |=============================================================================
504 .Misc
505 [frame="none",grid="none",cols="25<m,75<"]
506 |=============================================================================
507 |prompt                 |Bring up the prompt
508 |screen-redraw          |Redraw the screen
509 |screen-resize          |Resize the screen
510 |show-version           |Show version information
511 |stop-loading           |Stop all loading views
512 |options                |Open options menu
513 |toggle-lineno          |Toggle line numbers
514 |toggle-date            |Toggle date display
515 |toggle-author          |Toggle author display
516 |toggle-filename        |Toggle file name display
517 |toggle-rev-graph       |Toggle revision graph visualization
518 |toggle-graphic         |Toggle (line) graphics mode
519 |toggle-refs            |Toggle reference display
520 |toggle-files           |Toggle file filtering for the diff and main views
521 |edit                   |Open in editor
522 |none                   |Do nothing
523 |=============================================================================
526 Color command
527 -------------
529 Color commands control highlighting and the user interface styles. If your
530 terminal supports color, these commands can be used to assign foreground and
531 background combinations to certain areas. Optionally, an attribute can be
532 given as the last parameter. The syntax is:
534 [verse]
535 *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
537 Examples:
539 ------------------------------------------------------------------------------
540 # Override the default terminal colors to white on black.
541 color default           white   black
542 # Diff colors
543 color diff-header       yellow  default
544 color diff-index        blue    default
545 color diff-chunk        magenta default
546 color "Reported-by:"    green   default
547 --------------------------------------------------------------------------
549 Or in the git configuration files:
551 --------------------------------------------------------------------------
552 [tig "color"]
553         # A strange looking cursor line
554         cursor          red     default underline
555         # UI colors
556         title-blur      white   blue
557         title-focus     white   blue    bold
558 ------------------------------------------------------------------------------
560 Area names::
562         Can be either a built-in area name or a custom quoted string. The
563         latter allows custom color rules to be added for lines matching a
564         quoted string.
565         Valid built-in area names are described below. Note, all names are
566         case-insensitive, and you may use '-', '_', and '.' interchangeably,
567         e.g. "Diff-Header", "DIFF_HEADER", and "diff.header" are the same.
569 Color names::
571         Valid colors include: *white*, *black*, *green*, *magenta*, *blue*,
572         *cyan*, *yellow*, *red*, *default*. Use *default* to refer to the
573         default terminal colors. This is recommended for background colors if
574         you are using a terminal with a transparent background.
576 Colors can also be specified using the keywords color0, color1, ..., colorN-1
577 (N being the number of colors supported by your terminal). This is useful when
578 you remap the colors for your display or want to enable colors supported by
579 256-color terminals.
581 Attribute names::
583         Valid attributes include: *normal*, *blink*, *bold*, *dim*, *reverse*,
584         *standout*, and *underline*. Note, not all attributes may be supported
585         by the terminal.
587 UI colors
588 ~~~~~~~~~
590 The colors and attributes to be used for the text that is not highlighted or
591 that specify the use of the default terminal colors can be controlled by
592 setting the *default* color option.
594 .General
595 [frame="none",grid="none",cols="25<m,75<"]
596 |=============================================================================
597 |default                |Override default terminal colors (see above).
598 |cursor                 |The cursor line.
599 |status                 |The status window showing info messages.
600 |title-focus            |The title window for the current view.
601 |title-blur             |The title window of any backgrounded view.
602 |delimiter              |Delimiter shown for truncated lines.
603 |line-number            |Line numbers.
604 |id                     |The commit ID.
605 |date                   |The commit date.
606 |author                 |The commit author.
607 |mode                   |The file mode holding the permissions and type.
608 |=============================================================================
610 .Main view colors
611 [frame="none",grid="none",cols="25<m,75<"]
612 |=============================================================================
613 |graph-commit           |The commit dot in the revision graph.
614 |palette-[0-6]          |7 different colors,
615 used for distinguishing branches or commits.
616 example: palette-0 = red
617 |main-commit            |The commit comment.
618 |main-head              |Label of the current branch.
619 |main-remote            |Label of a remote.
620 |main-tracked           |Label of the remote tracked by the current branch.
621 |main-tag               |Label of a signed tag.
622 |main-local-tag         |Label of a local tag.
623 |main-ref               |Label of any other reference.
624 |=============================================================================
626 .Status view
627 [frame="none",grid="none",cols="25<m,75<"]
628 |=============================================================================
629 |stat-head              |The "On branch"-line.
630 |stat-section           |Status section titles,
631 |stat-staged            |Status flag of staged files.
632 |stat-unstaged          |Status flag of unstaged files.
633 |stat-untracked         |Status flag of untracked files.
634 |=============================================================================
636 .Tree view
637 [frame="none",grid="none",cols="25<m,75<"]
638 |=============================================================================
639 |tree-head              |The "Directory /"-line
640 |tree-dir               |The directory name.
641 |tree-file              |The file name.
642 |=============================================================================
644 Highlighting
645 ~~~~~~~~~~~~
649 Diff markup::
651 Options concerning diff start, chunks and lines added and deleted.
653 *diff-header*, *diff-chunk*, *diff-add*, *diff-del*
655 Enhanced git diff markup::
657 Extra diff information emitted by the git diff machinery, such as mode
658 changes, rename detection, and similarity.
660 *diff-oldmode*, *diff-newmode*, *diff-copy-from*, *diff-copy-to*,
661 *diff-rename-from*, *diff-rename-to*, *diff-deleted-file-mode*,
662 *diff-similarity*, *diff-dissimilarity* *diff-tree*, *diff-index*, *diff-stat*
664 Pretty print commit headers::
666 Commit diffs and the revision logs are usually formatted using pretty printed
667 headers , unless `--pretty=raw` was given. This includes lines, such as merge
668 info, commit ID, and author and committer date.
670 *pp-author*, *pp-commit*, *pp-merge*, *pp-date*, *pp-adate*, *pp-cdate*,
671 *pp-refs*
673 Raw commit header::
675 Usually shown when `--pretty=raw` is given, however 'commit' is pretty much
676 omnipresent.
678 *commit*, *parent*, *tree*, *author*, *committer*
680 Commit message::
682 `Signed-off-by`, `Acked-by`, `Reviewed-by` and `Tested-by` lines are colorized.
684 *signoff*, *acked*, *reviewed*, *tested*
686 Tree markup::
688 Colors for information of the tree view.
690 *tree-dir*, *tree-file*
694 Source command
695 -------------
697 Source commands make it possible to read additional configuration files.
698 Sourced files are included in-place, meaning when a 'source' command is
699 encountered the file will be immediately read. Any commands later in the
700 current configuration file will take precedence. The syntax is:
702 [verse]
703 *source* 'path'
705 Examples:
707 ------------------------------------------------------------------------------
708 source ~/.tig/colorscheme.tigrc
709 source ~/.tig/keybindings.tigrc
710 --------------------------------------------------------------------------
712 COPYRIGHT
713 ---------
714 Copyright (c) 2006-2012 Jonas Fonseca <fonseca@diku.dk>
716 This program is free software; you can redistribute it and/or modify
717 it under the terms of the GNU General Public License as published by
718 the Free Software Foundation; either version 2 of the License, or
719 (at your option) any later version.
721 SEE ALSO
722 --------
723 manpage:tig[1], manpage:tigmanual[7], git-config(1),
724 and the http://jonas.nitro.dk/tig/manual.html[tig manual].