Add support binding keys to running external commands
[tig] / tigrc.5.txt
CommitLineData
cb7f42cd
JF
1tigrc(5)
2========
3
4NAME
5----
6tigrc - tig user configuration file
7
2bc4f7bd 8
cb7f42cd
JF
9SYNOPSIS
10--------
11[verse]
12.............................................................................
2bc4f7bd
JF
13*set* variable *=* value
14*bind* keymap key action
15*color* area fgcolor bgcolor [attributes]
cb7f42cd
JF
16.............................................................................
17
2bc4f7bd 18
cb7f42cd
JF
19DESCRIPTION
20-----------
cb7f42cd 21
2bc4f7bd
JF
22You can permanently set an option by putting it in the `~/.tigrc` file. The
23file consists of a series of 'commands'. Each line of the file may contain
24only one command.
cb7f42cd 25
2bc4f7bd
JF
26The hash mark ('#') is used as a 'comment' character. All text after the
27comment character to the end of the line is ignored. You can use comments to
28annotate your initialization file.
cb7f42cd 29
cb7f42cd 30
2bc4f7bd
JF
31Set command
32-----------
cb7f42cd 33
2bc4f7bd
JF
34A few selective variables can be configured via the set command. The syntax
35is:
cb7f42cd 36
2bc4f7bd
JF
37[verse]
38..............................................................................
39 *set* variables *=* value
40..............................................................................
cb7f42cd 41
2bc4f7bd 42Examples:
cb7f42cd 43
2bc4f7bd
JF
44--------------------------------------------------------------------------
45 set show-rev-graph = yes # Show revision graph?
46 set line-number-interval = 5 # Interval between line numbers
47 set tab-size = 8 # Number of spaces pr tab
48 set encoding = "UTF-8" # Commit encoding
49--------------------------------------------------------------------------
cb7f42cd 50
2bc4f7bd 51The type of variables are either bool, int, and string.
cb7f42cd 52
2bc4f7bd 53Valid bool values::
cb7f42cd 54
2bc4f7bd
JF
55 To set a bool variable to true use either "1", "true", or "yes".
56 Any other value will set the variable to false.
cb7f42cd 57
2bc4f7bd 58Valid int values::
cb7f42cd 59
2bc4f7bd 60 A non-negative integer.
cb7f42cd 61
2bc4f7bd 62Valid string values::
cb7f42cd 63
2bc4f7bd 64 A string of characters. Optionally, use either ' or " as delimiters.
cb7f42cd 65
2bc4f7bd
JF
66Variables
67~~~~~~~~~
cb7f42cd 68
2bc4f7bd 69The following variables can be set:
cb7f42cd 70
2bc4f7bd 71'show-rev-graph' (bool)::
cb7f42cd 72
f7ffec06 73 Show revision graph in the main view on start-up. Can be toggled with
2bc4f7bd 74 'g'.
cb7f42cd 75
2bc4f7bd 76'line-number-interval' (int)::
cb7f42cd 77
2bc4f7bd
JF
78 Interval between line numbers. Note, you have to toggle on line
79 numbering with 'n' or the `-n` command line option. The default is to
80 number every line.
cb7f42cd 81
2bc4f7bd 82'tab-size' (int)::
cb7f42cd 83
2bc4f7bd 84 Number of spaces per tab. The default is 8 spaces.
cb7f42cd 85
2bc4f7bd 86'commit-encoding' (string)::
cb7f42cd 87
2bc4f7bd
JF
88 The encoding used for commits. The default is UTF-8. Not this option
89 is shadowed by the "i18n.commitencoding" option in `.git/config`.
cb7f42cd 90
cb7f42cd 91
2bc4f7bd
JF
92Bind command
93------------
cb7f42cd 94
2bc4f7bd
JF
95Using bind commands keys can be mapped to an action when pressed in a given
96key map. The syntax is:
cb7f42cd 97
2bc4f7bd
JF
98[verse]
99..............................................................................
100 *bind* 'keymap' 'key' 'action'
101..............................................................................
102
103Examples:
104
105--------------------------------------------------------------------------
106 # A few keybindings
107 bind main w scroll-line-up
108 bind main s scroll-line-down
109 bind main space enter
110 bind diff a previous
111 bind diff d next
112 bind diff b move-first-line
1d754561
JF
113 # 'unbind' the default quit key binding
114 bind main Q none
9eb14b72
JF
115 # An external command to update from upstream
116 bind generic F !git fetch
117 # Cherry-pick current commit unto current branch
118 bind generic C !git cherry-pick %(commit)
2bc4f7bd
JF
119--------------------------------------------------------------------------
120
121Keys are mapped by first searching the keybindings for the current view, then
122the keybindings for the *generic* keymap, and last the default keybindings.
f7ffec06 123Thus, the view keybindings shadow the generic keybindings which Shadow the
2bc4f7bd
JF
124built-in keybindings.
125
126--
127
128Keymaps::
129
f9a044a4
JF
130Valid keymaps are: *main*, *diff*, *log*, *help*, *pager*, *status*, *stage*,
131and *generic*. Use *generic* to set key mapping in all keymaps.
2bc4f7bd
JF
132
133Key values::
134
135Key values should never be quoted. Use either the ASCII value or one of the
136following symbolic key names. Symbolic key names are case insensitive, Use
137*Hash* to bind to the `#` key, since the hash mark is used as a comment
138character.
139
140*Enter*, *Space*, *Backspace*, *Tab*, *Escape*, *Left*, *Right*, *Up*, *Down*,
141*Insert*, *Delete*, *Hash*, *Home*, *End*, *PageUp*, *PageDown*, *F1*, *F2*, *F3*,
142*F4*, *F5*, *F6*, *F7*, *F8*, *F9*, *F10*, *F11*, *F12*.
143
144Action names::
145
146Valid action names are described below. Note, all names are
147case-insensitive, and you may use '-', '_', and '.' interchangeably,
148e.g. "view-main", "View.Main", and "VIEW_MAIN" are the same.
149
150--
151
152Actions
153~~~~~~~
154
9eb14b72
JF
155Apart from the action names listed below, all actions starting with a '!' will
156be available as an external command. External commands can contain variable
157names that will be substituted before the command is run. Valid variable names
158are "%(head)", "%(commit)", and "%(blob)".
159
160As an example, the following external command will save the current commit as
161a patch file: "!git format-patch %(commit)^..%(commit)".
162
2bc4f7bd
JF
163ifdef::backend-xhtml11[]
164[frame="none"]
165`-----------------------`-----------------------------------------------------
166endif::backend-xhtml11[]
765595f3 167View switching:
2bc4f7bd
JF
168------------------------------------------------------------------------------
169view-main Show main view
170view-diff Show diff view
171view-log Show log view
9d6976b9
JF
172view-tree Show tree view
173view-blob Show blob view
173d76ea 174view-status Show status view
f9a044a4 175view-stage Show stage view
2bc4f7bd 176view-pager Show pager view
9d6976b9 177view-help Show help page
2bc4f7bd
JF
178------------------------------------------------------------------------------
179
180ifdef::backend-xhtml11[]
181[frame="none"]
182`-----------------------`-----------------------------------------------------
183endif::backend-xhtml11[]
765595f3 184View manipulation:
2bc4f7bd
JF
185------------------------------------------------------------------------------
186enter Enter current line and scroll
187next Move to next
188previous Move to previous
189view-next Move focus to next view
272818ea 190refresh Reload and refresh view
2bc4f7bd
JF
191view-close Close the current view
192quit Close all views and quit
193------------------------------------------------------------------------------
194
195ifdef::backend-xhtml11[]
196[frame="none"]
197`-----------------------`-----------------------------------------------------
198endif::backend-xhtml11[]
765595f3 199Cursor navigation:
2bc4f7bd
JF
200------------------------------------------------------------------------------
201move-up Move cursor one line up
202move-down Move cursor one line down
9d6976b9
JF
203move-page-down Move cursor one page down
204move-page-up Move cursor one page up
205move-first-line Move cursor to first line
206move-last-line Move cursor to last line
2bc4f7bd
JF
207------------------------------------------------------------------------------
208
209ifdef::backend-xhtml11[]
210[frame="none"]
211`-----------------------`-----------------------------------------------------
212endif::backend-xhtml11[]
765595f3 213Scrolling:
2bc4f7bd 214------------------------------------------------------------------------------
9d6976b9
JF
215scroll-line-up Scroll one line up
216scroll-line-down Scroll one line down
217scroll-page-eup Scroll one page up
218scroll-page-down Scroll one page down
2bc4f7bd
JF
219------------------------------------------------------------------------------
220
221ifdef::backend-xhtml11[]
222[frame="none"]
223`-----------------------`-----------------------------------------------------
224endif::backend-xhtml11[]
f9a044a4
JF
225Searching:
226------------------------------------------------------------------------------
227search Search the view
228search-back Search backwards in the view
229find-next Find next search match
230find-prev Find previous search match
231------------------------------------------------------------------------------
232
233ifdef::backend-xhtml11[]
234[frame="none"]
235`-----------------------`-----------------------------------------------------
236endif::backend-xhtml11[]
765595f3 237Misc:
2bc4f7bd 238------------------------------------------------------------------------------
1d754561 239none Do nothing
2bc4f7bd 240prompt Bring up the prompt
2bc4f7bd
JF
241screen-redraw Redraw the screen
242screen-resize Resize the screen
243show-version Show version information
244stop-loading Stop all loading views
245toggle-lineno Toggle line numbers
9d6976b9 246toggle-rev-graph Toggle revision graph visualization
ca1d71ea 247status-update Update file status
b5c18d9d 248status-merge Resolve unmerged file
f9a044a4 249edit Open in editor
226da94b 250cherry-pick Cherry-pick commit to current branch
2bc4f7bd
JF
251------------------------------------------------------------------------------
252
253
254Color command
255-------------
cb7f42cd 256
2bc4f7bd
JF
257Color commands control highlighting and the user interface styles. If your
258terminal supports color, these commands can be used to assign foreground and
f7ffec06 259background combinations to certain areas. Optionally, an attribute can be given
2bc4f7bd
JF
260as the last parameter. The syntax is:
261
262[verse]
263..............................................................................
264 *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
265..............................................................................
cb7f42cd 266
2bc4f7bd 267Examples:
cb7f42cd 268
2bc4f7bd 269------------------------------------------------------------------------------
cb7f42cd
JF
270 # Diff colors
271 color diff-header yellow default
272 color diff-index blue default
273 color diff-chunk magenta default
2bc4f7bd
JF
274 # A strange looking cursor line
275 color cursor red default underline
cb7f42cd
JF
276 # UI colors
277 color title-blur white blue
278 color title-focus white blue bold
2bc4f7bd
JF
279------------------------------------------------------------------------------
280
281Area names::
282
283 Valid area names are described below. Note, all names are
284 case-insensitive, and you may use '-', '_', and '.' interchangeably,
285 e.g. "Diff-Header", "DIFF_HEADER", and "diff.header" are the same.
286
287Color names::
288
289 Valid colors include: *white*, *black*, *green*, *magenta*, *blue*,
290 *cyan*, *yellow*, *red*, *default*. Use *default* to refer to the
291 default terminal colors.
292
293Attribute names::
294
295 Valid attributes include: *normal*, *blink*, *bold*, *dim*, *reverse*,
296 *standout*, and *underline*. Note, not all attributes may be supported
297 by the terminal.
298
299
300UI colors
301~~~~~~~~~
302
303--
304
305Status window colors::
306
307Appearance of the bottom window showing info messages.
308
309*status*
310
311Title window colors::
312
f7ffec06 313Appearance of the title windows when they are attached
2bc4f7bd
JF
314to any backgrounded windows and the current window.
315
316*title-blur*, *title-focus*
317
318Cursor line colors::
319
320*cursor*
321
322Main view specific::
323
324Appearance of the various columns in the main view, including the '~' used for
325delimiting long author names and labels for tag and branch references.
326
327*main-date*, *main-author*, *main-commit*, *main-delim*, *main-tag*,
e15ec88e 328*main-ref*, *main-remote*
2bc4f7bd
JF
329
330--
331
332Highlighting
333~~~~~~~~~~~~
334
335The colors and attributes for text that is not highlighted can be controlled
336by changing the *default* color option.
337
338--
339
340Diff markup::
341
342Options concerning diff start, chunks and lines added and deleted.
343
344*diff-header*, *diff-chunk*, *diff-add*, *diff-del*
345
346Enhanced git diff markup::
347
348Extra diff information emitted by the git diff machinery, such as mode
349changes, rename detection, and similarity.
350
351*diff-oldmode*, *diff-newmode*, *diff-copy-from*, *diff-copy-to*,
352*diff-rename-from*, *diff-rename-to*, *diff-similarity* *diff-dissimilarity*
353*diff-tree*, *diff-index*
354
355Pretty print commit headers::
356
357Commit diffs and the revision logs are usually formatted using pretty printed
358headers , unless `--pretty=raw` was given. This includes lines, such as merge
f7ffec06 359info, commit ID, and author and committer date.
2bc4f7bd
JF
360
361*pp-author*, *pp-commit*, *pp-merge*, *pp-date*, *pp-adate*, *pp-cdate*
362
363Raw commit header::
364
365Usually shown when `--pretty=raw` is given, however 'commit' is pretty much
366omnipresent.
367
368*commit*, *parent*, *tree*, *author*, *committer*
369
370Commit message::
371
d4d8de8f 372For now only `Signed-off-by` and `Acked-by` lines are colorized.
2bc4f7bd 373
d4d8de8f 374*signoff*, *acked*
2bc4f7bd
JF
375
376--
377
378COPYRIGHT
379---------
f9a044a4 380Copyright (c) 2006-2007 Jonas Fonseca <fonseca@diku.dk>
2bc4f7bd
JF
381
382Licensed under the terms of the GNU General Public License.
cb7f42cd
JF
383
384SEE ALSO
385--------
e664e260 386gitlink:tig[1] and the http://jonas.nitro.dk/tig/manual.html[tig manual].