Move code to new search module
[tig.git] / tigrc
blob79e667a9b5a81c0cd44e564476d71f2721311fd2
1 # Tig default configuration
3 # Please see 'man tigrc' for a complete reference.
5 # Settings
6 # --------
7 # Most of these settings can be toggleable, either via the toggle-*
8 # actions or via the option menu (bound to `o` by default).
10 # View settings
12 # Supported column types and their options:
14 #   author
15 #    - display (enum) [no|full|abbreviated|email|email-user]
16 #                                       : Show author information?
17 #   commit-title
18 #    - display (bool)                   : Show the commit title?
19 #    - graph (enum) [no|v2|v1]          : Show the commit graph? (main view only)
20 #    - refs (bool)                      : Show branches, tags and remotes? (main view only)
21 #    - overflow (boolint)               : Highlight overflows? Defaults to 50 when enabled.
23 #   date
24 #    - display (enum) [no|default|local|relative|short]
25 #                                       : Show dates?
26 #   file-name
27 #    - display (enum) [no|always|auto]  : Show file names?
29 #   file-size
30 #    - display (enum) [no|default|units]        : Show file sizes?
32 #   id
33 #    - display (bool)                   : Show commit/tree ID?
35 #   line-number
36 #    - display (bool)                   : Show line numbers?
37 #    - interval (int)                   : Interval between line numbers; defaults to 5
39 #   mode
40 #    - display (bool)                   : Show file modes?
42 #   status
43 #    - display (enum) [no|short|long]   : Show status label?
45 #   text
46 #    - display (bool)                   : Show text?
47 #    - commit-title-overflow (boolint)  : Highlight overflow in log and diff view?
49 # All columns also support a width option to configure the max width of
50 # the column. Use zero (the default value) to auto-size the column based
51 # on the content.
53 set blame-view  = date:default author:full file-name:auto id:yes,color line-number:no,interval=5 text
54 set grep-view   = file-name:no line-number:yes,interval=1 text
55 set main-view   = line-number:no,interval=5 id:no date:default author:full commit-title:yes,graph,refs,overflow=no
56 set refs-view   = line-number:no id:no date:default author:full ref commit-title
57 set stash-view  = line-number:no,interval=5 id:no date:default author:full commit-title
58 set status-view = line-number:no,interval=5 status:short file-name
59 set tree-view   = line-number:no,interval=5 mode author:full file-size date:default id:no file-name
61 # Pager based views
62 set pager-view  = line-number:no,interval=5 text
63 set stage-view  = line-number:no,interval=5 text
64 set log-view    = line-number:no,interval=5 text
65 set blob-view   = line-number:no,interval=5 text
66 set diff-view   = line-number:no,interval=5 text:yes,commit-title-overflow=no
68 # UI display settings
69 set show-changes                = yes           # Show changes commits in the main view?
70 set wrap-lines                  = no            # Wrap long lines in pager views?
71 set tab-size                    = 8             # Number of spaces to use when expanding tabs
72 set line-graphics               = default       # Enum: ascii, default, utf-8
74 # Format reference names based on type.
75 #  - head               : The current HEAD.
76 #  - tag                : A signed tag.
77 #  - local-tag          : An unsigned tag.
78 #  - remote             : A remote.
79 #  - tracked-remote     : The remote tracked by current HEAD.
80 #  - replace            : A replaced reference.
81 #  - branch             : Any other reference.
82 # If no format is defined for `local-tag` then the one for `tag` is used.
83 # Similarly, `remote` is used if no `tracked-remote` format exists.
84 # Prefix with `hide:` to not show that reference type, e.g. `hide:remote`.
85 # Expects a space separated list of format strings.
86 set reference-format            = [branch] <tag> {remote} ~replace~
88 # Settings controlling how content is read from Git
89 set commit-order                = auto          # Enum: auto, default, topo, date, reverse (main)
90 set status-untracked-dirs       = yes           # Show files in untracked directories? (status)
91 set ignore-space                = no            # Enum: no, all, some, at-eol (diff)
92 set show-notes                  = yes           # When non-bool passed as `--show-notes=...` (diff)
93 #set diff-context               = 3             # Number of lines to show around diff changes (diff)
94 #set diff-options               = -C            # User-defined options for `tig show` (git-diff)
95 #set blame-options              = -C -C -C      # User-defined options for `tig blame` (git-blame)
96 #set log-options                = --pretty=raw  # User-defined options for `tig log` (git-log)
97 #set main-options               = -n 1000       # User-defined options for `tig` (git-log)
98 #set mailmap                    = yes           # Use .mailmap to show canonical name and email address
100 # Misc
101 set refresh-mode                = auto          # Enum: manual, auto, after-command, periodic
102 set refresh-interval            = 10            # Interval in seconds between refreshes
103 set ignore-case                 = no            # Ignore case when searching?
104 set focus-child                 = yes           # Move focus to child view when opened?
105 set horizontal-scroll           = 50%           # Number of columns to scroll as % of width
106 set split-view-height           = 67%           # Height of the bottom view for horizontal splits
107 set vertical-split              = auto          # Enum: horizontal, vertical, auto; Use auto to
108                                                 # switch to horizontal split when width allows it
109 set split-view-width            = 50%           # Width of right-most view for vertical splits
110 set editor-line-number          = yes           # Automatically pass line number to editor? Used
111                                                 # for opening file at specific line e.g. from a diff
112 set mouse                       = no            # Enable mouse support?
113 set mouse-scroll                = 3             # Number of lines to scroll via the mouse
115 # User-defined commands
116 # ---------------------
117 # These commands allow to run shell commands directly from within Tig.
118 # Unless otherwise specified, commands are run in the foreground with
119 # their console output shown (as if '!' was specified). When multiple
120 # command options are specified their behavior are combined, e.g. "?<git
121 # commit" will prompt the user whether to execute the command and will
122 # exit Tig after completion.
124 #   !   Run the command in the foreground with output shown.
125 #   @   Run the command in the background with no output.
126 #   ?   Prompt the user before executing the command.
127 #   <   Exit Tig after executing the command.
129 # User-defined commands can optionally refer to Tig's internal state
130 # using the following variable names, which are substituted before
131 # commands are run:
133 #   %(head)             The current ref ID. Defaults to HEAD
134 #   %(commit)           The current commit ID.
135 #   %(blob)             The current blob ID.
136 #   %(branch)           The current branch name.
137 #   %(remote)           The current remote name.
138 #   %(tag)              The current tag name.
139 #   %(stash)            The current stash name.
140 #   %(directory)        The current directory path in the tree view; 
141 #                       empty for the root directory.
142 #   %(file)             The currently selected file.
143 #   %(ref)              The reference given to blame or HEAD if undefined.
144 #   %(revargs)          The revision arguments passed on the command line.
145 #   %(fileargs)         The file arguments passed on the command line.
146 #   %(cmdlineargs)      All other options passed on the command line.
147 #   %(diffargs)         The diff options from `diff-options` or `TIG_DIFF_OPTS`
148 #   %(prompt)           Prompt for the argument value.
150 bind main       C       ?git cherry-pick %(commit)
151 bind status     C       !git commit
152 bind stash      P       ?git stash pop %(stash)
153 bind stash      !       ?git stash drop %(stash)
154 bind refs       C       ?git checkout %(branch)
155 bind refs       !       ?git branch -D %(branch)
157 # Normal commands
158 # ---------------
160 # View switching
161 bind generic    m       view-main
162 bind generic    d       view-diff
163 bind generic    l       view-log
164 bind generic    t       view-tree
165 bind generic    f       view-blob
166 bind generic    b       view-blame
167 bind generic    r       view-refs
168 bind generic    p       view-pager
169 bind generic    h       view-help
170 bind generic    s       view-status
171 bind generic    S       view-status             # Compat binding to avoid going crazy!
172 bind generic    c       view-stage
173 bind generic    y       view-stash
174 bind generic    g       view-grep
176 # View manipulation
177 bind generic    <Enter> enter                   # Enter and open selected entry
178 bind generic    <Lt>    back                    # Go back to the previous view state
179 bind generic    <Down>  next                    # Move to next
180 bind generic    <C-N>   next
181 bind generic    J       next
182 bind generic    <Up>    previous                # Move to previous
183 bind generic    <C-P>   previous
184 bind generic    K       previous
185 bind generic    ,       parent                  # Move to parent
186 bind generic    <Tab>   view-next               # Move focus to the next view
187 bind generic    R       refresh                 # Reload and refresh view
188 bind generic    <F5>    refresh
189 bind generic    O       maximize                # Maximize the current view
190 bind generic    q       view-close              # Close the current view
191 bind generic    Q       quit                    # Close all views and quit
193 # View specific
194 bind status     u       status-update           # Stage/unstage changes in file
195 bind status     !       status-revert           # Revert changes in file
196 bind status     M       status-merge            # Open git-mergetool(1)
197 #bind status    ???     :toggle status          # Show short or long status labels
198 bind stage      u       status-update           # Stage/unstage current diff (c)hunk
199 bind stage      1       stage-update-line       # Stage/unstage current line
200 bind stage      !       status-revert           # Revert current diff (c)hunk
201 bind stage      \       stage-split-chunk       # Split current diff (c)hunk
202 bind stage      @       :/^@@                   # Jump to next (c)hunk
203 bind stage      [       :toggle diff-context -1 # Decrease the diff context
204 bind stage      ]       :toggle diff-context +1 # Increase the diff context
205 bind diff       @       :/^@@                   # Jump to next (c)hunk
206 bind diff       [       :toggle diff-context -1
207 bind diff       ]       :toggle diff-context +1
208 bind main       G       :toggle commit-title-graph # Toggle revision graph visualization
209 bind main       F       :toggle commit-title-refs  # Toggle reference display (tags/branches)
211 # Cursor navigation
212 bind generic    j       move-down
213 bind generic    k       move-up
214 #bind generic   ?       move-half-page-down
215 #bind generic   ?       move-half-page-up
216 bind generic    <PgDown> move-page-down
217 bind generic    <C-D>   move-page-down
218 bind generic    <Space> move-page-down
219 bind generic    <PgUp>  move-page-up
220 bind generic    <C-U>   move-page-up
221 bind generic    -       move-page-up
222 bind generic    <Home>  move-first-line
223 bind generic    <End>   move-last-line
225 # Scrolling
226 bind generic    |       scroll-first-col
227 bind generic    <Left>  scroll-left
228 bind generic    <Right> scroll-right
229 bind generic    <Ins>   scroll-line-up
230 bind generic    <C-Y>   scroll-line-up
231 bind generic    <Del>   scroll-line-down
232 bind generic    <C-E>   scroll-line-down
233 bind generic    <SBack> scroll-page-up
234 bind generic    <SFwd>  scroll-page-down
236 # Searching
237 bind generic    /       search
238 bind generic    ?       search-back
239 bind generic    n       find-next
240 bind generic    N       find-prev
241 # Navigation keys used while searching
242 bind search     <Down>  find-next
243 bind search     <C-N>   find-next
244 bind search     <C-J>   find-next
245 bind search     <Up>    find-prev
246 bind search     <C-P>   find-prev
247 bind search     <C-K>   find-prev
249 # Option manipulation
250 bind generic    o       options                 # Open the options menu
251 # Bindings for toggling settings
252 bind generic    I       :toggle sort-order      # Toggle ascending/descending sort order
253 bind generic    i       :toggle sort-field      # Toggle field to sort by
254 bind generic    <Hash>  :toggle line-number     # Toggle line numbers
255 bind generic    D       :toggle date            # Toggle date display
256 bind generic    A       :toggle author          # Toggle author display
257 bind generic    ~       :toggle line-graphics   # Toggle (line) graphics mode
258 bind generic    F       :toggle file-name       # Toggle file name display
259 # bind generic  ???     :toogle show-changes    # Toggle local changes display in the main view
260 bind generic    W       :toggle ignore-space    # Toggle ignoring whitespace in diffs
261 # bind generic  ?       :toggle commit-order    # Toggle commit ordering
262 bind generic    X       :toggle id              # Toggle commit ID display
263 bind generic    $       :toggle commit-title-overflow
264                                                 # Toggle highlighting of commit title overflow
265 # bind generic  ???     :toggle file-size       # Toggle file size format
266 # bind generic  ???     :toggle status          # Toggle status display
267 # bind generic  ???     :toggle status-untracked-dirs
268                                                 # Toggle display of file in untracked directories
269 # bind generic  ???     :toggle vertical-split  # Toggle vertical split
270 bind generic    %       :toggle file-filter
272 # Misc
273 bind generic    e       edit                    # Open in editor
274 bind generic    :       prompt                  # Open the prompt
275 bind generic    <C-L>   screen-redraw           # Redraw the screen
276 bind generic    z       stop-loading            # Stop all loading views
277 bind generic    v       show-version            # Show Tig version
279 # Colors
280 # ------
282 # The colors in the UI can be customized. In addition to the colors used
283 # for the UI you can also define new colors to use in the pager, blob,
284 # diff, and stage views by placing the text to match for in quotes.
286 # Prefix the name of a view to set a color only for that view, e.g.
288 #       color grep.file blue default
290 # As an example, this setting will to color Signed-off-by lines with a
291 # yellow foreground color and use the default background color.
293 #       color "    Signed-off-by"       yellow  default
295 # Note the four leading spaces in the string to match. This is because
296 # Git automatically indents commit messages by four spaces.
298 color "diff --"                 yellow  default
299 color "--- "                    yellow  default
300 color "+++ "                    yellow  default
301 color "@@"                      magenta default
302 color "+"                       green   default
303 color " +"                      green   default
304 color "-"                       red     default
305 color " -"                      red     default
306 color "index "                  blue    default
307 color "old file mode "          yellow  default
308 color "new file mode "          yellow  default
309 color "deleted file mode "      yellow  default
310 color "copy from "              yellow  default
311 color "copy to "                yellow  default
312 color "rename from "            yellow  default
313 color "rename to "              yellow  default
314 color "similarity "             yellow  default
315 color "dissimilarity "          yellow  default
316 color "diff-tree "              blue    default
317 color "Author: "                cyan    default
318 color "Commit: "                magenta default
319 color "Tagger: "                magenta default
320 color "Merge: "                 blue    default
321 color "Date: "                  yellow  default
322 color "AuthorDate: "            yellow  default
323 color "CommitDate: "            yellow  default
324 color "TaggerDate: "            yellow  default
325 color "Refs: "                  red     default
326 color "Reflog: "                red     default
327 color "Reflog message: "        yellow  default
328 color "stash@{"                 magenta default
329 color "commit "                 green   default
330 color "parent "                 blue    default
331 color "tree "                   blue    default
332 color "author "                 green   default
333 color "committer "              magenta default
334 color "    Signed-off-by"       yellow  default
335 color "    Acked-by"            yellow  default
336 color "    Tested-by"           yellow  default
337 color "    Reviewed-by"         yellow  default
338 color default                   default default normal
339 color cursor                    white   green   bold
340 color status                    green   default
341 color delimiter                 magenta default
342 color date                      blue    default
343 color mode                      cyan    default
344 color id                        magenta default
345 color overflow                  red     default
346 color header                    yellow  default
347 color section                   cyan    default
348 color directory                 yellow  default
349 color file                      default default
350 color grep.file                 blue    default
351 color file-size                 default default
352 color line-number               cyan    default
353 color title-blur                white   blue
354 color title-focus               white   blue    bold
355 color main-commit               default default
356 color main-tag                  magenta default bold
357 color main-local-tag            magenta default
358 color main-remote               yellow  default
359 color main-replace              cyan    default
360 color main-tracked              yellow  default bold
361 color main-ref                  cyan    default
362 color main-head                 cyan    default bold
363 color stat-none                 default default
364 color stat-staged               magenta default
365 color stat-unstaged             magenta default
366 color stat-untracked            magenta default
367 color help-group                blue    default
368 color help-action               yellow  default
369 color diff-stat                 blue    default
370 color palette-0                 magenta default
371 color palette-1                 yellow  default
372 color palette-2                 cyan    default
373 color palette-3                 green   default
374 color palette-4                 default default
375 color palette-5                 white   default
376 color palette-6                 red     default
377 color palette-7                 magenta default bold
378 color palette-8                 yellow  default bold
379 color palette-9                 cyan    default bold
380 color palette-10                green   default bold
381 color palette-11                default default bold
382 color palette-12                white   default bold
383 color palette-13                red     default bold
384 color graph-commit              blue    default
386 # Mappings for colors read from git configuration.
387 # Set to "no" to disable.
388 set git-colors = \
389         branch.current=main-head \
390         branch.local=main-ref \
391         branch.plain=main-ref \
392         branch.remote=main-remote \
393         \
394         diff.meta=diff-header \
395         diff.meta=diff-index \
396         diff.meta=diff-oldmode \
397         diff.meta=diff-newmode \
398         diff.frag=diff-chunk \
399         diff.old=diff-del \
400         diff.new=diff-add \
401         \
402         grep.filename=grep.file \
403         grep.linenumber=grep.line-number \
404         grep.separator=grep.delimiter \
405         \
406         status.branch=status.header \
407         status.added=stat-staged \
408         status.updated=stat-staged \
409         status.changed=stat-unstaged \
410         status.untracked=stat-untracked