Code

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