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