Offload commit encoding entirely to git
[tig.git] / tigrc.5.txt
blob660d4f938ef86615436b2ea7394da48afc96a1bd
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 show-line-numbers = no      # Show line numbers?
50 set line-number-interval = 5    # Interval between line numbers
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 'line-graphics' (mixed) [ "ascii" | "default" | "utf-8" | bool]::
109         What type of character graphics for line drawing.
111 'line-number-interval' (int)::
113         Interval between line numbers. Note, you have to toggle on line
114         numbering with ".".  The default is to number every fifth line.
116 'horizontal-scroll' (mixed)::
118         Interval to scroll horizontally in each step. Can be specified either
119         as the number of columns, e.g. '5', or as a percentage of the view
120         width, e.g. '33%', where the maximum is 100%. For percentages it is
121         always ensured that at least one column is scrolled. The default is to
122         scroll '50%' of the view width.
124 'show-author' (mixed) ["abbreviated" | "full" | bool]::
126         How to display author names. If set to "abbreviated" author initials
127         will be shown. Can be toggled.
129 'show-filename' (mixed) ["auto" | "always" | bool]::
131         When to display file names. If set to "auto" file names are shown
132         only when needed, e.g. when running: tig blame -C <file>.
134 'show-date' (mixed) ["relative" | "short" | "default" | "local" | bool]::
136         Whether and how to show date. If set to "relative" a relative date will be
137         used, e.g. "2 minutes ago". If set to "short" no time information is
138         shown. If set to "local", localtime(3) is used. Can be toggled.
140 'show-notes' (string)::
142         Argument passed to `git show --notes=`. The empty string means `--notes`.
144 'show-refs' (bool)::
146         Whether to show references (branches, tags, and remotes) in the main
147         view on start-up. Can be toggled.
149 'show-rev-graph' (bool)::
151         Whether to show revision graph in the main view on start-up.
152         Can be toggled. See also line-graphics options.
154 'split-view-height' (mixed)::
156         Height of the lower view in a split view. Can be specified either as
157         the number of rows, e.g. '5', or as a percentage of the view height,
158         e.g. '80%', where the maximum is 100%. It is always ensured that the
159         smaller of the views is at least four rows high. The default is a view
160         height of '66%'.
162 'status-untracked-dirs' (bool)::
164         Show untracked directories contents in the status view (analog to
165         `git ls-files --directory` option). On by default.
167 'tab-size' (int)::
169         Number of spaces per tab. The default is 8 spaces.
171 'diff-context' (int)::
173         Number of context lines to show for diffs.
175 'ignore-space' (mixed) ["no" | "all" | "some" | "at-oel" | bool]::
177     Ignore space changes in diff view. By default no space changes are ignore.
178     Changing this to "all", "some" or "at-eol" is equivalent to passing
179     "--ignore-all-space", "--ignore-space" or "--ignore-space-at-eol"
180     respectively to `git diff` or `git show`.
182 Bind command
183 ------------
185 Using bind commands keys can be mapped to an action when pressed in a given
186 key map. The syntax is:
188 [verse]
189 *bind* 'keymap' 'key' 'action'
191 Examples:
193 --------------------------------------------------------------------------
194 # A few keybindings
195 bind main w scroll-line-up
196 bind main s scroll-line-down
197 bind main space enter
198 bind diff a previous
199 bind diff d next
200 bind diff b move-first-line
201 # An external command to update from upstream
202 bind generic F !git fetch
203 --------------------------------------------------------------------------
205 Or in the git configuration files:
207 --------------------------------------------------------------------------
208 [tig "bind"]
209         # 'unbind' the default quit key binding
210         main = Q none
211         # Cherry-pick current commit onto current branch
212         generic = C !git cherry-pick %(commit)
213 --------------------------------------------------------------------------
215 Keys are mapped by first searching the keybindings for the current view, then
216 the keybindings for the *generic* keymap, and last the default keybindings.
217 Thus, the view keybindings shadow the generic keybindings which Shadow the
218 built-in keybindings.
222 Keymaps::
224 Valid keymaps are: *main*, *diff*, *log*, *help*, *pager*, *status*, *stage*,
225 *tree*, *blob*, *blame*, *branch*, and *generic*.  Use *generic* to set key
226 mapping in all keymaps.
228 Key values::
230 Key values should never be quoted. Use either the ASCII value or one of the
231 following symbolic key names. Symbolic key names are case insensitive, Use
232 *Hash* to bind to the `#` key, since the hash mark is used as a comment
233 character.
235 *Enter*, *Space*, *Backspace*, *Tab*, *Escape*, *Left*, *Right*, *Up*, *Down*,
236 *Insert*, *Delete*, *Hash*, *Home*, *End*, *PageUp*, *PageDown*, *F1*, *F2*, *F3*,
237 *F4*, *F5*, *F6*, *F7*, *F8*, *F9*, *F10*, *F11*, *F12*.
239 Action names::
241 Valid action names are described below. Note, all names are
242 case-insensitive, and you may use '-', '_', and '.' interchangeably,
243 e.g. "view-main", "View.Main", and "VIEW_MAIN" are the same.
247 Actions
248 ~~~~~~~
250 Apart from the action names listed below, all actions starting with a '!' will
251 be available as an external command. External commands can contain variable
252 names that will be substituted before the command is run. Valid variable names
253 are:
255 .Browsing state variables
256 [frame="none",grid="none",cols="25<m,75<"]
257 |=============================================================================
258 |%(head)                |The currently viewed 'head' ID. Defaults to HEAD
259 |%(commit)              |The currently selected commit ID.
260 |%(blob)                |The currently selected blob ID.
261 |%(branch)              |The currently selected branch name.
262 |%(directory)           |The current directory path in the tree view;
263                          empty for the root directory.
264 |%(file)                |The currently selected file.
265 |%(ref)                 |The reference given to blame or HEAD if undefined.
266 |%(revargs)             |The revision arguments passed on the command line.
267 |%(fileargs)            |The file arguments passed on the command line.
268 |%(diffargs)            |The diff options passed on the command line.
269 |=============================================================================
271 As an example, the following external command will save the current commit as
272 a patch file: "!git format-patch -1 %(commit)". If your external command
273 require use of dynamic features, such as subshells, expansion of environment
274 variables and process control, this can be achieved by using a combination of
275 git aliases and tig external commands. The following example entries can be
276 put in either the .gitconfig or .git/config file:
278 --------------------------------------------------------------------------
279 [alias]
280         gitk-bg = !"gitk HEAD --not $(git rev-parse --remotes) &"
281         publish = !"for i in origin public; do git push $i; done"
282 [tig "bind"]
283         generic = V !git gitk-bg
284         generic = > !git publish
285 --------------------------------------------------------------------------
287 .View switching
288 [frame="none",grid="none",cols="25<m,75<"]
289 |=============================================================================
290 |view-main              |Show main view
291 |view-diff              |Show diff view
292 |view-log               |Show log view
293 |view-tree              |Show tree view
294 |view-blob              |Show blob view
295 |view-blame             |Show blame view
296 |view-branch            |Show branch view
297 |view-status            |Show status view
298 |view-stage             |Show stage view
299 |view-pager             |Show pager view
300 |view-help              |Show help page
301 |=============================================================================
303 .View manipulation
304 [frame="none",grid="none",cols="25<m,75<"]
305 |=============================================================================
306 |enter                  |Enter current line and scroll
307 |next                   |Move to next
308 |previous               |Move to previous
309 |parent                 |Move to parent
310 |view-next              |Move focus to next view
311 |refresh                |Reload and refresh view
312 |maximize               |Maximize the current view
313 |view-close             |Close the current view
314 |quit                   |Close all views and quit
315 |=============================================================================
317 .View specific actions
318 [frame="none",grid="none",cols="25<m,75<"]
319 |=============================================================================
320 |status-update          |Update file status
321 |status-merge           |Resolve unmerged file
322 |stage-update-line      |Stage single line
323 |stage-next             |Find next chunk to stage
324 |diff-context-up        |Increase the diff context
325 |diff-context-down      |Decrease the diff context
326 |=============================================================================
328 .Cursor navigation
329 [frame="none",grid="none",cols="25<m,75<"]
330 |=============================================================================
331 |move-up                |Move cursor one line up
332 |move-down              |Move cursor one line down
333 |move-page-down         |Move cursor one page down
334 |move-page-up           |Move cursor one page up
335 |move-first-line        |Move cursor to first line
336 |move-last-line         |Move cursor to last line
337 |=============================================================================
339 .Scrolling
340 [frame="none",grid="none",cols="25<m,75<"]
341 |=============================================================================
342 |scroll-line-up         |Scroll one line up
343 |scroll-line-down       |Scroll one line down
344 |scroll-page-up         |Scroll one page up
345 |scroll-page-down       |Scroll one page down
346 |scroll-first-col       |Scroll to the first column
347 |scroll-left            |Scroll one column left
348 |scroll-right           |Scroll one column right
349 |=============================================================================
351 .Searching
352 [frame="none",grid="none",cols="25<m,75<"]
353 |=============================================================================
354 |search                 |Search the view
355 |search-back            |Search backwards in the view
356 |find-next              |Find next search match
357 |find-prev              |Find previous search match
358 |=============================================================================
360 .Misc
361 [frame="none",grid="none",cols="25<m,75<"]
362 |=============================================================================
363 |prompt                 |Bring up the prompt
364 |screen-redraw          |Redraw the screen
365 |screen-resize          |Resize the screen
366 |show-version           |Show version information
367 |stop-loading           |Stop all loading views
368 |options                |Open options menu
369 |toggle-lineno          |Toggle line numbers
370 |toggle-date            |Toggle date display
371 |toggle-author          |Toggle author display
372 |toggle-filename        |Toggle file name display
373 |toggle-rev-graph       |Toggle revision graph visualization
374 |toggle-graphic         |Toggle (line) graphics mode
375 |toggle-refs            |Toggle reference display
376 |edit                   |Open in editor
377 |none                   |Do nothing
378 |=============================================================================
381 Color command
382 -------------
384 Color commands control highlighting and the user interface styles. If your
385 terminal supports color, these commands can be used to assign foreground and
386 background combinations to certain areas. Optionally, an attribute can be
387 given as the last parameter. The syntax is:
389 [verse]
390 *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
392 Examples:
394 ------------------------------------------------------------------------------
395 # Overwrite the default terminal colors to white on black.
396 color default           white   black
397 # Diff colors
398 color diff-header       yellow  default
399 color diff-index        blue    default
400 color diff-chunk        magenta default
401 color "Reported-by:"    green   default
402 --------------------------------------------------------------------------
404 Or in the git configuration files:
406 --------------------------------------------------------------------------
407 [tig "color"]
408         # A strange looking cursor line
409         cursor          red     default underline
410         # UI colors
411         title-blur      white   blue
412         title-focus     white   blue    bold
413 ------------------------------------------------------------------------------
415 Area names::
417         Can be either a built-in area name or a custom quoted string. The
418         latter allows custom color rules to be added for lines matching a
419         quoted string.
420         Valid built-in area names are described below. Note, all names are
421         case-insensitive, and you may use '-', '_', and '.' interchangeably,
422         e.g. "Diff-Header", "DIFF_HEADER", and "diff.header" are the same.
424 Color names::
426         Valid colors include: *white*, *black*, *green*, *magenta*, *blue*,
427         *cyan*, *yellow*, *red*, *default*. Use *default* to refer to the
428         default terminal colors. This is recommended for background colors if
429         you are using a terminal with a transparent background.
431 Colors can also be specified using the keywords color0, color1, ..., colorN-1
432 (N being the number of colors supported by your terminal). This is useful when
433 you remap the colors for your display or want to enable colors supported by
434 256-color terminals.
436 Attribute names::
438         Valid attributes include: *normal*, *blink*, *bold*, *dim*, *reverse*,
439         *standout*, and *underline*. Note, not all attributes may be supported
440         by the terminal.
442 UI colors
443 ~~~~~~~~~
445 The colors and attributes to be used for the text that is not highlighted or
446 that specify the use of the default terminal colors can be controlled by
447 setting the *default* color option.
449 .General
450 [frame="none",grid="none",cols="25<m,75<"]
451 |=============================================================================
452 |default                |Overwrite default terminal colors (see above).
453 |cursor                 |The cursor line.
454 |status                 |The status window showing info messages.
455 |title-focus            |The title window for the current view.
456 |title-blur             |The title window of any backgrounded view.
457 |delimiter              |Delimiter shown for truncated lines.
458 |line-number            |Line numbers.
459 |date                   |The commit date.
460 |author                 |The commit author.
461 |mode                   |The file mode holding the permissions and type.
462 |=============================================================================
464 .Main view colors
465 [frame="none",grid="none",cols="25<m,75<"]
466 |=============================================================================
467 |graph-commit           |The commit dot in the revising graph.
468 |palette-[0-6]          |7 different colors,
469 used for distinguishing branches or commits.
470 example: palette-0 = red
471 |main-commit            |The commit comment.
472 |main-head              |Label of the current branch.
473 |main-remote            |Label of a remote.
474 |main-tracked           |Label of the remote tracked by the current branch.
475 |main-tag               |Label of a signed tag.
476 |main-local-tag         |Label of a local tag.
477 |main-ref               |Label of any other reference.
478 |=============================================================================
480 .Status view
481 [frame="none",grid="none",cols="25<m,75<"]
482 |=============================================================================
483 |stat-head              |The "On branch"-line.
484 |stat-section           |Status section titles,
485 |stat-staged            |Status flag of staged files.
486 |stat-unstaged          |Status flag of unstaged files.
487 |stat-untracked         |Status flag of untracked files.
488 |=============================================================================
490 .Blame view
491 [frame="none",grid="none",cols="25<m,75<"]
492 |=============================================================================
493 |blame-id               |The commit ID.
494 |=============================================================================
496 .Tree view
497 [frame="none",grid="none",cols="25<m,75<"]
498 |=============================================================================
499 |tree-head              |The "Directory /"-line
500 |tree-dir               |The directory name.
501 |tree-file              |The file name.
502 |=============================================================================
504 Highlighting
505 ~~~~~~~~~~~~
509 Diff markup::
511 Options concerning diff start, chunks and lines added and deleted.
513 *diff-header*, *diff-chunk*, *diff-add*, *diff-del*
515 Enhanced git diff markup::
517 Extra diff information emitted by the git diff machinery, such as mode
518 changes, rename detection, and similarity.
520 *diff-oldmode*, *diff-newmode*, *diff-copy-from*, *diff-copy-to*,
521 *diff-rename-from*, *diff-rename-to*, *diff-similarity*, *diff-dissimilarity*
522 *diff-tree*, *diff-index*
524 Pretty print commit headers::
526 Commit diffs and the revision logs are usually formatted using pretty printed
527 headers , unless `--pretty=raw` was given. This includes lines, such as merge
528 info, commit ID, and author and committer date.
530 *pp-author*, *pp-commit*, *pp-merge*, *pp-date*, *pp-adate*, *pp-cdate*,
531 *pp-refs*
533 Raw commit header::
535 Usually shown when `--pretty=raw` is given, however 'commit' is pretty much
536 omnipresent.
538 *commit*, *parent*, *tree*, *author*, *committer*
540 Commit message::
542 `Signed-off-by`, `Acked-by`, `Reviewed-by` and `Tested-by` lines are colorized.
544 *signoff*, *acked*, *reviewed*, *tested*
546 Tree markup::
548 Colors for information of the tree view.
550 *tree-dir*, *tree-file*
554 Source command
555 -------------
557 Sources commands makes it possible to read additional configuration files.
558 Sourced file are treated in-place, meaning when a 'source' command is
559 encountered it will be immediately read. Any commands, later in the current
560 configuration file will take precedence. The syntax is:
562 [verse]
563 *source* 'path'
565 Examples:
567 ------------------------------------------------------------------------------
568 source ~/.tig/colorscheme.tigrc
569 source ~/.tig/keybindings.tigrc
570 --------------------------------------------------------------------------
572 COPYRIGHT
573 ---------
574 Copyright (c) 2006-2010 Jonas Fonseca <fonseca@diku.dk>
576 Licensed under the terms of the GNU General Public License.
578 SEE ALSO
579 --------
580 manpage:tig[1], manpage:tigmanual[7], git-config(1),
581 and the http://jonas.nitro.dk/tig/manual.html[tig manual].