Refactor refresh code between stage and status view
[tig.git] / tigrc
blob59c0ac69ce1630c5acb8507832c8a2de3a72a9d4
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 #    - show (enum) [no|full|abbreviated|email|email-user]
16 #                                       : Show author information?
17 #   commit-title
18 #    - show (bool)                      : Show the commit title?
19 #    - graph (bool)                     : Show the commit revision graph? (main view only)
20 #    - refs (bool)                      : Show branches, tags and remotes? (main view only)
21 #    - overflow (boolint)               : Highlight overflows? Default to 50 when enabled.
23 #   date
24 #    - show (enum) [no|default|local|relative|short]
25 #                                       : Show dates?
26 #   file-name
27 #    - show (enum) [no|always|auto]     : Show file names?
29 #   file-size
30 #    - show (enum) [no|default|units]   : Show file sizes?
32 #   id
33 #    - show (bool)                      : Show commit/tree ID?
35 #   line-number
36 #    - show (bool)                      : Show line numbers?
37 #    - interval (int)                   : Interval between line numbers
39 #   mode
40 #    - show (bool)                      : Show file modes?
42 #   status
43 #    - show (enum) [no|short|long]      : Show status label?
45 #   text
46 #    - show (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   = 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                = default       # Enum: 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` (diff)
95 #set blame-options              = -C -C -C      # User-defined options for `tig blame` (blame)
97 # Misc
98 set read-git-colors             = yes           # Use Git colors?
99 set ignore-case                 = no            # Ignore case when searching?
100 set focus-child                 = yes           # Move focus to child view when opened?
101 set horizontal-scroll           = 50%           # Number of columns to scroll as % of width
102 set split-view-height           = 67%           # Number of lines for bottom view as % of height
103 set vertical-split              = auto          # Enum: horizontal, vertical, auto; Use auto to
104                                                 # switch to horizontal split when width allows it
105 set editor-line-number          = yes           # Automatically pass line number to editor? Used
106                                                 # for opening file at specific line e.g. from a diff
107 set mouse                       = no            # Enable mouse support?
108 set mouse-scroll                = 3             # Number of lines to scroll via the mouse
110 # User-defined commands
111 # ---------------------
112 # These commands allow to run shell commands directly from within Tig.
113 # Unless otherwise specified, commands are run in the foreground with
114 # their console output shown (as if '!' was specified). When multiple
115 # command options are specified their behavior are combined, e.g. "?<git
116 # commit" will prompt the user whether to execute the command and will
117 # exit Tig after completion.
119 #   !   Run the command in the foreground with output shown.
120 #   @   Run the command in the background with no output.
121 #   ?   Prompt the user before executing the command.
122 #   <   Exit Tig after executing the command.
124 # User-defined commands can optionally refer to Tig's internal state
125 # using the following variable names, which are substituted before
126 # commands are run:
128 #   %(head)             The current ref ID. Defaults to HEAD
129 #   %(commit)           The current commit ID.
130 #   %(blob)             The current blob ID.
131 #   %(branch)           The current branch name.
132 #   %(stash)            The current stash name.
133 #   %(directory)        The current directory path in the tree view; 
134 #                       empty for the root directory.
135 #   %(file)             The currently selected file.
136 #   %(ref)              The reference given to blame or HEAD if undefined.
137 #   %(revargs)          The revision arguments passed on the command line.
138 #   %(fileargs)         The file arguments passed on the command line.
139 #   %(cmdlineargs)      All other options passed on the command line.
140 #   %(diffargs)         The diff options from `diff-options` or `TIG_DIFF_OPTS`
141 #   %(prompt)           Prompt for the argument value.
143 bind main       C       ?git cherry-pick %(commit)
144 bind status     C       !git commit
145 bind stash      P       ?git stash pop %(stash)
146 bind stash      !       ?git stash drop %(stash)
147 bind refs       C       ?git checkout %(branch)
148 bind refs       !       ?git branch -d %(branch)
150 # Normal commands
151 # ---------------
153 # View switching
154 bind generic    m       view-main
155 bind generic    d       view-diff
156 bind generic    l       view-log
157 bind generic    t       view-tree
158 bind generic    f       view-blob
159 bind generic    B       view-blame
160 bind generic    H       view-refs
161 bind generic    p       view-pager
162 bind generic    h       view-help
163 bind generic    S       view-status
164 bind generic    c       view-stage
165 bind generic    y       view-stash
166 bind generic    G       view-grep
168 # View manipulation
169 bind generic    Enter   enter                   # Enter and open selected entry
170 bind generic    <       back                    # Go back to the previous view state
171 bind generic    Down    next                    # Move to next
172 bind generic    ^N      next
173 bind generic    Up      previous                # Move to previous
174 bind generic    ^P      previous
175 bind generic    ,       parent                  # Move to parent
176 bind generic    Tab     view-next               # Move focus to the next view
177 bind generic    R       refresh                 # Reload and refresh view
178 bind generic    F5      refresh
179 bind generic    O       maximize                # Maximize the current view
180 bind generic    q       view-close              # Close the current view
181 bind generic    Q       quit                    # Close all views and quit
183 # View specific
184 bind status     u       status-update           # Stage/unstage changes in file
185 bind status     !       status-revert           # Revert changes in file
186 bind status     M       status-merge            # Open git-mergetool(1)
187 #bind status    ???     :toggle show-status     # Show short or long status labels
188 bind stage      u       status-update           # Stage/unstage current diff (c)hunk
189 bind stage      1       stage-update-line       # Stage/unstage current line
190 bind stage      !       status-revert           # Revert current diff (c)hunk
191 bind stage      \       stage-split-chunk       # Split current diff (c)hunk
192 bind stage      @       :/^@@                   # Jump to next (c)hunk
193 bind stage      [       :toggle diff-context -1 # Decrease the diff context
194 bind stage      ]       :toggle diff-context +1 # Increase the diff context
195 bind diff       @       :/^@@                   # Jump to next (c)hunk
196 bind diff       [       :toggle diff-context -1
197 bind diff       ]       :toggle diff-context +1
199 # Cursor navigation
200 bind generic    k       move-up
201 bind generic    j       move-down
202 bind generic    PgDown  move-page-down
203 bind generic    ^D      move-page-down
204 bind generic    Space   move-page-down
205 bind generic    PgUp    move-page-up
206 bind generic    ^U      move-page-up
207 bind generic    b       move-page-up
208 bind generic    -       move-page-up
209 bind generic    Home    move-first-line
210 bind generic    End     move-last-line
212 # Scrolling
213 bind generic    |       scroll-first-col
214 bind generic    Left    scroll-left
215 bind generic    Right   scroll-right
216 bind generic    Insert  scroll-line-up
217 bind generic    ^Y      scroll-line-up
218 bind generic    Delete  scroll-line-down
219 bind generic    ^E      scroll-line-down
220 bind generic    w       scroll-page-up
221 bind generic    s       scroll-page-down
223 # Searching
224 bind generic    /       search
225 bind generic    ?       search-back
226 bind generic    n       find-next
227 bind generic    N       find-prev
229 # Option manipulation
230 bind generic    o       options                 # Open the options menu
231 # Bindings for toggling settings
232 bind generic    I       :toggle sort-order      # Toggle ascending/descending sort order
233 bind generic    i       :toggle sort-field      # Toggle field to sort by
234 bind generic    .       :toggle show-line-number
235                                                 # Toggle line numbers
236 bind generic    D       :toggle show-date       # Toggle date display
237 bind generic    A       :toggle show-author     # Toggle author display
238 bind generic    g       :toggle commit-title-graph
239                                                 # Toggle revision graph visualization
240 bind generic    ~       :toggle line-graphics   # Toggle (line) graphics mode
241 bind generic    Hash    :toggle show-file-name  # Toggle file name display
242 bind generic    F       :toggle commit-title-refs
243                                                 # Toggle reference display (tags/branches)
244 # bind generic  ???     :toogle show-changes    # Toggle local changes display in the main view
245 bind generic    W       :toggle ignore-space    # Toggle ignoring whitespace in diffs
246 # bind generic  ?       :toggle commit-order    # Toggle commit ordering
247 bind generic    X       :toggle show-id         # Toggle commit ID display
248 bind generic    $       :toggle commit-title-overflow
249                                                 # Toggle highlighting of commit title overflow
250 # bind generic  ???     :toggle show-file-size  # Toggle file size format
251 # bind generic  ???     :toggle show-status     # Toggle status display
252 # bind generic  ???     :toggle status-untracked-dirs
253                                                 # Toggle display of file in untracked directories
254 # bind generic  ???     :toggle vertical-split  # Toggle vertical split
255 bind generic    %       :toggle file-filter
257 # Misc
258 bind generic    e       edit                    # Open in editor
259 bind generic    :       prompt                  # Open the prompt
260 bind generic    r       screen-redraw           # Redraw the screen
261 bind generic    ^L      screen-redraw
262 bind generic    z       stop-loading            # Stop all loading views
263 bind generic    v       show-version            # Show Tig version
265 # Colors
266 # ------
268 # The colors in the UI can be customized. In addition to the colors used
269 # for the UI you can also define new colors to use in the pager, blob,
270 # diff, and stage views by placing the text to match for in quotes.
272 # Prefix the name of a view to set a color only for that view, e.g.
274 #       color grep.file blue default
276 # As an example, this setting will to color Signed-off-by lines with a
277 # yellow foreground color and use the default background color.
279 #       color "    Signed-off-by"       yellow  default
281 # Note the four leading spaces in the string to match. This is because
282 # Git automatically indents commit messages by four spaces.
284 color "diff --"                 yellow  default
285 color "@@"                      magenta default
286 color "+"                       green   default
287 color " +"                      green   default
288 color "-"                       red     default
289 color " -"                      red     default
290 color "index "                  blue    default
291 color "old file mode "          yellow  default
292 color "new file mode "          yellow  default
293 color "deleted file mode "      yellow  default
294 color "copy from "              yellow  default
295 color "copy to "                yellow  default
296 color "rename from "            yellow  default
297 color "rename to "              yellow  default
298 color "similarity "             yellow  default
299 color "dissimilarity "          yellow  default
300 color "diff-tree "              blue    default
301 color "Author: "                cyan    default
302 color "Commit: "                magenta default
303 color "Tagger: "                magenta default
304 color "Merge: "                 blue    default
305 color "Date: "                  yellow  default
306 color "AuthorDate: "            yellow  default
307 color "CommitDate: "            yellow  default
308 color "TaggerDate: "            yellow  default
309 color "Refs: "                  red     default
310 color "Reflog: "                red     default
311 color "Reflog message: "        yellow  default
312 color "stash@{"                 magenta default
313 color "commit "                 green   default
314 color "parent "                 blue    default
315 color "tree "                   blue    default
316 color "author "                 green   default
317 color "committer "              magenta default
318 color "    Signed-off-by"       yellow  default
319 color "    Acked-by"            yellow  default
320 color "    Tested-by"           yellow  default
321 color "    Reviewed-by"         yellow  default
322 color default                   default default normal
323 color cursor                    white   green   bold
324 color status                    green   default
325 color delimiter                 magenta default
326 color date                      blue    default
327 color mode                      cyan    default
328 color id                        magenta default
329 color overflow                  red     default
330 color header                    yellow  default
331 color section                   cyan    default
332 color directory                 yellow  default
333 color file                      default default
334 color grep.file                 blue    default
335 color file-size                 default default
336 color line-number               cyan    default
337 color title-blur                white   blue
338 color title-focus               white   blue    bold
339 color main-commit               default default
340 color main-tag                  magenta default bold
341 color main-local-tag            magenta default
342 color main-remote               yellow  default
343 color main-replace              cyan    default
344 color main-tracked              yellow  default bold
345 color main-ref                  cyan    default
346 color main-head                 cyan    default bold
347 color stat-none                 default default
348 color stat-staged               magenta default
349 color stat-unstaged             magenta default
350 color stat-untracked            magenta default
351 color help-group                blue    default
352 color help-action               yellow  default
353 color diff-stat                 blue    default
354 color palette-0                 magenta default
355 color palette-1                 yellow  default
356 color palette-2                 cyan    default
357 color palette-3                 green   default
358 color palette-4                 default default
359 color palette-5                 white   default
360 color palette-6                 red     default
361 color graph-commit              blue    default