Toggle to ignore all whitespace changes in diffs; bound to W
[tig.git] / tigrc.5.txt
blob5232067d0283ac2804bdf8d89da22e0c5862f6be
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 commit-encoding = "UTF-8"   # Commit encoding
52 set horizontal-scroll = 33%     # Scroll 33% of the view width
53 set blame-options = -C -C -C    # Blame lines from other files
54 --------------------------------------------------------------------------
56 Or in the git configuration files:
58 --------------------------------------------------------------------------
59 [tig]
60         show-date = yes         # Show commit date?
61         author-width = 10       # Set width of the author column
62         line-graphics = no      # Disable graphics characters
63         tab-size = 8            # Number of spaces per tab
64 --------------------------------------------------------------------------
66 The type of variables are either bool, int, string, or mixed.
68 Valid bool values::
70         To set a bool variable to true use either "1", "true", or "yes".
71         Any other value will set the variable to false.
73 Valid int values::
75         A non-negative integer.
77 Valid string values::
79         A string of characters. Optionally, use either ' or " as delimiters.
81 Valid mixed values::
83         These values are composites of the above types. The valid values are
84         specified in the description.
86 Variables
87 ~~~~~~~~~
89 The following variables can be set:
91 'author-width' (int)::
93         Width of the author column. When set to 5 or below, the author name
94         will be abbreviated to the author's initials.
97 'filename-width' (int)::
99         Width of the filename column.
101 'blame-options' (string)::
103         A space separated string of extra blame options. Can be used for
104         telling git-blame(1) how to detect the origin of lines. The value
105         is ignored when tig is started in blame mode and given blame options
106         on the command line.
108 'commit-encoding' (string)::
110         The encoding used for commits. The default is UTF-8. Note this option
111         is shadowed by the "i18n.commitencoding" option in `.git/config`.
113 'line-graphics' (mixed) [ "ascii" | "default" | "utf-8" | bool]::
115         What type of character graphics for line drawing.
117 'line-number-interval' (int)::
119         Interval between line numbers. Note, you have to toggle on line
120         numbering with ".".  The default is to number every fifth line.
122 'horizontal-scroll' (mixed)::
124         Interval to scroll horizontally in each step. Can be specified either
125         as the number of columns, e.g. '5', or as a percentage of the view
126         width, e.g. '33%', where the maximum is 100%. For percentages it is
127         always ensured that at least one column is scrolled. The default is to
128         scroll '50%' of the view width.
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' (string)::
148         Argument passed to `git show --notes=`. The empty string means `--notes`.
150 'show-refs' (bool)::
152         Whether to show references (branches, tags, and remotes) in the main
153         view on start-up. Can be toggled.
155 'show-rev-graph' (bool)::
157         Whether to show revision graph in the main view on start-up.
158         Can be toggled. See also line-graphics options.
160 'split-view-height' (mixed)::
162         Height of the lower view in a split view. Can be specified either as
163         the number of rows, e.g. '5', or as a percentage of the view height,
164         e.g. '80%', where the maximum is 100%. It is always ensured that the
165         smaller of the views is at least four rows high. The default is a view
166         height of '66%'.
168 'status-untracked-dirs' (bool)::
170         Show untracked directories contents in the status view (analog to
171         `git ls-files --directory` option). On by default.
173 'tab-size' (int)::
175         Number of spaces per tab. The default is 8 spaces.
177 'diff-context' (int)::
179         Number of context lines to show for diffs.
181 'ignore-space' (bool)::
183     Ignore all whitespace changes in diff view. Off by default. Turning this on
184     is equivalent to passing "--ignore-all-space" to `git diff` or `git show`.
186 Bind command
187 ------------
189 Using bind commands keys can be mapped to an action when pressed in a given
190 key map. The syntax is:
192 [verse]
193 *bind* 'keymap' 'key' 'action'
195 Examples:
197 --------------------------------------------------------------------------
198 # A few keybindings
199 bind main w scroll-line-up
200 bind main s scroll-line-down
201 bind main space enter
202 bind diff a previous
203 bind diff d next
204 bind diff b move-first-line
205 # An external command to update from upstream
206 bind generic F !git fetch
207 --------------------------------------------------------------------------
209 Or in the git configuration files:
211 --------------------------------------------------------------------------
212 [tig "bind"]
213         # 'unbind' the default quit key binding
214         main = Q none
215         # Cherry-pick current commit onto current branch
216         generic = C !git cherry-pick %(commit)
217 --------------------------------------------------------------------------
219 Keys are mapped by first searching the keybindings for the current view, then
220 the keybindings for the *generic* keymap, and last the default keybindings.
221 Thus, the view keybindings shadow the generic keybindings which Shadow the
222 built-in keybindings.
226 Keymaps::
228 Valid keymaps are: *main*, *diff*, *log*, *help*, *pager*, *status*, *stage*,
229 *tree*, *blob*, *blame*, *branch*, and *generic*.  Use *generic* to set key
230 mapping in all keymaps.
232 Key values::
234 Key values should never be quoted. Use either the ASCII value or one of the
235 following symbolic key names. Symbolic key names are case insensitive, Use
236 *Hash* to bind to the `#` key, since the hash mark is used as a comment
237 character.
239 *Enter*, *Space*, *Backspace*, *Tab*, *Escape*, *Left*, *Right*, *Up*, *Down*,
240 *Insert*, *Delete*, *Hash*, *Home*, *End*, *PageUp*, *PageDown*, *F1*, *F2*, *F3*,
241 *F4*, *F5*, *F6*, *F7*, *F8*, *F9*, *F10*, *F11*, *F12*.
243 Action names::
245 Valid action names are described below. Note, all names are
246 case-insensitive, and you may use '-', '_', and '.' interchangeably,
247 e.g. "view-main", "View.Main", and "VIEW_MAIN" are the same.
251 Actions
252 ~~~~~~~
254 Apart from the action names listed below, all actions starting with a '!' will
255 be available as an external command. External commands can contain variable
256 names that will be substituted before the command is run. Valid variable names
257 are:
259 .Browsing state variables
260 [frame="none",grid="none",cols="25<m,75<"]
261 |=============================================================================
262 |%(head)                |The currently viewed 'head' ID. Defaults to HEAD
263 |%(commit)              |The currently selected commit ID.
264 |%(blob)                |The currently selected blob ID.
265 |%(branch)              |The currently selected branch name.
266 |%(directory)           |The current directory path in the tree view;
267                          empty for the root directory.
268 |%(file)                |The currently selected file.
269 |%(ref)                 |The reference given to blame or HEAD if undefined.
270 |%(revargs)             |The revision arguments passed on the command line.
271 |%(fileargs)            |The file arguments passed on the command line.
272 |%(diffargs)            |The diff options passed on the command line.
273 |=============================================================================
275 As an example, the following external command will save the current commit as
276 a patch file: "!git format-patch -1 %(commit)". If your external command
277 require use of dynamic features, such as subshells, expansion of environment
278 variables and process control, this can be achieved by using a combination of
279 git aliases and tig external commands. The following example entries can be
280 put in either the .gitconfig or .git/config file:
282 --------------------------------------------------------------------------
283 [alias]
284         gitk-bg = !"gitk HEAD --not $(git rev-parse --remotes) &"
285         publish = !"for i in origin public; do git push $i; done"
286 [tig "bind"]
287         generic = V !git gitk-bg
288         generic = > !git publish
289 --------------------------------------------------------------------------
291 .View switching
292 [frame="none",grid="none",cols="25<m,75<"]
293 |=============================================================================
294 |view-main              |Show main view
295 |view-diff              |Show diff view
296 |view-log               |Show log view
297 |view-tree              |Show tree view
298 |view-blob              |Show blob view
299 |view-blame             |Show blame view
300 |view-branch            |Show branch view
301 |view-status            |Show status view
302 |view-stage             |Show stage view
303 |view-pager             |Show pager view
304 |view-help              |Show help page
305 |=============================================================================
307 .View manipulation
308 [frame="none",grid="none",cols="25<m,75<"]
309 |=============================================================================
310 |enter                  |Enter current line and scroll
311 |next                   |Move to next
312 |previous               |Move to previous
313 |parent                 |Move to parent
314 |view-next              |Move focus to next view
315 |refresh                |Reload and refresh view
316 |maximize               |Maximize the current view
317 |view-close             |Close the current view
318 |quit                   |Close all views and quit
319 |=============================================================================
321 .View specific actions
322 [frame="none",grid="none",cols="25<m,75<"]
323 |=============================================================================
324 |status-update          |Update file status
325 |status-merge           |Resolve unmerged file
326 |stage-update-line      |Stage single line
327 |stage-next             |Find next chunk to stage
328 |diff-context-up        |Increase the diff context
329 |diff-context-down      |Decrease the diff context
330 |=============================================================================
332 .Cursor navigation
333 [frame="none",grid="none",cols="25<m,75<"]
334 |=============================================================================
335 |move-up                |Move cursor one line up
336 |move-down              |Move cursor one line down
337 |move-page-down         |Move cursor one page down
338 |move-page-up           |Move cursor one page up
339 |move-first-line        |Move cursor to first line
340 |move-last-line         |Move cursor to last line
341 |=============================================================================
343 .Scrolling
344 [frame="none",grid="none",cols="25<m,75<"]
345 |=============================================================================
346 |scroll-line-up         |Scroll one line up
347 |scroll-line-down       |Scroll one line down
348 |scroll-page-up         |Scroll one page up
349 |scroll-page-down       |Scroll one page down
350 |scroll-first-col       |Scroll to the first column
351 |scroll-left            |Scroll one column left
352 |scroll-right           |Scroll one column right
353 |=============================================================================
355 .Searching
356 [frame="none",grid="none",cols="25<m,75<"]
357 |=============================================================================
358 |search                 |Search the view
359 |search-back            |Search backwards in the view
360 |find-next              |Find next search match
361 |find-prev              |Find previous search match
362 |=============================================================================
364 .Misc
365 [frame="none",grid="none",cols="25<m,75<"]
366 |=============================================================================
367 |prompt                 |Bring up the prompt
368 |screen-redraw          |Redraw the screen
369 |screen-resize          |Resize the screen
370 |show-version           |Show version information
371 |stop-loading           |Stop all loading views
372 |options                |Open options menu
373 |toggle-lineno          |Toggle line numbers
374 |toggle-date            |Toggle date display
375 |toggle-author          |Toggle author display
376 |toggle-filename        |Toggle file name display
377 |toggle-rev-graph       |Toggle revision graph visualization
378 |toggle-graphic         |Toggle (line) graphics mode
379 |toggle-refs            |Toggle reference display
380 |edit                   |Open in editor
381 |none                   |Do nothing
382 |=============================================================================
385 Color command
386 -------------
388 Color commands control highlighting and the user interface styles. If your
389 terminal supports color, these commands can be used to assign foreground and
390 background combinations to certain areas. Optionally, an attribute can be
391 given as the last parameter. The syntax is:
393 [verse]
394 *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
396 Examples:
398 ------------------------------------------------------------------------------
399 # Overwrite the default terminal colors to white on black.
400 color default           white   black
401 # Diff colors
402 color diff-header       yellow  default
403 color diff-index        blue    default
404 color diff-chunk        magenta default
405 color "Reported-by:"    green   default
406 --------------------------------------------------------------------------
408 Or in the git configuration files:
410 --------------------------------------------------------------------------
411 [tig "color"]
412         # A strange looking cursor line
413         cursor          red     default underline
414         # UI colors
415         title-blur      white   blue
416         title-focus     white   blue    bold
417 ------------------------------------------------------------------------------
419 Area names::
421         Can be either a built-in area name or a custom quoted string. The
422         latter allows custom color rules to be added for lines matching a
423         quoted string.
424         Valid built-in area names are described below. Note, all names are
425         case-insensitive, and you may use '-', '_', and '.' interchangeably,
426         e.g. "Diff-Header", "DIFF_HEADER", and "diff.header" are the same.
428 Color names::
430         Valid colors include: *white*, *black*, *green*, *magenta*, *blue*,
431         *cyan*, *yellow*, *red*, *default*. Use *default* to refer to the
432         default terminal colors. This is recommended for background colors if
433         you are using a terminal with a transparent background.
435 Colors can also be specified using the keywords color0, color1, ..., colorN-1
436 (N being the number of colors supported by your terminal). This is useful when
437 you remap the colors for your display or want to enable colors supported by
438 256-color terminals.
440 Attribute names::
442         Valid attributes include: *normal*, *blink*, *bold*, *dim*, *reverse*,
443         *standout*, and *underline*. Note, not all attributes may be supported
444         by the terminal.
446 UI colors
447 ~~~~~~~~~
449 The colors and attributes to be used for the text that is not highlighted or
450 that specify the use of the default terminal colors can be controlled by
451 setting the *default* color option.
453 .General
454 [frame="none",grid="none",cols="25<m,75<"]
455 |=============================================================================
456 |default                |Overwrite default terminal colors (see above).
457 |cursor                 |The cursor line.
458 |status                 |The status window showing info messages.
459 |title-focus            |The title window for the current view.
460 |title-blur             |The title window of any backgrounded view.
461 |delimiter              |Delimiter shown for truncated lines.
462 |line-number            |Line numbers.
463 |date                   |The commit date.
464 |author                 |The commit author.
465 |mode                   |The file mode holding the permissions and type.
466 |=============================================================================
468 .Main view colors
469 [frame="none",grid="none",cols="25<m,75<"]
470 |=============================================================================
471 |graph-commit           |The commit dot in the revising graph.
472 |palette-[0-6]          |7 different colors,
473 used for distinguishing branches or commits.
474 example: palette-0 = red
475 |main-commit            |The commit comment.
476 |main-head              |Label of the current branch.
477 |main-remote            |Label of a remote.
478 |main-tracked           |Label of the remote tracked by the current branch.
479 |main-tag               |Label of a signed tag.
480 |main-local-tag         |Label of a local tag.
481 |main-ref               |Label of any other reference.
482 |=============================================================================
484 .Status view
485 [frame="none",grid="none",cols="25<m,75<"]
486 |=============================================================================
487 |stat-head              |The "On branch"-line.
488 |stat-section           |Status section titles,
489 |stat-staged            |Status flag of staged files.
490 |stat-unstaged          |Status flag of unstaged files.
491 |stat-untracked         |Status flag of untracked files.
492 |=============================================================================
494 .Blame view
495 [frame="none",grid="none",cols="25<m,75<"]
496 |=============================================================================
497 |blame-id               |The commit ID.
498 |=============================================================================
500 .Tree view
501 [frame="none",grid="none",cols="25<m,75<"]
502 |=============================================================================
503 |tree-head              |The "Directory /"-line
504 |tree-dir               |The directory name.
505 |tree-file              |The file name.
506 |=============================================================================
508 Highlighting
509 ~~~~~~~~~~~~
513 Diff markup::
515 Options concerning diff start, chunks and lines added and deleted.
517 *diff-header*, *diff-chunk*, *diff-add*, *diff-del*
519 Enhanced git diff markup::
521 Extra diff information emitted by the git diff machinery, such as mode
522 changes, rename detection, and similarity.
524 *diff-oldmode*, *diff-newmode*, *diff-copy-from*, *diff-copy-to*,
525 *diff-rename-from*, *diff-rename-to*, *diff-similarity*, *diff-dissimilarity*
526 *diff-tree*, *diff-index*
528 Pretty print commit headers::
530 Commit diffs and the revision logs are usually formatted using pretty printed
531 headers , unless `--pretty=raw` was given. This includes lines, such as merge
532 info, commit ID, and author and committer date.
534 *pp-author*, *pp-commit*, *pp-merge*, *pp-date*, *pp-adate*, *pp-cdate*,
535 *pp-refs*
537 Raw commit header::
539 Usually shown when `--pretty=raw` is given, however 'commit' is pretty much
540 omnipresent.
542 *commit*, *parent*, *tree*, *author*, *committer*
544 Commit message::
546 `Signed-off-by`, `Acked-by`, `Reviewed-by` and `Tested-by` lines are colorized.
548 *signoff*, *acked*, *reviewed*, *tested*
550 Tree markup::
552 Colors for information of the tree view.
554 *tree-dir*, *tree-file*
558 Source command
559 -------------
561 Sources commands makes it possible to read additional configuration files.
562 Sourced file are treated in-place, meaning when a 'source' command is
563 encountered it will be immediately read. Any commands, later in the current
564 configuration file will take precedence. The syntax is:
566 [verse]
567 *source* 'path'
569 Examples:
571 ------------------------------------------------------------------------------
572 source ~/.tig/colorscheme.tigrc
573 source ~/.tig/keybindings.tigrc
574 --------------------------------------------------------------------------
576 COPYRIGHT
577 ---------
578 Copyright (c) 2006-2010 Jonas Fonseca <fonseca@diku.dk>
580 Licensed under the terms of the GNU General Public License.
582 SEE ALSO
583 --------
584 manpage:tig[1], manpage:tigmanual[7], git-config(1),
585 and the http://jonas.nitro.dk/tig/manual.html[tig manual].