6 tigrc - tig configuration file
12 *set* 'variable' *=* 'value'
13 *bind* 'keymap' 'key' 'action'
14 *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
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
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
36 A few selective variables can be configured via the set command. The syntax
40 *set* variables *=* value
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 --------------------------------------------------------------------------
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.
69 To set a bool variable to true use either "1", "true", or "yes".
70 Any other value will set the variable to false.
74 A non-negative integer.
78 A string of characters. Optionally, use either ' or " as delimiters.
82 These values are composites of the above types. The valid values are
83 specified in the description.
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
107 'line-graphics' (mixed) [ "ascii" | "default" | "utf8" | 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`.
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 'show-changes' (bool)::
156 Whether to show staged and unstaged changes in the main view.
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
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.
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 'ignore-space' (mixed) ["no" | "all" | "some" | "at-eol" | bool]::
182 Ignore space changes in diff view. By default no space changes are ignored.
183 Changing this to "all", "some" or "at-eol" is equivalent to passing
184 "--ignore-all-space", "--ignore-space" or "--ignore-space-at-eol"
185 respectively to `git diff` or `git show`.
190 Using bind commands keys can be mapped to an action when pressed in a given
191 key map. The syntax is:
194 *bind* 'keymap' 'key' 'action'
198 --------------------------------------------------------------------------
200 bind main w scroll-line-up
201 bind main s scroll-line-down
202 bind main space enter
205 bind diff b move-first-line
206 # An external command to update from upstream
207 bind generic F !git fetch
208 --------------------------------------------------------------------------
210 Or in the git configuration files:
212 --------------------------------------------------------------------------
214 # 'unbind' the default quit key binding
216 # Cherry-pick current commit onto current branch
217 generic = C !git cherry-pick %(commit)
218 --------------------------------------------------------------------------
220 Keys are mapped by first searching the keybindings for the current view, then
221 the keybindings for the *generic* keymap, and last the default keybindings.
222 Thus, the view keybindings shadow the generic keybindings which Shadow the
223 built-in keybindings.
229 Valid keymaps are: *main*, *diff*, *log*, *help*, *pager*, *status*, *stage*,
230 *tree*, *blob*, *blame*, *branch*, and *generic*. Use *generic* to set key
231 mapping in all keymaps.
235 Key values should never be quoted. Use either the ASCII value or one of the
236 following symbolic key names. Symbolic key names are case insensitive, Use
237 *Hash* to bind to the `#` key, since the hash mark is used as a comment
240 *Enter*, *Space*, *Backspace*, *Tab*, *Escape*, *Left*, *Right*, *Up*, *Down*,
241 *Insert*, *Delete*, *Hash*, *Home*, *End*, *PageUp*, *PageDown*, *F1*, *F2*, *F3*,
242 *F4*, *F5*, *F6*, *F7*, *F8*, *F9*, *F10*, *F11*, *F12*.
246 Valid action names are described below. Note, all names are
247 case-insensitive, and you may use '-', '_', and '.' interchangeably,
248 e.g. "view-main", "View.Main", and "VIEW_MAIN" are the same.
255 Apart from the action names listed below, all actions starting with a '!' will
256 be available as an external command. External commands can contain variable
257 names that will be substituted before the command is run. By default, commands
258 are run in the foreground with their console output shown, if they should be
259 run in the background wit no output prefix the command with '@'. Valid
262 .Browsing state variables
263 [frame="none",grid="none",cols="25<m,75<"]
264 |=============================================================================
265 |%(head) |The currently viewed 'head' ID. Defaults to HEAD
266 |%(commit) |The currently selected commit ID.
267 |%(blob) |The currently selected blob ID.
268 |%(branch) |The currently selected branch name.
269 |%(directory) |The current directory path in the tree view;
270 empty for the root directory.
271 |%(file) |The currently selected file.
272 |%(ref) |The reference given to blame or HEAD if undefined.
273 |%(revargs) |The revision arguments passed on the command line.
274 |%(fileargs) |The file arguments passed on the command line.
275 |%(diffargs) |The diff options passed on the command line.
276 |=============================================================================
278 As an example, the following external command will save the current commit as
279 a patch file: "!git format-patch -1 %(commit)". If your external command
280 require use of dynamic features, such as subshells, expansion of environment
281 variables and process control, this can be achieved by using a combination of
282 git aliases and tig external commands. The following example entries can be
283 put in either the .gitconfig or .git/config file:
285 --------------------------------------------------------------------------
287 gitk-bg = !"gitk HEAD --not $(git rev-parse --remotes) &"
288 publish = !"for i in origin public; do git push $i; done"
290 # @-prefix means that the console output will not be shown.
291 generic = V !@git gitk-bg
292 generic = > !git publish
293 --------------------------------------------------------------------------
296 [frame="none",grid="none",cols="25<m,75<"]
297 |=============================================================================
298 |view-main |Show main view
299 |view-diff |Show diff view
300 |view-log |Show log view
301 |view-tree |Show tree view
302 |view-blob |Show blob view
303 |view-blame |Show blame view
304 |view-branch |Show branch view
305 |view-status |Show status view
306 |view-stage |Show stage view
307 |view-pager |Show pager view
308 |view-help |Show help page
309 |=============================================================================
312 [frame="none",grid="none",cols="25<m,75<"]
313 |=============================================================================
314 |enter |Enter current line and scroll
316 |previous |Move to previous
317 |parent |Move to parent
318 |view-next |Move focus to next view
319 |refresh |Reload and refresh view
320 |maximize |Maximize the current view
321 |view-close |Close the current view
322 |quit |Close all views and quit
323 |=============================================================================
325 .View specific actions
326 [frame="none",grid="none",cols="25<m,75<"]
327 |=============================================================================
328 |status-update |Update file status
329 |status-merge |Resolve unmerged file
330 |stage-update-line |Stage single line
331 |stage-next |Find next chunk to stage
332 |diff-context-up |Increase the diff context
333 |diff-context-down |Decrease the diff context
334 |=============================================================================
337 [frame="none",grid="none",cols="25<m,75<"]
338 |=============================================================================
339 |move-up |Move cursor one line up
340 |move-down |Move cursor one line down
341 |move-page-down |Move cursor one page down
342 |move-page-up |Move cursor one page up
343 |move-first-line |Move cursor to first line
344 |move-last-line |Move cursor to last line
345 |=============================================================================
348 [frame="none",grid="none",cols="25<m,75<"]
349 |=============================================================================
350 |scroll-line-up |Scroll one line up
351 |scroll-line-down |Scroll one line down
352 |scroll-page-up |Scroll one page up
353 |scroll-page-down |Scroll one page down
354 |scroll-first-col |Scroll to the first column
355 |scroll-left |Scroll one column left
356 |scroll-right |Scroll one column right
357 |=============================================================================
360 [frame="none",grid="none",cols="25<m,75<"]
361 |=============================================================================
362 |search |Search the view
363 |search-back |Search backwards in the view
364 |find-next |Find next search match
365 |find-prev |Find previous search match
366 |=============================================================================
369 [frame="none",grid="none",cols="25<m,75<"]
370 |=============================================================================
371 |prompt |Bring up the prompt
372 |screen-redraw |Redraw the screen
373 |screen-resize |Resize the screen
374 |show-version |Show version information
375 |stop-loading |Stop all loading views
376 |options |Open options menu
377 |toggle-lineno |Toggle line numbers
378 |toggle-date |Toggle date display
379 |toggle-author |Toggle author display
380 |toggle-filename |Toggle file name display
381 |toggle-rev-graph |Toggle revision graph visualization
382 |toggle-graphic |Toggle (line) graphics mode
383 |toggle-refs |Toggle reference display
384 |edit |Open in editor
386 |=============================================================================
392 Color commands control highlighting and the user interface styles. If your
393 terminal supports color, these commands can be used to assign foreground and
394 background combinations to certain areas. Optionally, an attribute can be
395 given as the last parameter. The syntax is:
398 *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
402 ------------------------------------------------------------------------------
403 # Overwrite the default terminal colors to white on black.
404 color default white black
406 color diff-header yellow default
407 color diff-index blue default
408 color diff-chunk magenta default
409 color "Reported-by:" green default
410 --------------------------------------------------------------------------
412 Or in the git configuration files:
414 --------------------------------------------------------------------------
416 # A strange looking cursor line
417 cursor red default underline
419 title-blur white blue
420 title-focus white blue bold
421 ------------------------------------------------------------------------------
425 Can be either a built-in area name or a custom quoted string. The
426 latter allows custom color rules to be added for lines matching a
428 Valid built-in area names are described below. Note, all names are
429 case-insensitive, and you may use '-', '_', and '.' interchangeably,
430 e.g. "Diff-Header", "DIFF_HEADER", and "diff.header" are the same.
434 Valid colors include: *white*, *black*, *green*, *magenta*, *blue*,
435 *cyan*, *yellow*, *red*, *default*. Use *default* to refer to the
436 default terminal colors. This is recommended for background colors if
437 you are using a terminal with a transparent background.
439 Colors can also be specified using the keywords color0, color1, ..., colorN-1
440 (N being the number of colors supported by your terminal). This is useful when
441 you remap the colors for your display or want to enable colors supported by
446 Valid attributes include: *normal*, *blink*, *bold*, *dim*, *reverse*,
447 *standout*, and *underline*. Note, not all attributes may be supported
453 The colors and attributes to be used for the text that is not highlighted or
454 that specify the use of the default terminal colors can be controlled by
455 setting the *default* color option.
458 [frame="none",grid="none",cols="25<m,75<"]
459 |=============================================================================
460 |default |Overwrite default terminal colors (see above).
461 |cursor |The cursor line.
462 |status |The status window showing info messages.
463 |title-focus |The title window for the current view.
464 |title-blur |The title window of any backgrounded view.
465 |delimiter |Delimiter shown for truncated lines.
466 |line-number |Line numbers.
467 |date |The commit date.
468 |author |The commit author.
469 |mode |The file mode holding the permissions and type.
470 |=============================================================================
473 [frame="none",grid="none",cols="25<m,75<"]
474 |=============================================================================
475 |graph-commit |The commit dot in the revising graph.
476 |palette-[0-6] |7 different colors,
477 used for distinguishing branches or commits.
478 example: palette-0 = red
479 |main-commit |The commit comment.
480 |main-head |Label of the current branch.
481 |main-remote |Label of a remote.
482 |main-tracked |Label of the remote tracked by the current branch.
483 |main-tag |Label of a signed tag.
484 |main-local-tag |Label of a local tag.
485 |main-ref |Label of any other reference.
486 |=============================================================================
489 [frame="none",grid="none",cols="25<m,75<"]
490 |=============================================================================
491 |stat-head |The "On branch"-line.
492 |stat-section |Status section titles,
493 |stat-staged |Status flag of staged files.
494 |stat-unstaged |Status flag of unstaged files.
495 |stat-untracked |Status flag of untracked files.
496 |=============================================================================
499 [frame="none",grid="none",cols="25<m,75<"]
500 |=============================================================================
501 |blame-id |The commit ID.
502 |=============================================================================
505 [frame="none",grid="none",cols="25<m,75<"]
506 |=============================================================================
507 |tree-head |The "Directory /"-line
508 |tree-dir |The directory name.
509 |tree-file |The file name.
510 |=============================================================================
519 Options concerning diff start, chunks and lines added and deleted.
521 *diff-header*, *diff-chunk*, *diff-add*, *diff-del*
523 Enhanced git diff markup::
525 Extra diff information emitted by the git diff machinery, such as mode
526 changes, rename detection, and similarity.
528 *diff-oldmode*, *diff-newmode*, *diff-copy-from*, *diff-copy-to*,
529 *diff-rename-from*, *diff-rename-to*, *diff-similarity*, *diff-dissimilarity*
530 *diff-tree*, *diff-index*
532 Pretty print commit headers::
534 Commit diffs and the revision logs are usually formatted using pretty printed
535 headers , unless `--pretty=raw` was given. This includes lines, such as merge
536 info, commit ID, and author and committer date.
538 *pp-author*, *pp-commit*, *pp-merge*, *pp-date*, *pp-adate*, *pp-cdate*,
543 Usually shown when `--pretty=raw` is given, however 'commit' is pretty much
546 *commit*, *parent*, *tree*, *author*, *committer*
550 `Signed-off-by`, `Acked-by`, `Reviewed-by` and `Tested-by` lines are colorized.
552 *signoff*, *acked*, *reviewed*, *tested*
556 Colors for information of the tree view.
558 *tree-dir*, *tree-file*
565 Sources commands makes it possible to read additional configuration files.
566 Sourced file are treated in-place, meaning when a 'source' command is
567 encountered it will be immediately read. Any commands, later in the current
568 configuration file will take precedence. The syntax is:
575 ------------------------------------------------------------------------------
576 source ~/.tig/colorscheme.tigrc
577 source ~/.tig/keybindings.tigrc
578 --------------------------------------------------------------------------
582 Copyright (c) 2006-2010 Jonas Fonseca <fonseca@diku.dk>
584 Licensed under the terms of the GNU General Public License.
588 manpage:tig[1], manpage:tigmanual[7], git-config(1),
589 and the http://jonas.nitro.dk/tig/manual.html[tig manual].