Code

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