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