Code

get_author_initials: various fixes
[tig.git] / tigrc.5.txt
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.
95 'blame-options' (string)::
97         A space separated string of extra blame options. Can be used for
98         telling git-blame(1) how to detect the origin of lines. The value
99         is ignored when tig is started in blame mode and given blame options
100         on the command line.
102 'commit-encoding' (string)::
104         The encoding used for commits. The default is UTF-8. Note this option
105         is shadowed by the "i18n.commitencoding" option in `.git/config`.
107 'line-graphics' (mixed) [ "ascii" | "default" | "utf-8" | bool]::
109         What type of character graphics for line drawing.
111 'line-number-interval' (int)::
113         Interval between line numbers. Note, you have to toggle on line
114         numbering with 'n' or the `-n` command line option.  The default is to
115         number every line.
117 'horizontal-scroll' (mixed)::
119         Interval to scroll horizontally in each step. Can be specified either
120         as the number of columns, e.g. '5', or as a percentage of the view
121         width, e.g. '33%', where the maximum is 100%. For percentages it is
122         always ensured that at least one column is scrolled. The default is to
123         scroll '50%' of the view width.
125 'show-author' (mixed) ["abbreviated" | "default" | bool]::
127         How to display author names. If set to "abbreviated" author initials
128         will be shown. Can be toggled.
130 'show-date' (mixed) ["relative" | "short" | "default" | "local" | bool]::
132         Whether and how to show date. If set to "relative" a relative date will be
133         used, e.g. "2 minutes ago". If set to "short" no time information is
134         shown. If set to "local", localtime(3) is used. Can be toggled.
136 'show-refs' (bool)::
138         Whether to show references (branches, tags, and remotes) in the main
139         view on start-up. Can be toggled.
141 'show-rev-graph' (bool)::
143         Whether to show revision graph in the main view on start-up.
144         Can be toggled. See also line-graphics options.
146 'split-view-height' (mixed)::
148         Height of the lower view in a split view. Can be specified either as
149         the number of rows, e.g. '5', or as a percentage of the view height,
150         e.g. '80%', where the maximum is 100%. It is always ensured that the
151         smaller of the views is at least four rows high. The default is a view
152         height of '66%'.
154 'status-untracked-dirs' (bool)::
156         Show untracked directories contents in the status view (analog to
157         `git ls-files --directory` option. On by default.
159 'tab-size' (int)::
161         Number of spaces per tab. The default is 8 spaces.
163 Bind command
164 ------------
166 Using bind commands keys can be mapped to an action when pressed in a given
167 key map. The syntax is:
169 [verse]
170 *bind* 'keymap' 'key' 'action'
172 Examples:
174 --------------------------------------------------------------------------
175 # A few keybindings
176 bind main w scroll-line-up
177 bind main s scroll-line-down
178 bind main space enter
179 bind diff a previous
180 bind diff d next
181 bind diff b move-first-line
182 # An external command to update from upstream
183 bind generic F !git fetch
184 --------------------------------------------------------------------------
186 Or in the git configuration files:
188 --------------------------------------------------------------------------
189 [tig "bind"]
190         # 'unbind' the default quit key binding
191         main = Q none
192         # Cherry-pick current commit onto current branch
193         generic = C !git cherry-pick %(commit)
194 --------------------------------------------------------------------------
196 Keys are mapped by first searching the keybindings for the current view, then
197 the keybindings for the *generic* keymap, and last the default keybindings.
198 Thus, the view keybindings shadow the generic keybindings which Shadow the
199 built-in keybindings.
201 --
203 Keymaps::
205 Valid keymaps are: *main*, *diff*, *log*, *help*, *pager*, *status*, *stage*,
206 *tree*, *blob*, *blame*, *branch*, and *generic*.  Use *generic* to set key
207 mapping in all keymaps.
209 Key values::
211 Key values should never be quoted. Use either the ASCII value or one of the
212 following symbolic key names. Symbolic key names are case insensitive, Use
213 *Hash* to bind to the `#` key, since the hash mark is used as a comment
214 character.
216 *Enter*, *Space*, *Backspace*, *Tab*, *Escape*, *Left*, *Right*, *Up*, *Down*,
217 *Insert*, *Delete*, *Hash*, *Home*, *End*, *PageUp*, *PageDown*, *F1*, *F2*, *F3*,
218 *F4*, *F5*, *F6*, *F7*, *F8*, *F9*, *F10*, *F11*, *F12*.
220 Action names::
222 Valid action names are described below. Note, all names are
223 case-insensitive, and you may use '-', '_', and '.' interchangeably,
224 e.g. "view-main", "View.Main", and "VIEW_MAIN" are the same.
226 --
228 Actions
229 ~~~~~~~
231 Apart from the action names listed below, all actions starting with a '!' will
232 be available as an external command. External commands can contain variable
233 names that will be substituted before the command is run. Valid variable names
234 are:
236 .Browsing state variables
237 [frame="none",grid="none",cols="25<m,75<"]
238 |=============================================================================
239 |%(head)                |The currently viewed 'head' ID. Defaults to HEAD
240 |%(commit)              |The currently selected commit ID.
241 |%(blob)                |The currently selected blob ID.
242 |%(branch)              |The currently selected branch name.
243 |%(directory)           |The current directory path in the tree view;
244                          empty for the root directory.
245 |%(file)                |The currently selected file.
246 |%(ref)                 |The reference given to blame or HEAD if undefined.
247 |%(revargs)             |The revision arguments passed on the command line.
248 |%(fileargs)            |The file arguments passed on the command line.
249 |%(diffargs)            |The diff options passed on the command line.
250 |=============================================================================
252 As an example, the following external command will save the current commit as
253 a patch file: "!git format-patch -1 %(commit)". If your external command
254 require use of dynamic features, such as subshells, expansion of environment
255 variables and process control, this can be achieved by using a combination of
256 git aliases and tig external commands. The following example entries can be
257 put in either the .gitconfig or .git/config file:
259 --------------------------------------------------------------------------
260 [alias]
261         gitk-bg = !"gitk HEAD --not $(git rev-parse --remotes) &"
262         publish = !"for i in origin public; do git push $i; done"
263 [tig "bind"]
264         generic = V !git gitk-bg
265         generic = > !git publish
266 --------------------------------------------------------------------------
268 .View switching
269 [frame="none",grid="none",cols="25<m,75<"]
270 |=============================================================================
271 |view-main              |Show main view
272 |view-diff              |Show diff view
273 |view-log               |Show log view
274 |view-tree              |Show tree view
275 |view-blob              |Show blob view
276 |view-blame             |Show blame view
277 |view-branch            |Show branch view
278 |view-status            |Show status view
279 |view-stage             |Show stage view
280 |view-pager             |Show pager view
281 |view-help              |Show help page
282 |=============================================================================
284 .View manipulation
285 [frame="none",grid="none",cols="25<m,75<"]
286 |=============================================================================
287 |enter                  |Enter current line and scroll
288 |next                   |Move to next
289 |previous               |Move to previous
290 |parent                 |Move to parent
291 |view-next              |Move focus to next view
292 |refresh                |Reload and refresh view
293 |maximize               |Maximize the current view
294 |view-close             |Close the current view
295 |quit                   |Close all views and quit
296 |=============================================================================
298 .View specific actions
299 [frame="none",grid="none",cols="25<m,75<"]
300 |=============================================================================
301 |status-update          |Update file status
302 |status-merge           |Resolve unmerged file
303 |stage-next             |Find next chunk to stage
304 |=============================================================================
306 .Cursor navigation
307 [frame="none",grid="none",cols="25<m,75<"]
308 |=============================================================================
309 |move-up                |Move cursor one line up
310 |move-down              |Move cursor one line down
311 |move-page-down         |Move cursor one page down
312 |move-page-up           |Move cursor one page up
313 |move-first-line        |Move cursor to first line
314 |move-last-line         |Move cursor to last line
315 |=============================================================================
317 .Scrolling
318 [frame="none",grid="none",cols="25<m,75<"]
319 |=============================================================================
320 |scroll-line-up         |Scroll one line up
321 |scroll-line-down       |Scroll one line down
322 |scroll-page-up         |Scroll one page up
323 |scroll-page-down       |Scroll one page down
324 |scroll-first-col       |Scroll to the first column
325 |scroll-left            |Scroll one column left
326 |scroll-right           |Scroll one column right
327 |=============================================================================
329 .Searching
330 [frame="none",grid="none",cols="25<m,75<"]
331 |=============================================================================
332 |search                 |Search the view
333 |search-back            |Search backwards in the view
334 |find-next              |Find next search match
335 |find-prev              |Find previous search match
336 |=============================================================================
338 .Misc
339 [frame="none",grid="none",cols="25<m,75<"]
340 |=============================================================================
341 |prompt                 |Bring up the prompt
342 |screen-redraw          |Redraw the screen
343 |screen-resize          |Resize the screen
344 |show-version           |Show version information
345 |stop-loading           |Stop all loading views
346 |options                |Open options menu
347 |toggle-lineno          |Toggle line numbers
348 |toggle-date            |Toggle date display
349 |toggle-author          |Toggle author display
350 |toggle-rev-graph       |Toggle revision graph visualization
351 |toggle-graphic         |Toggle (line) graphics mode
352 |toggle-refs            |Toggle reference display
353 |edit                   |Open in editor
354 |none                   |Do nothing
355 |=============================================================================
358 Color command
359 -------------
361 Color commands control highlighting and the user interface styles. If your
362 terminal supports color, these commands can be used to assign foreground and
363 background combinations to certain areas. Optionally, an attribute can be
364 given as the last parameter. The syntax is:
366 [verse]
367 *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
369 Examples:
371 ------------------------------------------------------------------------------
372 # Overwrite the default terminal colors to white on black.
373 color default           white   black
374 # Diff colors
375 color diff-header       yellow  default
376 color diff-index        blue    default
377 color diff-chunk        magenta default
378 --------------------------------------------------------------------------
380 Or in the git configuration files:
382 --------------------------------------------------------------------------
383 [tig "color"]
384         # A strange looking cursor line
385         cursor          red     default underline
386         # UI colors
387         title-blur      white   blue
388         title-focus     white   blue    bold
389 ------------------------------------------------------------------------------
391 Area names::
393         Valid area names are described below. Note, all names are
394         case-insensitive, and you may use '-', '_', and '.' interchangeably,
395         e.g. "Diff-Header", "DIFF_HEADER", and "diff.header" are the same.
397 Color names::
399         Valid colors include: *white*, *black*, *green*, *magenta*, *blue*,
400         *cyan*, *yellow*, *red*, *default*. Use *default* to refer to the
401         default terminal colors. This is recommended for background colors if
402         you are using a terminal with a transparent background.
404 Colors can also be specified using the keywords color0, color1, ..., colorN-1
405 (N being the number of colors supported by your terminal). This is useful when
406 you remap the colors for your display or want to enable colors supported by
407 256-color terminals.
409 Attribute names::
411         Valid attributes include: *normal*, *blink*, *bold*, *dim*, *reverse*,
412         *standout*, and *underline*. Note, not all attributes may be supported
413         by the terminal.
415 UI colors
416 ~~~~~~~~~
418 The colors and attributes to be used for the text that is not highlighted or
419 that specify the use of the default terminal colors can be controlled by
420 setting the *default* color option.
422 .General
423 [frame="none",grid="none",cols="25<m,75<"]
424 |=============================================================================
425 |default                |Overwrite default terminal colors (see above).
426 |cursor                 |The cursor line.
427 |status                 |The status window showing info messages.
428 |title-focus            |The title window for the current view.
429 |title-blur             |The title window of any backgrounded view.
430 |delimiter              |Delimiter shown for truncated lines.
431 |line-number            |Line numbers.
432 |date                   |The commit date.
433 |author                 |The commit author.
434 |mode                   |The file mode holding the permissions and type.
435 |=============================================================================
437 .Main view colors
438 [frame="none",grid="none",cols="25<m,75<"]
439 |=============================================================================
440 |main-revgraph          |The revision graph.
441 |main-commit            |The commit comment.
442 |main-head              |Label of the current branch.
443 |main-remote            |Label of a remote.
444 |main-tracked           |Label of the remote tracked by the current branch.
445 |main-tag               |Label of a signed tag.
446 |main-local-tag         |Label of a local tag.
447 |main-ref               |Label of any other reference.
448 |=============================================================================
450 .Status view
451 [frame="none",grid="none",cols="25<m,75<"]
452 |=============================================================================
453 |stat-head              |The "On branch"-line.
454 |stat-section           |Status section titles,
455 |stat-staged            |Status flag of staged files.
456 |stat-unstaged          |Status flag of unstaged files.
457 |stat-untracked         |Status flag of untracked files.
458 |=============================================================================
460 .Blame view
461 [frame="none",grid="none",cols="25<m,75<"]
462 |=============================================================================
463 |blame-id               |The commit ID.
464 |=============================================================================
466 .Tree view
467 [frame="none",grid="none",cols="25<m,75<"]
468 |=============================================================================
469 |tree-head              |The "Directory /"-line
470 |tree-dir               |The directory name.
471 |tree-file              |The file name.
472 |=============================================================================
474 Highlighting
475 ~~~~~~~~~~~~
477 --
479 Diff markup::
481 Options concerning diff start, chunks and lines added and deleted.
483 *diff-header*, *diff-chunk*, *diff-add*, *diff-del*
485 Enhanced git diff markup::
487 Extra diff information emitted by the git diff machinery, such as mode
488 changes, rename detection, and similarity.
490 *diff-oldmode*, *diff-newmode*, *diff-copy-from*, *diff-copy-to*,
491 *diff-rename-from*, *diff-rename-to*, *diff-similarity*, *diff-dissimilarity*
492 *diff-tree*, *diff-index*
494 Pretty print commit headers::
496 Commit diffs and the revision logs are usually formatted using pretty printed
497 headers , unless `--pretty=raw` was given. This includes lines, such as merge
498 info, commit ID, and author and committer date.
500 *pp-author*, *pp-commit*, *pp-merge*, *pp-date*, *pp-adate*, *pp-cdate*,
501 *pp-refs*
503 Raw commit header::
505 Usually shown when `--pretty=raw` is given, however 'commit' is pretty much
506 omnipresent.
508 *commit*, *parent*, *tree*, *author*, *committer*
510 Commit message::
512 `Signed-off-by`, `Acked-by`, `Reviewed-by` and `Tested-by` lines are colorized.
514 *signoff*, *acked*, *reviewed*, *tested*
516 Tree markup::
518 Colors for information of the tree view.
520 *tree-dir*, *tree-file*
522 --
524 COPYRIGHT
525 ---------
526 Copyright (c) 2006-2010 Jonas Fonseca <fonseca@diku.dk>
528 Licensed under the terms of the GNU General Public License.
530 SEE ALSO
531 --------
532 manpage:tig[1], manpage:tigmanual[7], git-config(1),
533 and the http://jonas.nitro.dk/tig/manual.html[tig manual].