Add "//TRANSLIT" for iconv encoding
[tig.git] / tigrc.5.txt
blob562e7ee9e1c8aa8dd38e186e8973e037c94c72db
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 'n' or the `-n` command line option.  The default is to
120         number every 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 Bind command
182 ------------
184 Using bind commands keys can be mapped to an action when pressed in a given
185 key map. The syntax is:
187 [verse]
188 *bind* 'keymap' 'key' 'action'
190 Examples:
192 --------------------------------------------------------------------------
193 # A few keybindings
194 bind main w scroll-line-up
195 bind main s scroll-line-down
196 bind main space enter
197 bind diff a previous
198 bind diff d next
199 bind diff b move-first-line
200 # An external command to update from upstream
201 bind generic F !git fetch
202 --------------------------------------------------------------------------
204 Or in the git configuration files:
206 --------------------------------------------------------------------------
207 [tig "bind"]
208         # 'unbind' the default quit key binding
209         main = Q none
210         # Cherry-pick current commit onto current branch
211         generic = C !git cherry-pick %(commit)
212 --------------------------------------------------------------------------
214 Keys are mapped by first searching the keybindings for the current view, then
215 the keybindings for the *generic* keymap, and last the default keybindings.
216 Thus, the view keybindings shadow the generic keybindings which Shadow the
217 built-in keybindings.
221 Keymaps::
223 Valid keymaps are: *main*, *diff*, *log*, *help*, *pager*, *status*, *stage*,
224 *tree*, *blob*, *blame*, *branch*, and *generic*.  Use *generic* to set key
225 mapping in all keymaps.
227 Key values::
229 Key values should never be quoted. Use either the ASCII value or one of the
230 following symbolic key names. Symbolic key names are case insensitive, Use
231 *Hash* to bind to the `#` key, since the hash mark is used as a comment
232 character.
234 *Enter*, *Space*, *Backspace*, *Tab*, *Escape*, *Left*, *Right*, *Up*, *Down*,
235 *Insert*, *Delete*, *Hash*, *Home*, *End*, *PageUp*, *PageDown*, *F1*, *F2*, *F3*,
236 *F4*, *F5*, *F6*, *F7*, *F8*, *F9*, *F10*, *F11*, *F12*.
238 Action names::
240 Valid action names are described below. Note, all names are
241 case-insensitive, and you may use '-', '_', and '.' interchangeably,
242 e.g. "view-main", "View.Main", and "VIEW_MAIN" are the same.
246 Actions
247 ~~~~~~~
249 Apart from the action names listed below, all actions starting with a '!' will
250 be available as an external command. External commands can contain variable
251 names that will be substituted before the command is run. Valid variable names
252 are:
254 .Browsing state variables
255 [frame="none",grid="none",cols="25<m,75<"]
256 |=============================================================================
257 |%(head)                |The currently viewed 'head' ID. Defaults to HEAD
258 |%(commit)              |The currently selected commit ID.
259 |%(blob)                |The currently selected blob ID.
260 |%(branch)              |The currently selected branch name.
261 |%(directory)           |The current directory path in the tree view;
262                          empty for the root directory.
263 |%(file)                |The currently selected file.
264 |%(ref)                 |The reference given to blame or HEAD if undefined.
265 |%(revargs)             |The revision arguments passed on the command line.
266 |%(fileargs)            |The file arguments passed on the command line.
267 |%(diffargs)            |The diff options passed on the command line.
268 |=============================================================================
270 As an example, the following external command will save the current commit as
271 a patch file: "!git format-patch -1 %(commit)". If your external command
272 require use of dynamic features, such as subshells, expansion of environment
273 variables and process control, this can be achieved by using a combination of
274 git aliases and tig external commands. The following example entries can be
275 put in either the .gitconfig or .git/config file:
277 --------------------------------------------------------------------------
278 [alias]
279         gitk-bg = !"gitk HEAD --not $(git rev-parse --remotes) &"
280         publish = !"for i in origin public; do git push $i; done"
281 [tig "bind"]
282         generic = V !git gitk-bg
283         generic = > !git publish
284 --------------------------------------------------------------------------
286 .View switching
287 [frame="none",grid="none",cols="25<m,75<"]
288 |=============================================================================
289 |view-main              |Show main view
290 |view-diff              |Show diff view
291 |view-log               |Show log view
292 |view-tree              |Show tree view
293 |view-blob              |Show blob view
294 |view-blame             |Show blame view
295 |view-branch            |Show branch view
296 |view-status            |Show status view
297 |view-stage             |Show stage view
298 |view-pager             |Show pager view
299 |view-help              |Show help page
300 |=============================================================================
302 .View manipulation
303 [frame="none",grid="none",cols="25<m,75<"]
304 |=============================================================================
305 |enter                  |Enter current line and scroll
306 |next                   |Move to next
307 |previous               |Move to previous
308 |parent                 |Move to parent
309 |view-next              |Move focus to next view
310 |refresh                |Reload and refresh view
311 |maximize               |Maximize the current view
312 |view-close             |Close the current view
313 |quit                   |Close all views and quit
314 |=============================================================================
316 .View specific actions
317 [frame="none",grid="none",cols="25<m,75<"]
318 |=============================================================================
319 |status-update          |Update file status
320 |status-merge           |Resolve unmerged file
321 |stage-update-line      |Stage single line
322 |stage-next             |Find next chunk to stage
323 |diff-context-up        |Increase the diff context
324 |diff-context-down      |Decrease the diff context
325 |=============================================================================
327 .Cursor navigation
328 [frame="none",grid="none",cols="25<m,75<"]
329 |=============================================================================
330 |move-up                |Move cursor one line up
331 |move-down              |Move cursor one line down
332 |move-page-down         |Move cursor one page down
333 |move-page-up           |Move cursor one page up
334 |move-first-line        |Move cursor to first line
335 |move-last-line         |Move cursor to last line
336 |=============================================================================
338 .Scrolling
339 [frame="none",grid="none",cols="25<m,75<"]
340 |=============================================================================
341 |scroll-line-up         |Scroll one line up
342 |scroll-line-down       |Scroll one line down
343 |scroll-page-up         |Scroll one page up
344 |scroll-page-down       |Scroll one page down
345 |scroll-first-col       |Scroll to the first column
346 |scroll-left            |Scroll one column left
347 |scroll-right           |Scroll one column right
348 |=============================================================================
350 .Searching
351 [frame="none",grid="none",cols="25<m,75<"]
352 |=============================================================================
353 |search                 |Search the view
354 |search-back            |Search backwards in the view
355 |find-next              |Find next search match
356 |find-prev              |Find previous search match
357 |=============================================================================
359 .Misc
360 [frame="none",grid="none",cols="25<m,75<"]
361 |=============================================================================
362 |prompt                 |Bring up the prompt
363 |screen-redraw          |Redraw the screen
364 |screen-resize          |Resize the screen
365 |show-version           |Show version information
366 |stop-loading           |Stop all loading views
367 |options                |Open options menu
368 |toggle-lineno          |Toggle line numbers
369 |toggle-date            |Toggle date display
370 |toggle-author          |Toggle author display
371 |toggle-filename        |Toggle file name display
372 |toggle-rev-graph       |Toggle revision graph visualization
373 |toggle-graphic         |Toggle (line) graphics mode
374 |toggle-refs            |Toggle reference display
375 |edit                   |Open in editor
376 |none                   |Do nothing
377 |=============================================================================
380 Color command
381 -------------
383 Color commands control highlighting and the user interface styles. If your
384 terminal supports color, these commands can be used to assign foreground and
385 background combinations to certain areas. Optionally, an attribute can be
386 given as the last parameter. The syntax is:
388 [verse]
389 *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
391 Examples:
393 ------------------------------------------------------------------------------
394 # Overwrite the default terminal colors to white on black.
395 color default           white   black
396 # Diff colors
397 color diff-header       yellow  default
398 color diff-index        blue    default
399 color diff-chunk        magenta default
400 color "Reported-by:"    green   default
401 --------------------------------------------------------------------------
403 Or in the git configuration files:
405 --------------------------------------------------------------------------
406 [tig "color"]
407         # A strange looking cursor line
408         cursor          red     default underline
409         # UI colors
410         title-blur      white   blue
411         title-focus     white   blue    bold
412 ------------------------------------------------------------------------------
414 Area names::
416         Can be either a built-in area name or a custom quoted string. The
417         latter allows custom color rules to be added for lines matching a
418         quoted string.
419         Valid built-in area names are described below. Note, all names are
420         case-insensitive, and you may use '-', '_', and '.' interchangeably,
421         e.g. "Diff-Header", "DIFF_HEADER", and "diff.header" are the same.
423 Color names::
425         Valid colors include: *white*, *black*, *green*, *magenta*, *blue*,
426         *cyan*, *yellow*, *red*, *default*. Use *default* to refer to the
427         default terminal colors. This is recommended for background colors if
428         you are using a terminal with a transparent background.
430 Colors can also be specified using the keywords color0, color1, ..., colorN-1
431 (N being the number of colors supported by your terminal). This is useful when
432 you remap the colors for your display or want to enable colors supported by
433 256-color terminals.
435 Attribute names::
437         Valid attributes include: *normal*, *blink*, *bold*, *dim*, *reverse*,
438         *standout*, and *underline*. Note, not all attributes may be supported
439         by the terminal.
441 UI colors
442 ~~~~~~~~~
444 The colors and attributes to be used for the text that is not highlighted or
445 that specify the use of the default terminal colors can be controlled by
446 setting the *default* color option.
448 .General
449 [frame="none",grid="none",cols="25<m,75<"]
450 |=============================================================================
451 |default                |Overwrite default terminal colors (see above).
452 |cursor                 |The cursor line.
453 |status                 |The status window showing info messages.
454 |title-focus            |The title window for the current view.
455 |title-blur             |The title window of any backgrounded view.
456 |delimiter              |Delimiter shown for truncated lines.
457 |line-number            |Line numbers.
458 |date                   |The commit date.
459 |author                 |The commit author.
460 |mode                   |The file mode holding the permissions and type.
461 |=============================================================================
463 .Main view colors
464 [frame="none",grid="none",cols="25<m,75<"]
465 |=============================================================================
466 |graph-commit           |The commit dot in the revising graph.
467 |palette-[0-6]          |7 different colors,
468 used for distinguishing branches or commits.
469 example: palette-0 = red
470 |main-commit            |The commit comment.
471 |main-head              |Label of the current branch.
472 |main-remote            |Label of a remote.
473 |main-tracked           |Label of the remote tracked by the current branch.
474 |main-tag               |Label of a signed tag.
475 |main-local-tag         |Label of a local tag.
476 |main-ref               |Label of any other reference.
477 |=============================================================================
479 .Status view
480 [frame="none",grid="none",cols="25<m,75<"]
481 |=============================================================================
482 |stat-head              |The "On branch"-line.
483 |stat-section           |Status section titles,
484 |stat-staged            |Status flag of staged files.
485 |stat-unstaged          |Status flag of unstaged files.
486 |stat-untracked         |Status flag of untracked files.
487 |=============================================================================
489 .Blame view
490 [frame="none",grid="none",cols="25<m,75<"]
491 |=============================================================================
492 |blame-id               |The commit ID.
493 |=============================================================================
495 .Tree view
496 [frame="none",grid="none",cols="25<m,75<"]
497 |=============================================================================
498 |tree-head              |The "Directory /"-line
499 |tree-dir               |The directory name.
500 |tree-file              |The file name.
501 |=============================================================================
503 Highlighting
504 ~~~~~~~~~~~~
508 Diff markup::
510 Options concerning diff start, chunks and lines added and deleted.
512 *diff-header*, *diff-chunk*, *diff-add*, *diff-del*
514 Enhanced git diff markup::
516 Extra diff information emitted by the git diff machinery, such as mode
517 changes, rename detection, and similarity.
519 *diff-oldmode*, *diff-newmode*, *diff-copy-from*, *diff-copy-to*,
520 *diff-rename-from*, *diff-rename-to*, *diff-similarity*, *diff-dissimilarity*
521 *diff-tree*, *diff-index*
523 Pretty print commit headers::
525 Commit diffs and the revision logs are usually formatted using pretty printed
526 headers , unless `--pretty=raw` was given. This includes lines, such as merge
527 info, commit ID, and author and committer date.
529 *pp-author*, *pp-commit*, *pp-merge*, *pp-date*, *pp-adate*, *pp-cdate*,
530 *pp-refs*
532 Raw commit header::
534 Usually shown when `--pretty=raw` is given, however 'commit' is pretty much
535 omnipresent.
537 *commit*, *parent*, *tree*, *author*, *committer*
539 Commit message::
541 `Signed-off-by`, `Acked-by`, `Reviewed-by` and `Tested-by` lines are colorized.
543 *signoff*, *acked*, *reviewed*, *tested*
545 Tree markup::
547 Colors for information of the tree view.
549 *tree-dir*, *tree-file*
553 COPYRIGHT
554 ---------
555 Copyright (c) 2006-2010 Jonas Fonseca <fonseca@diku.dk>
557 Licensed under the terms of the GNU General Public License.
559 SEE ALSO
560 --------
561 manpage:tig[1], manpage:tigmanual[7], git-config(1),
562 and the http://jonas.nitro.dk/tig/manual.html[tig manual].