Code

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