Only show changes commits for the current branch
[tig.git] / tigrc.5.txt
blobbe881085871aefce583897e5062e4bbaef4a18dd
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 Alternatively, options can be set by putting them in one of the git
30 configuration files, which are read by tig on startup. See 'git-config(1)' for
31 which files to use.
33 Set command
34 -----------
36 A few selective variables can be configured via the set command. The syntax
37 is:
39 [verse]
40 *set* variables *=* value
42 Examples:
44 --------------------------------------------------------------------------
45 set show-author = abbreviated   # Show abbreviated author names.
46 set show-date = relative        # Show relative commit date.
47 set show-rev-graph = yes        # Show revision graph?
48 set show-refs = yes             # Show references?
49 set commit-order = topo         # Order commits topologically
50 set read-git-colors = no        # Do not read git's color settings.
51 set show-line-numbers = no      # Show line numbers?
52 set line-number-interval = 5    # Interval between line numbers
53 set horizontal-scroll = 33%     # Scroll 33% of the view width
54 set blame-options = -C -C -C    # Blame lines from other files
55 --------------------------------------------------------------------------
57 Or in the git configuration files:
59 --------------------------------------------------------------------------
60 [tig]
61         show-date = yes         # Show commit date?
62         author-width = 10       # Set width of the author column
63         line-graphics = no      # Disable graphics characters
64         tab-size = 8            # Number of spaces per tab
65 --------------------------------------------------------------------------
67 The type of variables are either bool, int, string, or mixed.
69 Valid bool values::
71         To set a bool variable to true use either "1", "true", or "yes".
72         Any other value will set the variable to false.
74 Valid int values::
76         A non-negative integer.
78 Valid string values::
80         A string of characters. Optionally, use either ' or " as delimiters.
82 Valid mixed values::
84         These values are composites of the above types. The valid values are
85         specified in the description.
87 Variables
88 ~~~~~~~~~
90 The following variables can be set:
92 'author-width' (int)::
94         Width of the author column. When set to 5 or below, the author name
95         will be abbreviated to the author's initials.
98 'filename-width' (int)::
100         Width of the filename column.
102 'blame-options' (string)::
104         A space separated string of extra blame options. Can be used for
105         telling git-blame(1) how to detect the origin of lines. The value
106         is ignored when tig is started in blame mode and given blame options
107         on the command line.
109 'line-graphics' (mixed) [ "ascii" | "default" | "utf8" | bool]::
111         What type of character graphics for line drawing.
113 'line-number-interval' (int)::
115         Interval between line numbers. Note, you have to toggle on line
116         numbering with ".".  The default is to number every fifth line.
118 'horizontal-scroll' (mixed)::
120         Interval to scroll horizontally in each step. Can be specified either
121         as the number of columns, e.g. '5', or as a percentage of the view
122         width, e.g. '33%', where the maximum is 100%. For percentages it is
123         always ensured that at least one column is scrolled. The default is to
124         scroll '50%' of the view width.
126 'read-git-colors' (bool)::
128         Whether to read git's color settings.
130 'show-author' (mixed) ["abbreviated" | "full" | bool]::
132         How to display author names. If set to "abbreviated" author initials
133         will be shown. Can be toggled.
135 'show-filename' (mixed) ["auto" | "always" | bool]::
137         When to display file names. If set to "auto" file names are shown
138         only when needed, e.g. when running: tig blame -C <file>.
140 'show-date' (mixed) ["relative" | "short" | "default" | "local" | bool]::
142         Whether and how to show date. If set to "relative" a relative date will be
143         used, e.g. "2 minutes ago". If set to "short" no time information is
144         shown. If set to "local", localtime(3) is used. Can be toggled.
146 'show-notes' (mixed) [note reference | bool]::
148         Whether to show notes for a commit. When set to a note reference the
149         reference is passed to `git show --notes=`. Notes are enabled by
150         default.
152 'show-refs' (bool)::
154         Whether to show references (branches, tags, and remotes) in the main
155         view on start-up. Can be toggled.
157 'show-rev-graph' (bool)::
159         Whether to show revision graph in the main view on start-up.
160         Can be toggled. See also line-graphics options.
162 'show-changes' (bool)::
164         Whether to show staged and unstaged changes in the main view.
165         Can be toggled.
167 'split-view-height' (mixed)::
169         Height of the lower view in a split view. Can be specified either as
170         the number of rows, e.g. '5', or as a percentage of the view height,
171         e.g. '80%', where the maximum is 100%. It is always ensured that the
172         smaller of the views is at least four rows high. The default is a view
173         height of '66%'.
175 'status-untracked-dirs' (bool)::
177         Show untracked directories contents in the status view (analog to
178         `git ls-files --directory` option). On by default.
180 'tab-size' (int)::
182         Number of spaces per tab. The default is 8 spaces.
184 'diff-context' (int)::
186         Number of context lines to show for diffs.
188 'ignore-space' (mixed) ["no" | "all" | "some" | "at-eol" | bool]::
190     Ignore space changes in diff view. By default no space changes are ignored.
191     Changing this to "all", "some" or "at-eol" is equivalent to passing
192     "--ignore-all-space", "--ignore-space" or "--ignore-space-at-eol"
193     respectively to `git diff` or `git show`.
195 'commit-order' (mixed) ["default" | "topo" | "date" | "reverse" | bool]::
197         Commit ordering using the default (chronological reverse) order,
198         topological order, date order or reverse order. The default order is
199         used when the option is set to false, and topo order when set to true.
201 'ignore-case' (bool)::
203         Ignore case in searches. By default, the search is case sensitive.
205 Bind command
206 ------------
208 Using bind commands keys can be mapped to an action when pressed in a given
209 key map. The syntax is:
211 [verse]
212 *bind* 'keymap' 'key' 'action'
214 Examples:
216 --------------------------------------------------------------------------
217 # A few keybindings
218 bind main w scroll-line-up
219 bind main s scroll-line-down
220 bind main space enter
221 bind diff a previous
222 bind diff d next
223 bind diff b move-first-line
224 # An external command to update from upstream
225 bind generic F !git fetch
226 --------------------------------------------------------------------------
228 Or in the git configuration files:
230 --------------------------------------------------------------------------
231 [tig "bind"]
232         # 'unbind' the default quit key binding
233         main = Q none
234         # Cherry-pick current commit onto current branch
235         generic = C !git cherry-pick %(commit)
236 --------------------------------------------------------------------------
238 Keys are mapped by first searching the keybindings for the current view, then
239 the keybindings for the *generic* keymap, and last the default keybindings.
240 Thus, the view keybindings shadow the generic keybindings which Shadow the
241 built-in keybindings.
245 Keymaps::
247 Valid keymaps are: *main*, *diff*, *log*, *help*, *pager*, *status*, *stage*,
248 *tree*, *blob*, *blame*, *branch*, and *generic*.  Use *generic* to set key
249 mapping in all keymaps.
251 Key values::
253 Key values should never be quoted. Use either the ASCII value or one of the
254 following symbolic key names. Symbolic key names are case insensitive, Use
255 *Hash* to bind to the `#` key, since the hash mark is used as a comment
256 character.
258 *Enter*, *Space*, *Backspace*, *Tab*, *Escape*, *Left*, *Right*, *Up*, *Down*,
259 *Insert*, *Delete*, *Hash*, *Home*, *End*, *PageUp*, *PageDown*, *F1*, *F2*, *F3*,
260 *F4*, *F5*, *F6*, *F7*, *F8*, *F9*, *F10*, *F11*, *F12*.
262 Action names::
264 Valid action names are described below. Note, all names are
265 case-insensitive, and you may use '-', '_', and '.' interchangeably,
266 e.g. "view-main", "View.Main", and "VIEW_MAIN" are the same.
270 Actions
271 ~~~~~~~
273 Apart from the action names listed below, all actions starting with a '!' will
274 be available as an external command. External commands can contain variable
275 names that will be substituted before the command is run. By default, commands
276 are run in the foreground with their console output shown, if they should be
277 run in the background with no output, prefix the command with '@'. If
278 the command is also prefixed with a '?', the user will be prompted for
279 confirmation. Valid variable names are:
281 .Browsing state variables
282 [frame="none",grid="none",cols="25<m,75<"]
283 |=============================================================================
284 |%(head)                |The currently viewed 'head' ID. Defaults to HEAD
285 |%(commit)              |The currently selected commit ID.
286 |%(blob)                |The currently selected blob ID.
287 |%(branch)              |The currently selected branch name.
288 |%(directory)           |The current directory path in the tree view;
289                          empty for the root directory.
290 |%(file)                |The currently selected file.
291 |%(ref)                 |The reference given to blame or HEAD if undefined.
292 |%(revargs)             |The revision arguments passed on the command line.
293 |%(fileargs)            |The file arguments passed on the command line.
294 |%(diffargs)            |The diff options passed on the command line.
295 |%(prompt)              |Prompt for the argument value.
296 |=============================================================================
298 As an example, the following external command will save the current commit as
299 a patch file: "!git format-patch -1 %(commit)". If your external command
300 require use of dynamic features, such as subshells, expansion of environment
301 variables and process control, this can be achieved by using a combination of
302 git aliases and tig external commands. The following example entries can be
303 put in either the .gitconfig or .git/config file:
305 --------------------------------------------------------------------------
306 [alias]
307         gitk-bg = !"gitk HEAD --not $(git rev-parse --remotes) &"
308         publish = !"for i in origin public; do git push $i; done"
309 [tig "bind"]
310         # @-prefix means that the console output will not be shown.
311         generic = V !@git gitk-bg
312         generic = > !git publish
313 --------------------------------------------------------------------------
315 .View switching
316 [frame="none",grid="none",cols="25<m,75<"]
317 |=============================================================================
318 |view-main              |Show main view
319 |view-diff              |Show diff view
320 |view-log               |Show log view
321 |view-tree              |Show tree view
322 |view-blob              |Show blob view
323 |view-blame             |Show blame view
324 |view-branch            |Show branch view
325 |view-status            |Show status view
326 |view-stage             |Show stage view
327 |view-pager             |Show pager view
328 |view-help              |Show help page
329 |=============================================================================
331 .View manipulation
332 [frame="none",grid="none",cols="25<m,75<"]
333 |=============================================================================
334 |enter                  |Enter current line and scroll
335 |next                   |Move to next
336 |previous               |Move to previous
337 |parent                 |Move to parent
338 |view-next              |Move focus to next view
339 |refresh                |Reload and refresh view
340 |maximize               |Maximize the current view
341 |view-close             |Close the current view
342 |quit                   |Close all views and quit
343 |=============================================================================
345 .View specific actions
346 [frame="none",grid="none",cols="25<m,75<"]
347 |=============================================================================
348 |status-update          |Update file status
349 |status-merge           |Resolve unmerged file
350 |stage-update-line      |Stage single line
351 |stage-next             |Find next chunk to stage
352 |diff-context-up        |Increase the diff context
353 |diff-context-down      |Decrease the diff context
354 |=============================================================================
356 .Cursor navigation
357 [frame="none",grid="none",cols="25<m,75<"]
358 |=============================================================================
359 |move-up                |Move cursor one line up
360 |move-down              |Move cursor one line down
361 |move-page-down         |Move cursor one page down
362 |move-page-up           |Move cursor one page up
363 |move-first-line        |Move cursor to first line
364 |move-last-line         |Move cursor to last line
365 |=============================================================================
367 .Scrolling
368 [frame="none",grid="none",cols="25<m,75<"]
369 |=============================================================================
370 |scroll-line-up         |Scroll one line up
371 |scroll-line-down       |Scroll one line down
372 |scroll-page-up         |Scroll one page up
373 |scroll-page-down       |Scroll one page down
374 |scroll-first-col       |Scroll to the first column
375 |scroll-left            |Scroll one column left
376 |scroll-right           |Scroll one column right
377 |=============================================================================
379 .Searching
380 [frame="none",grid="none",cols="25<m,75<"]
381 |=============================================================================
382 |search                 |Search the view
383 |search-back            |Search backwards in the view
384 |find-next              |Find next search match
385 |find-prev              |Find previous search match
386 |=============================================================================
388 .Misc
389 [frame="none",grid="none",cols="25<m,75<"]
390 |=============================================================================
391 |prompt                 |Bring up the prompt
392 |screen-redraw          |Redraw the screen
393 |screen-resize          |Resize the screen
394 |show-version           |Show version information
395 |stop-loading           |Stop all loading views
396 |options                |Open options menu
397 |toggle-lineno          |Toggle line numbers
398 |toggle-date            |Toggle date display
399 |toggle-author          |Toggle author display
400 |toggle-filename        |Toggle file name display
401 |toggle-rev-graph       |Toggle revision graph visualization
402 |toggle-graphic         |Toggle (line) graphics mode
403 |toggle-refs            |Toggle reference display
404 |edit                   |Open in editor
405 |none                   |Do nothing
406 |=============================================================================
409 Color command
410 -------------
412 Color commands control highlighting and the user interface styles. If your
413 terminal supports color, these commands can be used to assign foreground and
414 background combinations to certain areas. Optionally, an attribute can be
415 given as the last parameter. The syntax is:
417 [verse]
418 *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
420 Examples:
422 ------------------------------------------------------------------------------
423 # Overwrite the default terminal colors to white on black.
424 color default           white   black
425 # Diff colors
426 color diff-header       yellow  default
427 color diff-index        blue    default
428 color diff-chunk        magenta default
429 color "Reported-by:"    green   default
430 --------------------------------------------------------------------------
432 Or in the git configuration files:
434 --------------------------------------------------------------------------
435 [tig "color"]
436         # A strange looking cursor line
437         cursor          red     default underline
438         # UI colors
439         title-blur      white   blue
440         title-focus     white   blue    bold
441 ------------------------------------------------------------------------------
443 Area names::
445         Can be either a built-in area name or a custom quoted string. The
446         latter allows custom color rules to be added for lines matching a
447         quoted string.
448         Valid built-in area names are described below. Note, all names are
449         case-insensitive, and you may use '-', '_', and '.' interchangeably,
450         e.g. "Diff-Header", "DIFF_HEADER", and "diff.header" are the same.
452 Color names::
454         Valid colors include: *white*, *black*, *green*, *magenta*, *blue*,
455         *cyan*, *yellow*, *red*, *default*. Use *default* to refer to the
456         default terminal colors. This is recommended for background colors if
457         you are using a terminal with a transparent background.
459 Colors can also be specified using the keywords color0, color1, ..., colorN-1
460 (N being the number of colors supported by your terminal). This is useful when
461 you remap the colors for your display or want to enable colors supported by
462 256-color terminals.
464 Attribute names::
466         Valid attributes include: *normal*, *blink*, *bold*, *dim*, *reverse*,
467         *standout*, and *underline*. Note, not all attributes may be supported
468         by the terminal.
470 UI colors
471 ~~~~~~~~~
473 The colors and attributes to be used for the text that is not highlighted or
474 that specify the use of the default terminal colors can be controlled by
475 setting the *default* color option.
477 .General
478 [frame="none",grid="none",cols="25<m,75<"]
479 |=============================================================================
480 |default                |Overwrite default terminal colors (see above).
481 |cursor                 |The cursor line.
482 |status                 |The status window showing info messages.
483 |title-focus            |The title window for the current view.
484 |title-blur             |The title window of any backgrounded view.
485 |delimiter              |Delimiter shown for truncated lines.
486 |line-number            |Line numbers.
487 |date                   |The commit date.
488 |author                 |The commit author.
489 |mode                   |The file mode holding the permissions and type.
490 |=============================================================================
492 .Main view colors
493 [frame="none",grid="none",cols="25<m,75<"]
494 |=============================================================================
495 |graph-commit           |The commit dot in the revising graph.
496 |palette-[0-6]          |7 different colors,
497 used for distinguishing branches or commits.
498 example: palette-0 = red
499 |main-commit            |The commit comment.
500 |main-head              |Label of the current branch.
501 |main-remote            |Label of a remote.
502 |main-tracked           |Label of the remote tracked by the current branch.
503 |main-tag               |Label of a signed tag.
504 |main-local-tag         |Label of a local tag.
505 |main-ref               |Label of any other reference.
506 |=============================================================================
508 .Status view
509 [frame="none",grid="none",cols="25<m,75<"]
510 |=============================================================================
511 |stat-head              |The "On branch"-line.
512 |stat-section           |Status section titles,
513 |stat-staged            |Status flag of staged files.
514 |stat-unstaged          |Status flag of unstaged files.
515 |stat-untracked         |Status flag of untracked files.
516 |=============================================================================
518 .Blame view
519 [frame="none",grid="none",cols="25<m,75<"]
520 |=============================================================================
521 |blame-id               |The commit ID.
522 |=============================================================================
524 .Tree view
525 [frame="none",grid="none",cols="25<m,75<"]
526 |=============================================================================
527 |tree-head              |The "Directory /"-line
528 |tree-dir               |The directory name.
529 |tree-file              |The file name.
530 |=============================================================================
532 Highlighting
533 ~~~~~~~~~~~~
537 Diff markup::
539 Options concerning diff start, chunks and lines added and deleted.
541 *diff-header*, *diff-chunk*, *diff-add*, *diff-del*
543 Enhanced git diff markup::
545 Extra diff information emitted by the git diff machinery, such as mode
546 changes, rename detection, and similarity.
548 *diff-oldmode*, *diff-newmode*, *diff-copy-from*, *diff-copy-to*,
549 *diff-rename-from*, *diff-rename-to*, *diff-similarity*, *diff-dissimilarity*
550 *diff-tree*, *diff-index*
552 Pretty print commit headers::
554 Commit diffs and the revision logs are usually formatted using pretty printed
555 headers , unless `--pretty=raw` was given. This includes lines, such as merge
556 info, commit ID, and author and committer date.
558 *pp-author*, *pp-commit*, *pp-merge*, *pp-date*, *pp-adate*, *pp-cdate*,
559 *pp-refs*
561 Raw commit header::
563 Usually shown when `--pretty=raw` is given, however 'commit' is pretty much
564 omnipresent.
566 *commit*, *parent*, *tree*, *author*, *committer*
568 Commit message::
570 `Signed-off-by`, `Acked-by`, `Reviewed-by` and `Tested-by` lines are colorized.
572 *signoff*, *acked*, *reviewed*, *tested*
574 Tree markup::
576 Colors for information of the tree view.
578 *tree-dir*, *tree-file*
582 Source command
583 -------------
585 Sources commands makes it possible to read additional configuration files.
586 Sourced file are treated in-place, meaning when a 'source' command is
587 encountered it will be immediately read. Any commands, later in the current
588 configuration file will take precedence. The syntax is:
590 [verse]
591 *source* 'path'
593 Examples:
595 ------------------------------------------------------------------------------
596 source ~/.tig/colorscheme.tigrc
597 source ~/.tig/keybindings.tigrc
598 --------------------------------------------------------------------------
600 COPYRIGHT
601 ---------
602 Copyright (c) 2006-2012 Jonas Fonseca <fonseca@diku.dk>
604 This program is free software; you can redistribute it and/or modify
605 it under the terms of the GNU General Public License as published by
606 the Free Software Foundation; either version 2 of the License, or
607 (at your option) any later version.
609 SEE ALSO
610 --------
611 manpage:tig[1], manpage:tigmanual[7], git-config(1),
612 and the http://jonas.nitro.dk/tig/manual.html[tig manual].