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