manual: Fix the references section title
[tig.git] / tigrc.5.txt
blobd121f1583a30607df48e4c05580dcaa5fc271c39
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]'
17 DESCRIPTION
18 -----------
20 You can permanently set an option by putting it in the `~/.tigrc` file.  The
21 file consists of a series of 'commands'.  Each line of the file may contain
22 only one command.
24 The hash mark ('#') is used as a 'comment' character. All text after the
25 comment character to the end of the line is ignored. You can use comments to
26 annotate your initialization file.
28 Alternatively, options can be set by putting them in one of the git
29 configuration files, which are read by tig on startup. See 'git-config(1)' for
30 which files to use.
32 Set command
33 -----------
35 A few selective variables can be configured via the set command. The syntax
36 is:
38 [verse]
39 *set* variables *=* value
41 Examples:
43 --------------------------------------------------------------------------
44 set show-author = abbreviated   # Show abbreviated author names.
45 set show-date = relative        # Show relative commit date.
46 set show-rev-graph = yes        # Show revision graph?
47 set show-refs = yes             # Show references?
48 set show-line-numbers = no      # Show line numbers?
49 set line-number-interval = 5    # Interval between line numbers
50 set commit-encoding = "UTF-8"   # Commit encoding
51 set horizontal-scroll = 33%     # Scroll 33% of the view width
52 set blame-options = -C -C -C    # Blame lines from other files
53 --------------------------------------------------------------------------
55 Or in the git configuration files:
57 --------------------------------------------------------------------------
58 [tig]
59         show-date = yes         # Show commit date?
60         author-width = 10       # Set width of the author column
61         line-graphics = no      # Disable graphics characters
62         tab-size = 8            # Number of spaces per tab
63 --------------------------------------------------------------------------
65 The type of variables are either bool, int, string, or mixed.
67 Valid bool values::
69         To set a bool variable to true use either "1", "true", or "yes".
70         Any other value will set the variable to false.
72 Valid int values::
74         A non-negative integer.
76 Valid string values::
78         A string of characters. Optionally, use either ' or " as delimiters.
80 Valid mixed values::
82         These values are composites of the above types. The valid values are
83         specified in the description.
85 Variables
86 ~~~~~~~~~
88 The following variables can be set:
90 'author-width' (int)::
92         Width of the author column. When set to 5 or below, the author name
93         will be abbreviated to the author's initials.
96 'filename-width' (int)::
98         Width of the filename column.
100 'blame-options' (string)::
102         A space separated string of extra blame options. Can be used for
103         telling git-blame(1) how to detect the origin of lines. The value
104         is ignored when tig is started in blame mode and given blame options
105         on the command line.
107 'commit-encoding' (string)::
109         The encoding used for commits. The default is UTF-8. Note this option
110         is shadowed by the "i18n.commitencoding" option in `.git/config`.
112 'line-graphics' (mixed) [ "ascii" | "default" | "utf-8" | bool]::
114         What type of character graphics for line drawing.
116 'line-number-interval' (int)::
118         Interval between line numbers. Note, you have to toggle on line
119         numbering with ".".  The default is to number every fifth line.
121 'horizontal-scroll' (mixed)::
123         Interval to scroll horizontally in each step. Can be specified either
124         as the number of columns, e.g. '5', or as a percentage of the view
125         width, e.g. '33%', where the maximum is 100%. For percentages it is
126         always ensured that at least one column is scrolled. The default is to
127         scroll '50%' of the view width.
129 'show-author' (mixed) ["abbreviated" | "full" | bool]::
131         How to display author names. If set to "abbreviated" author initials
132         will be shown. Can be toggled.
134 'show-filename' (mixed) ["auto" | "always" | bool]::
136         When to display file names. If set to "auto" file names are shown
137         only when needed, e.g. when running: tig blame -C <file>.
139 'show-date' (mixed) ["relative" | "short" | "default" | "local" | bool]::
141         Whether and how to show date. If set to "relative" a relative date will be
142         used, e.g. "2 minutes ago". If set to "short" no time information is
143         shown. If set to "local", localtime(3) is used. Can be toggled.
145 'show-notes' (string)::
147         Argument passed to `git show --notes=`. The empty string means `--notes`.
149 'show-refs' (bool)::
151         Whether to show references (branches, tags, and remotes) in the main
152         view on start-up. Can be toggled.
154 'show-rev-graph' (bool)::
156         Whether to show revision graph in the main view on start-up.
157         Can be toggled. See also line-graphics options.
159 'split-view-height' (mixed)::
161         Height of the lower view in a split view. Can be specified either as
162         the number of rows, e.g. '5', or as a percentage of the view height,
163         e.g. '80%', where the maximum is 100%. It is always ensured that the
164         smaller of the views is at least four rows high. The default is a view
165         height of '66%'.
167 'status-untracked-dirs' (bool)::
169         Show untracked directories contents in the status view (analog to
170         `git ls-files --directory` option). On by default.
172 'tab-size' (int)::
174         Number of spaces per tab. The default is 8 spaces.
176 'diff-context' (int)::
178         Number of context lines to show for diffs.
180 Bind command
181 ------------
183 Using bind commands keys can be mapped to an action when pressed in a given
184 key map. The syntax is:
186 [verse]
187 *bind* 'keymap' 'key' 'action'
189 Examples:
191 --------------------------------------------------------------------------
192 # A few keybindings
193 bind main w scroll-line-up
194 bind main s scroll-line-down
195 bind main space enter
196 bind diff a previous
197 bind diff d next
198 bind diff b move-first-line
199 # An external command to update from upstream
200 bind generic F !git fetch
201 --------------------------------------------------------------------------
203 Or in the git configuration files:
205 --------------------------------------------------------------------------
206 [tig "bind"]
207         # 'unbind' the default quit key binding
208         main = Q none
209         # Cherry-pick current commit onto current branch
210         generic = C !git cherry-pick %(commit)
211 --------------------------------------------------------------------------
213 Keys are mapped by first searching the keybindings for the current view, then
214 the keybindings for the *generic* keymap, and last the default keybindings.
215 Thus, the view keybindings shadow the generic keybindings which Shadow the
216 built-in keybindings.
220 Keymaps::
222 Valid keymaps are: *main*, *diff*, *log*, *help*, *pager*, *status*, *stage*,
223 *tree*, *blob*, *blame*, *branch*, and *generic*.  Use *generic* to set key
224 mapping in all keymaps.
226 Key values::
228 Key values should never be quoted. Use either the ASCII value or one of the
229 following symbolic key names. Symbolic key names are case insensitive, Use
230 *Hash* to bind to the `#` key, since the hash mark is used as a comment
231 character.
233 *Enter*, *Space*, *Backspace*, *Tab*, *Escape*, *Left*, *Right*, *Up*, *Down*,
234 *Insert*, *Delete*, *Hash*, *Home*, *End*, *PageUp*, *PageDown*, *F1*, *F2*, *F3*,
235 *F4*, *F5*, *F6*, *F7*, *F8*, *F9*, *F10*, *F11*, *F12*.
237 Action names::
239 Valid action names are described below. Note, all names are
240 case-insensitive, and you may use '-', '_', and '.' interchangeably,
241 e.g. "view-main", "View.Main", and "VIEW_MAIN" are the same.
245 Actions
246 ~~~~~~~
248 Apart from the action names listed below, all actions starting with a '!' will
249 be available as an external command. External commands can contain variable
250 names that will be substituted before the command is run. Valid variable names
251 are:
253 .Browsing state variables
254 [frame="none",grid="none",cols="25<m,75<"]
255 |=============================================================================
256 |%(head)                |The currently viewed 'head' ID. Defaults to HEAD
257 |%(commit)              |The currently selected commit ID.
258 |%(blob)                |The currently selected blob ID.
259 |%(branch)              |The currently selected branch name.
260 |%(directory)           |The current directory path in the tree view;
261                          empty for the root directory.
262 |%(file)                |The currently selected file.
263 |%(ref)                 |The reference given to blame or HEAD if undefined.
264 |%(revargs)             |The revision arguments passed on the command line.
265 |%(fileargs)            |The file arguments passed on the command line.
266 |%(diffargs)            |The diff options passed on the command line.
267 |=============================================================================
269 As an example, the following external command will save the current commit as
270 a patch file: "!git format-patch -1 %(commit)". If your external command
271 require use of dynamic features, such as subshells, expansion of environment
272 variables and process control, this can be achieved by using a combination of
273 git aliases and tig external commands. The following example entries can be
274 put in either the .gitconfig or .git/config file:
276 --------------------------------------------------------------------------
277 [alias]
278         gitk-bg = !"gitk HEAD --not $(git rev-parse --remotes) &"
279         publish = !"for i in origin public; do git push $i; done"
280 [tig "bind"]
281         generic = V !git gitk-bg
282         generic = > !git publish
283 --------------------------------------------------------------------------
285 .View switching
286 [frame="none",grid="none",cols="25<m,75<"]
287 |=============================================================================
288 |view-main              |Show main view
289 |view-diff              |Show diff view
290 |view-log               |Show log view
291 |view-tree              |Show tree view
292 |view-blob              |Show blob view
293 |view-blame             |Show blame view
294 |view-branch            |Show branch view
295 |view-status            |Show status view
296 |view-stage             |Show stage view
297 |view-pager             |Show pager view
298 |view-help              |Show help page
299 |=============================================================================
301 .View manipulation
302 [frame="none",grid="none",cols="25<m,75<"]
303 |=============================================================================
304 |enter                  |Enter current line and scroll
305 |next                   |Move to next
306 |previous               |Move to previous
307 |parent                 |Move to parent
308 |view-next              |Move focus to next view
309 |refresh                |Reload and refresh view
310 |maximize               |Maximize the current view
311 |view-close             |Close the current view
312 |quit                   |Close all views and quit
313 |=============================================================================
315 .View specific actions
316 [frame="none",grid="none",cols="25<m,75<"]
317 |=============================================================================
318 |status-update          |Update file status
319 |status-merge           |Resolve unmerged file
320 |stage-update-line      |Stage single line
321 |stage-next             |Find next chunk to stage
322 |diff-context-up        |Increase the diff context
323 |diff-context-down      |Decrease the diff context
324 |=============================================================================
326 .Cursor navigation
327 [frame="none",grid="none",cols="25<m,75<"]
328 |=============================================================================
329 |move-up                |Move cursor one line up
330 |move-down              |Move cursor one line down
331 |move-page-down         |Move cursor one page down
332 |move-page-up           |Move cursor one page up
333 |move-first-line        |Move cursor to first line
334 |move-last-line         |Move cursor to last line
335 |=============================================================================
337 .Scrolling
338 [frame="none",grid="none",cols="25<m,75<"]
339 |=============================================================================
340 |scroll-line-up         |Scroll one line up
341 |scroll-line-down       |Scroll one line down
342 |scroll-page-up         |Scroll one page up
343 |scroll-page-down       |Scroll one page down
344 |scroll-first-col       |Scroll to the first column
345 |scroll-left            |Scroll one column left
346 |scroll-right           |Scroll one column right
347 |=============================================================================
349 .Searching
350 [frame="none",grid="none",cols="25<m,75<"]
351 |=============================================================================
352 |search                 |Search the view
353 |search-back            |Search backwards in the view
354 |find-next              |Find next search match
355 |find-prev              |Find previous search match
356 |=============================================================================
358 .Misc
359 [frame="none",grid="none",cols="25<m,75<"]
360 |=============================================================================
361 |prompt                 |Bring up the prompt
362 |screen-redraw          |Redraw the screen
363 |screen-resize          |Resize the screen
364 |show-version           |Show version information
365 |stop-loading           |Stop all loading views
366 |options                |Open options menu
367 |toggle-lineno          |Toggle line numbers
368 |toggle-date            |Toggle date display
369 |toggle-author          |Toggle author display
370 |toggle-filename        |Toggle file name display
371 |toggle-rev-graph       |Toggle revision graph visualization
372 |toggle-graphic         |Toggle (line) graphics mode
373 |toggle-refs            |Toggle reference display
374 |edit                   |Open in editor
375 |none                   |Do nothing
376 |=============================================================================
379 Color command
380 -------------
382 Color commands control highlighting and the user interface styles. If your
383 terminal supports color, these commands can be used to assign foreground and
384 background combinations to certain areas. Optionally, an attribute can be
385 given as the last parameter. The syntax is:
387 [verse]
388 *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
390 Examples:
392 ------------------------------------------------------------------------------
393 # Overwrite the default terminal colors to white on black.
394 color default           white   black
395 # Diff colors
396 color diff-header       yellow  default
397 color diff-index        blue    default
398 color diff-chunk        magenta default
399 color "Reported-by:"    green   default
400 --------------------------------------------------------------------------
402 Or in the git configuration files:
404 --------------------------------------------------------------------------
405 [tig "color"]
406         # A strange looking cursor line
407         cursor          red     default underline
408         # UI colors
409         title-blur      white   blue
410         title-focus     white   blue    bold
411 ------------------------------------------------------------------------------
413 Area names::
415         Can be either a built-in area name or a custom quoted string. The
416         latter allows custom color rules to be added for lines matching a
417         quoted string.
418         Valid built-in area names are described below. Note, all names are
419         case-insensitive, and you may use '-', '_', and '.' interchangeably,
420         e.g. "Diff-Header", "DIFF_HEADER", and "diff.header" are the same.
422 Color names::
424         Valid colors include: *white*, *black*, *green*, *magenta*, *blue*,
425         *cyan*, *yellow*, *red*, *default*. Use *default* to refer to the
426         default terminal colors. This is recommended for background colors if
427         you are using a terminal with a transparent background.
429 Colors can also be specified using the keywords color0, color1, ..., colorN-1
430 (N being the number of colors supported by your terminal). This is useful when
431 you remap the colors for your display or want to enable colors supported by
432 256-color terminals.
434 Attribute names::
436         Valid attributes include: *normal*, *blink*, *bold*, *dim*, *reverse*,
437         *standout*, and *underline*. Note, not all attributes may be supported
438         by the terminal.
440 UI colors
441 ~~~~~~~~~
443 The colors and attributes to be used for the text that is not highlighted or
444 that specify the use of the default terminal colors can be controlled by
445 setting the *default* color option.
447 .General
448 [frame="none",grid="none",cols="25<m,75<"]
449 |=============================================================================
450 |default                |Overwrite default terminal colors (see above).
451 |cursor                 |The cursor line.
452 |status                 |The status window showing info messages.
453 |title-focus            |The title window for the current view.
454 |title-blur             |The title window of any backgrounded view.
455 |delimiter              |Delimiter shown for truncated lines.
456 |line-number            |Line numbers.
457 |date                   |The commit date.
458 |author                 |The commit author.
459 |mode                   |The file mode holding the permissions and type.
460 |=============================================================================
462 .Main view colors
463 [frame="none",grid="none",cols="25<m,75<"]
464 |=============================================================================
465 |graph-commit           |The commit dot in the revising graph.
466 |palette-[0-6]          |7 different colors,
467 used for distinguishing branches or commits.
468 example: palette-0 = red
469 |main-commit            |The commit comment.
470 |main-head              |Label of the current branch.
471 |main-remote            |Label of a remote.
472 |main-tracked           |Label of the remote tracked by the current branch.
473 |main-tag               |Label of a signed tag.
474 |main-local-tag         |Label of a local tag.
475 |main-ref               |Label of any other reference.
476 |=============================================================================
478 .Status view
479 [frame="none",grid="none",cols="25<m,75<"]
480 |=============================================================================
481 |stat-head              |The "On branch"-line.
482 |stat-section           |Status section titles,
483 |stat-staged            |Status flag of staged files.
484 |stat-unstaged          |Status flag of unstaged files.
485 |stat-untracked         |Status flag of untracked files.
486 |=============================================================================
488 .Blame view
489 [frame="none",grid="none",cols="25<m,75<"]
490 |=============================================================================
491 |blame-id               |The commit ID.
492 |=============================================================================
494 .Tree view
495 [frame="none",grid="none",cols="25<m,75<"]
496 |=============================================================================
497 |tree-head              |The "Directory /"-line
498 |tree-dir               |The directory name.
499 |tree-file              |The file name.
500 |=============================================================================
502 Highlighting
503 ~~~~~~~~~~~~
507 Diff markup::
509 Options concerning diff start, chunks and lines added and deleted.
511 *diff-header*, *diff-chunk*, *diff-add*, *diff-del*
513 Enhanced git diff markup::
515 Extra diff information emitted by the git diff machinery, such as mode
516 changes, rename detection, and similarity.
518 *diff-oldmode*, *diff-newmode*, *diff-copy-from*, *diff-copy-to*,
519 *diff-rename-from*, *diff-rename-to*, *diff-similarity*, *diff-dissimilarity*
520 *diff-tree*, *diff-index*
522 Pretty print commit headers::
524 Commit diffs and the revision logs are usually formatted using pretty printed
525 headers , unless `--pretty=raw` was given. This includes lines, such as merge
526 info, commit ID, and author and committer date.
528 *pp-author*, *pp-commit*, *pp-merge*, *pp-date*, *pp-adate*, *pp-cdate*,
529 *pp-refs*
531 Raw commit header::
533 Usually shown when `--pretty=raw` is given, however 'commit' is pretty much
534 omnipresent.
536 *commit*, *parent*, *tree*, *author*, *committer*
538 Commit message::
540 `Signed-off-by`, `Acked-by`, `Reviewed-by` and `Tested-by` lines are colorized.
542 *signoff*, *acked*, *reviewed*, *tested*
544 Tree markup::
546 Colors for information of the tree view.
548 *tree-dir*, *tree-file*
552 COPYRIGHT
553 ---------
554 Copyright (c) 2006-2010 Jonas Fonseca <fonseca@diku.dk>
556 Licensed under the terms of the GNU General Public License.
558 SEE ALSO
559 --------
560 manpage:tig[1], manpage:tigmanual[7], git-config(1),
561 and the http://jonas.nitro.dk/tig/manual.html[tig manual].