Code

Make it possible to overwrite the default (terminal) colors
[tig.git] / tigrc.5.txt
1 tigrc(5)
2 ========
4 NAME
5 ----
6 tigrc - tig user configuration file
9 SYNOPSIS
10 --------
11 [verse]
12 .............................................................................
13 *set*   'variable' *=* 'value'
14 *bind*  'keymap' 'key' 'action'
15 *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
16 .............................................................................
19 DESCRIPTION
20 -----------
22 You can permanently set an option by putting it in the `~/.tigrc` file.  The
23 file consists of a series of 'commands'.  Each line of the file may contain
24 only one command.
26 The hash mark ('#') is used as a 'comment' character. All text after the
27 comment character to the end of the line is ignored. You can use comments to
28 annotate your initialization file.
31 Set command
32 -----------
34 A few selective variables can be configured via the set command. The syntax
35 is:
37 [verse]
38 ..............................................................................
39 *set* variables *=* value
40 ..............................................................................
42 Examples:
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 per tab
48 set encoding = "UTF-8"          # Commit encoding
49 --------------------------------------------------------------------------
51 The type of variables are either bool, int, and string.
53 Valid bool values::
55         To set a bool variable to true use either "1", "true", or "yes".
56         Any other value will set the variable to false.
58 Valid int values::
60         A non-negative integer.
62 Valid string values::
64         A string of characters. Optionally, use either ' or " as delimiters.
66 Variables
67 ~~~~~~~~~
69 The following variables can be set:
71 'show-rev-graph' (bool)::
73         Show revision graph in the main view on start-up. Can be toggled with
74         'g'.
76 'line-number-interval' (int)::
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.
82 'tab-size' (int)::
84         Number of spaces per tab. The default is 8 spaces.
86 'commit-encoding' (string)::
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`.
92 Bind command
93 ------------
95 Using bind commands keys can be mapped to an action when pressed in a given
96 key map. The syntax is:
98 [verse]
99 ..............................................................................
100 *bind* 'keymap' 'key' 'action'
101 ..............................................................................
103 Examples:
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
113 # 'unbind' the default quit key binding
114 bind main Q none
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)
119 --------------------------------------------------------------------------
121 Keys are mapped by first searching the keybindings for the current view, then
122 the keybindings for the *generic* keymap, and last the default keybindings.
123 Thus, the view keybindings shadow the generic keybindings which Shadow the
124 built-in keybindings.
126 --
128 Keymaps::
130 Valid keymaps are: *main*, *diff*, *log*, *help*, *pager*, *status*, *stage*,
131 and *generic*.  Use *generic* to set key mapping in all keymaps.
133 Key values::
135 Key values should never be quoted. Use either the ASCII value or one of the
136 following 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
138 character.
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*.
144 Action names::
146 Valid action names are described below. Note, all names are
147 case-insensitive, and you may use '-', '_', and '.' interchangeably,
148 e.g. "view-main", "View.Main", and "VIEW_MAIN" are the same.
150 --
152 Actions
153 ~~~~~~~
155 Apart from the action names listed below, all actions starting with a '!' will
156 be available as an external command. External commands can contain variable
157 names that will be substituted before the command is run. Valid variable names
158 are "%(head)", "%(commit)", and "%(blob)".
160 As an example, the following external command will save the current commit as
161 a patch file: "!git format-patch %(commit)^..%(commit)".
163 ifdef::backend-xhtml11[]
164 [frame="none"]
165 `-----------------------`-----------------------------------------------------
166 endif::backend-xhtml11[]
167 View switching:
168 ------------------------------------------------------------------------------
169 view-main               Show main view
170 view-diff               Show diff view
171 view-log                Show log view
172 view-tree               Show tree view
173 view-blob               Show blob view
174 view-status             Show status view
175 view-stage              Show stage view
176 view-pager              Show pager view
177 view-help               Show help page
178 ------------------------------------------------------------------------------
180 ifdef::backend-xhtml11[]
181 [frame="none"]
182 `-----------------------`-----------------------------------------------------
183 endif::backend-xhtml11[]
184 View manipulation:
185 ------------------------------------------------------------------------------
186 enter                   Enter current line and scroll
187 next                    Move to next
188 previous                Move to previous
189 view-next               Move focus to next view
190 refresh                 Reload and refresh view
191 view-close              Close the current view
192 quit                    Close all views and quit
193 ------------------------------------------------------------------------------
195 ifdef::backend-xhtml11[]
196 [frame="none"]
197 `-----------------------`-----------------------------------------------------
198 endif::backend-xhtml11[]
199 Cursor navigation:
200 ------------------------------------------------------------------------------
201 move-up                 Move cursor one line up
202 move-down               Move cursor one line down
203 move-page-down          Move cursor one page down
204 move-page-up            Move cursor one page up
205 move-first-line         Move cursor to first line
206 move-last-line          Move cursor to last line
207 ------------------------------------------------------------------------------
209 ifdef::backend-xhtml11[]
210 [frame="none"]
211 `-----------------------`-----------------------------------------------------
212 endif::backend-xhtml11[]
213 Scrolling:
214 ------------------------------------------------------------------------------
215 scroll-line-up          Scroll one line up
216 scroll-line-down        Scroll one line down
217 scroll-page-eup         Scroll one page up
218 scroll-page-down        Scroll one page down
219 ------------------------------------------------------------------------------
221 ifdef::backend-xhtml11[]
222 [frame="none"]
223 `-----------------------`-----------------------------------------------------
224 endif::backend-xhtml11[]
225 Searching:
226 ------------------------------------------------------------------------------
227 search                  Search the view
228 search-back             Search backwards in the view
229 find-next               Find next search match
230 find-prev               Find previous search match
231 ------------------------------------------------------------------------------
233 ifdef::backend-xhtml11[]
234 [frame="none"]
235 `-----------------------`-----------------------------------------------------
236 endif::backend-xhtml11[]
237 Misc:
238 ------------------------------------------------------------------------------
239 none                    Do nothing
240 prompt                  Bring up the prompt
241 screen-redraw           Redraw the screen
242 screen-resize           Resize the screen
243 show-version            Show version information
244 stop-loading            Stop all loading views
245 toggle-lineno           Toggle line numbers
246 toggle-rev-graph        Toggle revision graph visualization
247 status-update           Update file status
248 status-merge            Resolve unmerged file
249 tree-parent             Switch to parent directory in tree view
250 edit                    Open in editor
251 ------------------------------------------------------------------------------
254 Color command
255 -------------
257 Color commands control highlighting and the user interface styles. If your
258 terminal supports color, these commands can be used to assign foreground and
259 background combinations to certain areas. Optionally, an attribute can be
260 given as the last parameter. The syntax is:
262 [verse]
263 ..............................................................................
264 *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
265 ..............................................................................
267 Examples:
269 ------------------------------------------------------------------------------
270 # Overwrite the default terminal colors to white on black.
271 color default           white   black
272 # Diff colors
273 color diff-header       yellow  default
274 color diff-index        blue    default
275 color diff-chunk        magenta default
276 # A strange looking cursor line
277 color cursor            red     default underline
278 # UI colors
279 color title-blur        white   blue
280 color title-focus       white   blue    bold
281 ------------------------------------------------------------------------------
283 Area names::
285         Valid area names are described below. Note, all names are
286         case-insensitive, and you may use '-', '_', and '.' interchangeably,
287         e.g. "Diff-Header", "DIFF_HEADER", and "diff.header" are the same.
289 Color names::
291         Valid colors include: *white*, *black*, *green*, *magenta*, *blue*,
292         *cyan*, *yellow*, *red*, *default*. Use *default* to refer to the
293         default terminal colors.
295 Attribute names::
297         Valid attributes include: *normal*, *blink*, *bold*, *dim*, *reverse*,
298         *standout*, and *underline*. Note, not all attributes may be supported
299         by the terminal.
301 UI colors
302 ~~~~~~~~~
304 --
306 Default terminal colors::
308 The colors and attributes to be used for the text that is not highlighted or
309 that specify the use of the default terminal colors can be controlled by
310 setting the *default* color option.
312 Use the *default* color to use the colors configured for the terminal. This is
313 the default and recommended if you are using a terminal with a transparent
314 background.
316 Status window colors::
318 Appearance of the bottom window showing info messages.
320 *status*
322 Title window colors::
324 Appearance of the title windows when they are attached
325 to any backgrounded windows and the current window.
327 *title-blur*, *title-focus*
329 Cursor line colors::
331 *cursor*
333 Main view specific::
335 Appearance of the various columns in the main view, including the '~' used for
336 delimiting long author names and labels for tag and branch references.
338 *main-date*, *main-author*, *main-commit*, *main-delim*, *main-tag*,
339 *main-ref*, *main-remote*, *main-revgraph*
341 --
343 Highlighting
344 ~~~~~~~~~~~~
346 --
348 Diff markup::
350 Options concerning diff start, chunks and lines added and deleted.
352 *diff-header*, *diff-chunk*, *diff-add*, *diff-del*
354 Enhanced git diff markup::
356 Extra diff information emitted by the git diff machinery, such as mode
357 changes, rename detection, and similarity.
359 *diff-oldmode*, *diff-newmode*, *diff-copy-from*, *diff-copy-to*,
360 *diff-rename-from*, *diff-rename-to*, *diff-similarity*, *diff-dissimilarity*
361 *diff-tree*, *diff-index*
363 Pretty print commit headers::
365 Commit diffs and the revision logs are usually formatted using pretty printed
366 headers , unless `--pretty=raw` was given. This includes lines, such as merge
367 info, commit ID, and author and committer date.
369 *pp-author*, *pp-commit*, *pp-merge*, *pp-date*, *pp-adate*, *pp-cdate*,
370 *pp-refs*
372 Raw commit header::
374 Usually shown when `--pretty=raw` is given, however 'commit' is pretty much
375 omnipresent.
377 *commit*, *parent*, *tree*, *author*, *committer*
379 Commit message::
381 For now only `Signed-off-by` and `Acked-by` lines are colorized.
383 *signoff*, *acked*
385 Tree markup::
387 Colors for information of the tree view.
389 *tree-dir*, *tree-file*
391 Status markup::
393 Colors used in the status view.
395 *stat-section*, *stat-none*, *stat-staged*, *stat-unstaged*, *stat-untracked*
397 --
399 COPYRIGHT
400 ---------
401 Copyright (c) 2006-2007 Jonas Fonseca <fonseca@diku.dk>
403 Licensed under the terms of the GNU General Public License.
405 SEE ALSO
406 --------
407 gitlink:tig[1] and the http://jonas.nitro.dk/tig/manual.html[tig manual].