New config options show-author, show-date, show-refs, show-line-numbers.
[tig] / tigrc.5.txt
CommitLineData
cb7f42cd
JF
1tigrc(5)
2========
3
4NAME
5----
6tigrc - tig user configuration file
7
2bc4f7bd 8
cb7f42cd
JF
9SYNOPSIS
10--------
11[verse]
12.............................................................................
c3c24b0b
JF
13*set* 'variable' *=* 'value'
14*bind* 'keymap' 'key' 'action'
15*color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
cb7f42cd
JF
16.............................................................................
17
2bc4f7bd 18
cb7f42cd
JF
19DESCRIPTION
20-----------
cb7f42cd 21
2bc4f7bd
JF
22You can permanently set an option by putting it in the `~/.tigrc` file. The
23file consists of a series of 'commands'. Each line of the file may contain
24only one command.
cb7f42cd 25
2bc4f7bd
JF
26The hash mark ('#') is used as a 'comment' character. All text after the
27comment character to the end of the line is ignored. You can use comments to
28annotate your initialization file.
cb7f42cd 29
cb7f42cd 30
2bc4f7bd
JF
31Set command
32-----------
cb7f42cd 33
2bc4f7bd
JF
34A few selective variables can be configured via the set command. The syntax
35is:
cb7f42cd 36
2bc4f7bd
JF
37[verse]
38..............................................................................
c3c24b0b 39*set* variables *=* value
2bc4f7bd 40..............................................................................
cb7f42cd 41
2bc4f7bd 42Examples:
cb7f42cd 43
2bc4f7bd 44--------------------------------------------------------------------------
8d762458
DV
45set show-author = yes # Show author?
46set show-date = yes # Show commit date?
c3c24b0b 47set show-rev-graph = yes # Show revision graph?
8d762458
DV
48set show-refs = yes # Show references?
49set show-line-numbers = no # Show line numbers?
c3c24b0b
JF
50set line-number-interval = 5 # Interval between line numbers
51set tab-size = 8 # Number of spaces per tab
52set encoding = "UTF-8" # Commit encoding
2bc4f7bd 53--------------------------------------------------------------------------
cb7f42cd 54
2bc4f7bd 55The type of variables are either bool, int, and string.
cb7f42cd 56
2bc4f7bd 57Valid bool values::
cb7f42cd 58
2bc4f7bd
JF
59 To set a bool variable to true use either "1", "true", or "yes".
60 Any other value will set the variable to false.
cb7f42cd 61
2bc4f7bd 62Valid int values::
cb7f42cd 63
2bc4f7bd 64 A non-negative integer.
cb7f42cd 65
2bc4f7bd 66Valid string values::
cb7f42cd 67
2bc4f7bd 68 A string of characters. Optionally, use either ' or " as delimiters.
cb7f42cd 69
2bc4f7bd
JF
70Variables
71~~~~~~~~~
cb7f42cd 72
2bc4f7bd 73The following variables can be set:
cb7f42cd 74
2bc4f7bd 75'show-rev-graph' (bool)::
cb7f42cd 76
f7ffec06 77 Show revision graph in the main view on start-up. Can be toggled with
2bc4f7bd 78 'g'.
cb7f42cd 79
2bc4f7bd 80'line-number-interval' (int)::
cb7f42cd 81
2bc4f7bd
JF
82 Interval between line numbers. Note, you have to toggle on line
83 numbering with 'n' or the `-n` command line option. The default is to
84 number every line.
cb7f42cd 85
2bc4f7bd 86'tab-size' (int)::
cb7f42cd 87
2bc4f7bd 88 Number of spaces per tab. The default is 8 spaces.
cb7f42cd 89
2bc4f7bd 90'commit-encoding' (string)::
cb7f42cd 91
2bc4f7bd
JF
92 The encoding used for commits. The default is UTF-8. Not this option
93 is shadowed by the "i18n.commitencoding" option in `.git/config`.
cb7f42cd 94
cb7f42cd 95
2bc4f7bd
JF
96Bind command
97------------
cb7f42cd 98
2bc4f7bd
JF
99Using bind commands keys can be mapped to an action when pressed in a given
100key map. The syntax is:
cb7f42cd 101
2bc4f7bd
JF
102[verse]
103..............................................................................
c3c24b0b 104*bind* 'keymap' 'key' 'action'
2bc4f7bd
JF
105..............................................................................
106
107Examples:
108
109--------------------------------------------------------------------------
c3c24b0b
JF
110# A few keybindings
111bind main w scroll-line-up
112bind main s scroll-line-down
113bind main space enter
114bind diff a previous
115bind diff d next
116bind diff b move-first-line
117# 'unbind' the default quit key binding
118bind main Q none
119# An external command to update from upstream
120bind generic F !git fetch
121# Cherry-pick current commit unto current branch
122bind generic C !git cherry-pick %(commit)
2bc4f7bd
JF
123--------------------------------------------------------------------------
124
125Keys are mapped by first searching the keybindings for the current view, then
126the keybindings for the *generic* keymap, and last the default keybindings.
f7ffec06 127Thus, the view keybindings shadow the generic keybindings which Shadow the
2bc4f7bd
JF
128built-in keybindings.
129
130--
131
132Keymaps::
133
f9a044a4
JF
134Valid keymaps are: *main*, *diff*, *log*, *help*, *pager*, *status*, *stage*,
135and *generic*. Use *generic* to set key mapping in all keymaps.
2bc4f7bd
JF
136
137Key values::
138
139Key values should never be quoted. Use either the ASCII value or one of the
140following symbolic key names. Symbolic key names are case insensitive, Use
141*Hash* to bind to the `#` key, since the hash mark is used as a comment
142character.
143
144*Enter*, *Space*, *Backspace*, *Tab*, *Escape*, *Left*, *Right*, *Up*, *Down*,
145*Insert*, *Delete*, *Hash*, *Home*, *End*, *PageUp*, *PageDown*, *F1*, *F2*, *F3*,
146*F4*, *F5*, *F6*, *F7*, *F8*, *F9*, *F10*, *F11*, *F12*.
147
148Action names::
149
150Valid action names are described below. Note, all names are
151case-insensitive, and you may use '-', '_', and '.' interchangeably,
152e.g. "view-main", "View.Main", and "VIEW_MAIN" are the same.
153
154--
155
156Actions
157~~~~~~~
158
9eb14b72
JF
159Apart from the action names listed below, all actions starting with a '!' will
160be available as an external command. External commands can contain variable
161names that will be substituted before the command is run. Valid variable names
162are "%(head)", "%(commit)", and "%(blob)".
163
164As an example, the following external command will save the current commit as
165a patch file: "!git format-patch %(commit)^..%(commit)".
166
2bc4f7bd
JF
167ifdef::backend-xhtml11[]
168[frame="none"]
169`-----------------------`-----------------------------------------------------
170endif::backend-xhtml11[]
765595f3 171View switching:
2bc4f7bd
JF
172------------------------------------------------------------------------------
173view-main Show main view
174view-diff Show diff view
175view-log Show log view
9d6976b9
JF
176view-tree Show tree view
177view-blob Show blob view
173d76ea 178view-status Show status view
f9a044a4 179view-stage Show stage view
2bc4f7bd 180view-pager Show pager view
9d6976b9 181view-help Show help page
2bc4f7bd
JF
182------------------------------------------------------------------------------
183
184ifdef::backend-xhtml11[]
185[frame="none"]
186`-----------------------`-----------------------------------------------------
187endif::backend-xhtml11[]
765595f3 188View manipulation:
2bc4f7bd
JF
189------------------------------------------------------------------------------
190enter Enter current line and scroll
191next Move to next
192previous Move to previous
193view-next Move focus to next view
272818ea 194refresh Reload and refresh view
2bc4f7bd
JF
195view-close Close the current view
196quit Close all views and quit
197------------------------------------------------------------------------------
198
199ifdef::backend-xhtml11[]
200[frame="none"]
201`-----------------------`-----------------------------------------------------
202endif::backend-xhtml11[]
765595f3 203Cursor navigation:
2bc4f7bd
JF
204------------------------------------------------------------------------------
205move-up Move cursor one line up
206move-down Move cursor one line down
9d6976b9
JF
207move-page-down Move cursor one page down
208move-page-up Move cursor one page up
209move-first-line Move cursor to first line
210move-last-line Move cursor to last line
2bc4f7bd
JF
211------------------------------------------------------------------------------
212
213ifdef::backend-xhtml11[]
214[frame="none"]
215`-----------------------`-----------------------------------------------------
216endif::backend-xhtml11[]
765595f3 217Scrolling:
2bc4f7bd 218------------------------------------------------------------------------------
9d6976b9
JF
219scroll-line-up Scroll one line up
220scroll-line-down Scroll one line down
221scroll-page-eup Scroll one page up
222scroll-page-down Scroll one page down
2bc4f7bd
JF
223------------------------------------------------------------------------------
224
225ifdef::backend-xhtml11[]
226[frame="none"]
227`-----------------------`-----------------------------------------------------
228endif::backend-xhtml11[]
f9a044a4
JF
229Searching:
230------------------------------------------------------------------------------
231search Search the view
232search-back Search backwards in the view
233find-next Find next search match
234find-prev Find previous search match
235------------------------------------------------------------------------------
236
237ifdef::backend-xhtml11[]
238[frame="none"]
239`-----------------------`-----------------------------------------------------
240endif::backend-xhtml11[]
765595f3 241Misc:
2bc4f7bd 242------------------------------------------------------------------------------
1d754561 243none Do nothing
2bc4f7bd 244prompt Bring up the prompt
2bc4f7bd
JF
245screen-redraw Redraw the screen
246screen-resize Resize the screen
247show-version Show version information
248stop-loading Stop all loading views
249toggle-lineno Toggle line numbers
823057f4
DV
250toggle-date Toggle date display
251toggle-author Toggle author display
9d6976b9 252toggle-rev-graph Toggle revision graph visualization
823057f4 253toggle-refs Toggle reference display
ca1d71ea 254status-update Update file status
b5c18d9d 255status-merge Resolve unmerged file
c509eed2 256tree-parent Switch to parent directory in tree view
f9a044a4 257edit Open in editor
2bc4f7bd
JF
258------------------------------------------------------------------------------
259
260
261Color command
262-------------
cb7f42cd 263
2bc4f7bd
JF
264Color commands control highlighting and the user interface styles. If your
265terminal supports color, these commands can be used to assign foreground and
62c7d1a7
JF
266background combinations to certain areas. Optionally, an attribute can be
267given as the last parameter. The syntax is:
2bc4f7bd
JF
268
269[verse]
270..............................................................................
c3c24b0b 271*color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
2bc4f7bd 272..............................................................................
cb7f42cd 273
2bc4f7bd 274Examples:
cb7f42cd 275
2bc4f7bd 276------------------------------------------------------------------------------
62c7d1a7
JF
277# Overwrite the default terminal colors to white on black.
278color default white black
c3c24b0b
JF
279# Diff colors
280color diff-header yellow default
281color diff-index blue default
282color diff-chunk magenta default
283# A strange looking cursor line
284color cursor red default underline
285# UI colors
286color title-blur white blue
287color title-focus white blue bold
2bc4f7bd
JF
288------------------------------------------------------------------------------
289
290Area names::
291
292 Valid area names are described below. Note, all names are
293 case-insensitive, and you may use '-', '_', and '.' interchangeably,
294 e.g. "Diff-Header", "DIFF_HEADER", and "diff.header" are the same.
295
296Color names::
297
298 Valid colors include: *white*, *black*, *green*, *magenta*, *blue*,
299 *cyan*, *yellow*, *red*, *default*. Use *default* to refer to the
300 default terminal colors.
301
302Attribute names::
303
304 Valid attributes include: *normal*, *blink*, *bold*, *dim*, *reverse*,
305 *standout*, and *underline*. Note, not all attributes may be supported
306 by the terminal.
307
2bc4f7bd
JF
308UI colors
309~~~~~~~~~
310
311--
312
62c7d1a7
JF
313Default terminal colors::
314
315The colors and attributes to be used for the text that is not highlighted or
316that specify the use of the default terminal colors can be controlled by
317setting the *default* color option.
318
319Use the *default* color to use the colors configured for the terminal. This is
320the default and recommended if you are using a terminal with a transparent
321background.
322
2bc4f7bd
JF
323Status window colors::
324
325Appearance of the bottom window showing info messages.
326
327*status*
328
329Title window colors::
330
f7ffec06 331Appearance of the title windows when they are attached
2bc4f7bd
JF
332to any backgrounded windows and the current window.
333
334*title-blur*, *title-focus*
335
336Cursor line colors::
337
338*cursor*
339
340Main view specific::
341
342Appearance of the various columns in the main view, including the '~' used for
343delimiting long author names and labels for tag and branch references.
344
345*main-date*, *main-author*, *main-commit*, *main-delim*, *main-tag*,
2384880b 346*main-local-tag*, *main-ref*, *main-remote*, *main-revgraph*
2bc4f7bd
JF
347
348--
349
350Highlighting
351~~~~~~~~~~~~
352
2bc4f7bd
JF
353--
354
355Diff markup::
356
357Options concerning diff start, chunks and lines added and deleted.
358
359*diff-header*, *diff-chunk*, *diff-add*, *diff-del*
360
361Enhanced git diff markup::
362
363Extra diff information emitted by the git diff machinery, such as mode
364changes, rename detection, and similarity.
365
366*diff-oldmode*, *diff-newmode*, *diff-copy-from*, *diff-copy-to*,
7389c87e 367*diff-rename-from*, *diff-rename-to*, *diff-similarity*, *diff-dissimilarity*
2bc4f7bd
JF
368*diff-tree*, *diff-index*
369
370Pretty print commit headers::
371
372Commit diffs and the revision logs are usually formatted using pretty printed
373headers , unless `--pretty=raw` was given. This includes lines, such as merge
f7ffec06 374info, commit ID, and author and committer date.
2bc4f7bd 375
13f3482f
DV
376*pp-author*, *pp-commit*, *pp-merge*, *pp-date*, *pp-adate*, *pp-cdate*,
377*pp-refs*
2bc4f7bd
JF
378
379Raw commit header::
380
381Usually shown when `--pretty=raw` is given, however 'commit' is pretty much
382omnipresent.
383
384*commit*, *parent*, *tree*, *author*, *committer*
385
386Commit message::
387
d4d8de8f 388For now only `Signed-off-by` and `Acked-by` lines are colorized.
2bc4f7bd 389
d4d8de8f 390*signoff*, *acked*
2bc4f7bd 391
13f3482f
DV
392Tree markup::
393
394Colors for information of the tree view.
395
396*tree-dir*, *tree-file*
397
398Status markup::
399
400Colors used in the status view.
401
402*stat-section*, *stat-none*, *stat-staged*, *stat-unstaged*, *stat-untracked*
403
2bc4f7bd
JF
404--
405
406COPYRIGHT
407---------
f9a044a4 408Copyright (c) 2006-2007 Jonas Fonseca <fonseca@diku.dk>
2bc4f7bd
JF
409
410Licensed under the terms of the GNU General Public License.
cb7f42cd
JF
411
412SEE ALSO
413--------
e664e260 414gitlink:tig[1] and the http://jonas.nitro.dk/tig/manual.html[tig manual].