delta-gitu 0.1.15

An experimental fork of gitu (a git client inspired by Magit), published as a library for delta to embed
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
# This file contains Gitu's default configuration.
# It is possible to override settings with an equivalent file at:
# `~/.config/gitu/config.toml`
# and to override both in git config's `delta-tui` section, e.g.
#   [delta-tui]
#       start-folded = true
#   [delta-tui "style"]
#       hunk-header = bold blue

[general]
always_show_help.enabled = false
confirm_quit.enabled = false
# Sets initially collapsed sections in the editor. e.g.:
# collapsed_sections = ["untracked", "recent_commits", "branch_status"]
collapsed_sections = []
refresh_on_file_change.enabled = true
stash_list_limit = 10
recent_commits_limit = 10
log_author_width = 15
mouse_support = false
mouse_scroll_lines = 3

# The most input Gitu will read, whether piped to it as a pager or produced by
# a command it puts again. Input is read in one pass before the first frame, so
# without a limit an accidental `git log -p` over a whole history shows nothing
# until all of it has been read and rendered.
max_input_bytes = 2_000_000

# The branch section is 'Branch: {name}' over a line placing the branch
# relative to its upstream. Off, it is the branch name alone.
verbose_branch_status = true

# Files to drop from a paged view (`gitu --pager`), as if the patch never had
# them. The wildcards are git's: `*.pb.go` matches at any depth, and naming a
# directory hides its subtree. `&` says which files to show while reading, and
# `:` shows the pathspecs these became. e.g.:
#   hide = ["*.pb.go", "*_test.go", "vendor"]
hide = []

# Stop the cursor on a diff's unchanged lines too, as reading a patch line by
# line wants. Nothing can be staged there; off, the cursor skips them.
visit_context_lines = true

# Open the status screen on the first unstaged file, or the first staged one
# when nothing is unstaged; off, it opens at the top.
status_cursor_on_changes = true

# Renderer features that `renderer_features` offers, to turn on and off while
# viewing a diff. They are passed to the renderer as DELTA_FEATURES=+<names>,
# which delta adds to the features your own git config already sets: your
# configuration stays the base and this is only an overlay on it, held for the
# session and never written to disk.
#
# Any feature you have defined in git config as `[delta "name"]` can be named
# here alongside delta's built-in ones, singly or by a pattern: `*` matches any
# run of characters and `?` any one, so "*" offers every feature defined in git
# config, including any themes included there. A pattern matches only those,
# not delta's built-in features. A feature is free to restructure the diff
# however it likes: Gitu maps each rendered row back to its patch line from the
# metadata the renderer emits, not from how the row looks.
diff_renderer.features = ["side-by-side", "line-numbers", "plus-minus-markers", "*"]

# Top-level keys that toggle features, run commands or open views (`commands`
# and `views` below), by name. A key already bound at the top level is refused. Feature keys in your
# config replace these, rather than adding to them. In the `renderer_features`
# list, a letter sets the selected feature's or command's key, the same letter
# again unsets it, and Gitu writes them all here.
diff_renderer.feature_keys = { side-by-side = "S", line-numbers = "L" }

# The theme overlaid on your delta configuration, after the features above, as
# `renderer_themes` sets it. A theme is a feature defined in git config that
# sets `dark` or `light`, as delta defines one. `renderer_themes` writes your
# choice to git config's delta-tui section, not here.
# diff_renderer.theme = "my-theme"
# delta's builtin features to offer as themes too, after those in git config,
# e.g. ["diff-so-fancy"].
diff_renderer.builtin_themes = []

# Arguments given to the `git log` Gitu runs for the log view (`l l`, `l o`),
# e.g. a pretty format of your own:
#   log_args = ["--stat", "--pretty=commit-format"]
# A commit is one cursor stop only where the renderer marks it, as delta does
# for rows matching its `commit-regex`. `git log` typed at the command line
# takes git's own config instead (`format.pretty`).
log_args = []

# Arguments given to the `git show` Gitu runs for a commit it opens (enter on a
# commit, `gitu show`), e.g. a pretty format of your own:
#   show_args = ["--pretty=commit-format-full"]
# `git show` typed at the command line takes git's own config instead
# (`format.pretty`).
show_args = []

# What heads each file of a patch, folded or not: the renderer's file header
# ("delta"), or the file's line of a diffstat ("stat"). Gitu counts the stat from the patch rather than asking
# git for one, which would delay the first screen of a large diff. Its columns
# are laid out to fit the files drawn so far, so they can shift once the rest of
# a long diff has arrived.
file_header = "delta"

# Run no command that changes the repository (stage, discard, apply, commit,
# rebase, fetch, ...), and hide them, and save nothing chosen in-session (a
# theme, feature keys, prompt history). "auto" is read-only in a repository jj
# also manages, one with a `.jj` directory, where a git command can contradict
# jj's own state; otherwise true or false.
read_only = "auto"

# Whether a patch of more than one file that does not fit on one screen starts
# with its files folded, in every view of one: `git diff`, `git show`, `git log
# -p`, and a commit opened from the log. A patch still arriving when the first
# screen is drawn is taken not to fit.
start_folded = false

# Shell commands, by name, that a key from `diff_renderer.feature_keys` runs,
# as `renderer_features` lists them. `{commit}`, `{file}` and `{branch}` are
# filled in, quoted for the shell, from what is under the cursor, and
# `{command}` with the git command the screen is showing, as `:` shows it; a
# command using one that is not there is not run. `COLUMNS` and
# `DELTA_FEATURES` are set as gitu sets them for the delta it draws with, so
# that `{command} --color=always | delta` draws as delta draws the screen, but
# without what gitu adds: folds, counted stat rows, hidden files. It runs in
# the repository's root, while gitu stays usable, as a fetch does, and the
# screens are rebuilt when it exits. Its output is not shown; one that fails
# says so, with its exit code.
# In git config:
#   [delta-tui "general.commands"]
#       open-pr = gh pr view --web {commit}
commands = {}

# git commands, by name, that a key from `diff_renderer.feature_keys` opens as
# a screen on top of the one it is pressed on, as enter opens a commit; q goes
# back. Filled in as commands are, but not run by a shell: a view is a `git
# diff`, `git show` or `git log`, run again after each change as `:` runs an
# edited command. `{command}` is a word of its own, standing for the words of
# the git command shown, so that a view can change it. In git config:
#   [delta-tui "general.views"]
#       diff-since = git diff {commit}...
#       word-diff = {command} --word-diff
views = {}

# When to prompt for discard confirmation. Options:
# "line"  - always prompt even for individual lines (default),
# "hunk"  - prompt for files and hunks,
# "file"  - only prompt when discarding whole files,
# "never" - never prompt when discarding.
confirm_discard = "line"

[style]
# fg / bg can be either of:
# - a hex value: "#707070"
# - an ansi color name: "light blue"
# - an ansi color index: "255"
# - "reset" will set the terminal's default foreground / background color.

# 'mods' can be any combination of (multiple values separated by '|'):
# "BOLD|DIM|ITALIC|UNDERLINED|SLOW_BLINK|RAPID_BLINK|REVERSED|HIDDEN|CROSSED_OUT"

# Example style config values:
# section_header = { fg = "#808080" }
# section_header = { bg = "light green", mods = "UNDERLINED|ITALIC" }

separator = { mods = "DIM" }

info_msg = { fg = "green", mods = "BOLD" }
error_msg = { fg = "red", mods = "BOLD" }
command = { fg = "blue", mods = "BOLD" }

menu.heading = { fg = "blue", mods = "BOLD" }
menu.key = { fg = "magenta" }
menu.active_arg = { fg = "light red", mods = "BOLD" }
menu.inactive_arg = {}

prompt = { fg = "cyan", mods = "DIM" }

section_header = { fg = "yellow" }
file_header = { fg = "magenta" }
hunk_header = { fg = "blue" }


picker.prompt = { fg = "cyan" }
picker.info = { mods = "DIM" }
picker.selection_line = { mods = "BOLD" }
picker.matched = { fg = "yellow", mods = "BOLD" }

search_match = { mods = "REVERSED" }

cursor = { symbol = "▌", fg = "blue" }
selection_bar = { symbol = "▌", fg = "blue", mods = "DIM" }
selection_line = { mods = "BOLD" }
# You may want to set `selection_area.bg` to a nice background color.
# Looks horrible with regular terminal colors, so is therefore not set.
selection_area = {}

hash = { fg = "yellow" }

# What the interactive rebase will do with each commit, where that isn't just
# picking it.
rebase_todo.reword = { fg = "blue", mods = "BOLD" }
rebase_todo.edit = { fg = "magenta", mods = "BOLD" }
rebase_todo.squash = { fg = "cyan", mods = "BOLD" }
rebase_todo.fixup = { fg = "yellow", mods = "BOLD" }
rebase_todo.drop = { fg = "red", mods = "BOLD" }

branch = { fg = "green" }
remote = { fg = "red" }
tag = { fg = "yellow" }
author = { fg = "magenta" }
age = { mods = "DIM" }

blame.line_num = { mods = "DIM" }
blame.code_line = { mods = "DIM" }

[bindings]
root.quit = ["q", "esc"]
root.refresh = ["g+r"]
root.suspend = ["ctrl+z"]
# Go to the status screen, leaving the screen gitu was started on underneath.
root.status = ["g+s"]
root.toggle_section = ["tab"]
root.toggle_all_sections = ["shift+tab"]
root.diff_context = ["U"]
# Widen or narrow the context by a power of two: from git's 3, to 4, 8, 16, ...
root.wider_diff_context = ["+"]
root.narrower_diff_context = ["-"]
# Edit the git command the view is the output of, and ask it again.
root.edit_git_command = [":"]
# Drop the file whose header is under the cursor from the view, or say which
# files to show at all: `src !*_test.go` limits the view to src and hides its
# tests.
root.hide_file = ["d"]
root.file_patterns = ["&"]
# As in less, j, k and the arrow keys move a line at a time, through a diff's
# lines too. With ctrl they skip over a diff's lines.
root.move_up_line = ["k", "up"]
root.move_down_line = ["j", "down"]
root.move_up = ["ctrl+k", "ctrl+up"]
root.move_down = ["ctrl+j", "ctrl+down"]
# Reach the selection over a run of diff lines, to stage / unstage / discard /
# reverse them together. It stays within one hunk, which is as far as a single
# patch reaches. Any other movement drops the selection.
root.extend_selection_up = ["shift+up"]
root.extend_selection_down = ["shift+down"]
root.move_prev_section = ["alt+k", "alt+up"]
root.move_next_section = ["alt+j", "alt+down"]
root.move_parent_section = ["alt+h", "alt+left"]
root.half_page_up = ["ctrl+u"]
root.half_page_down = ["ctrl+d"]
root.full_page_up = ["pageup", "backspace"]
root.full_page_down = ["pagedown", "space"]
root.move_top = ["g+g"]
root.move_bottom = ["G"]
root.scroll_view_up = ["ctrl+y"]
root.scroll_view_down = ["ctrl+e"]
root.search = ["/"]
root.search_backward = []
root.search_next = ["n"]
root.search_previous = ["N"]
root.show_refs = ["Y"]
root.show = ["enter", "right"]
root.discard = ["K"]
root.stage = ["s"]
root.unstage = ["u"]
root.apply = ["a"]
root.reverse = ["v"]
root.copy_hash = ["y"]
root.blame = ["B"]
# Enable or disable a renderer feature (side-by-side, line numbers, ...) in place.
# In the list, space enables or disables the selected feature and keeps the list
# open, enter does so and closes it, and a letter sets its key.
root.renderer_features = ["H"]
# Move through delta's themes for the mode it renders in, light or dark,
# rendering the screen with each. A digit switches to the theme of that number,
# 0 being none, so that two can be compared; a theme after the ninth has no
# digit. The list (`picker.toggle_list`) has them all.
root.renderer_themes = ["T"]

picker.next = ["down", "ctrl+n", "tab"]
picker.previous = ["up", "ctrl+p", "shift+tab"]
picker.done = ["enter"]
picker.cancel = ["esc", "ctrl+c"]
# In theme mode, switch between the one row showing the theme on screen and the
# list of every theme, where typing searches them.
picker.toggle_list = ["ctrl+l"]
# Cancel in theme mode's one row, where letters are not typed, and in the
# `renderer_features` list, where a letter sets a key.
picker.quit = ["q"]

root.help_menu = ["h", "?"]
help_menu.quit = ["q", "h", "?", "esc"]

root.branch_menu = ["b"]
branch_menu.checkout = ["b"]
branch_menu.checkout_new_branch = ["c"]
branch_menu.spinoff = ["s"]
branch_menu.rename = ["m"]
branch_menu.delete = ["K"]
branch_menu.quit = ["q", "esc"]

root.commit_menu = ["c"]
commit_menu.--all = ["-a"]
commit_menu.--allow-empty = ["-e"]
commit_menu.--verbose = ["-v"]
commit_menu.--no-verify = ["-n"]
commit_menu.--reset-author = ["-R"]
commit_menu.--signoff = ["-s"]
commit_menu.commit = ["c"]
commit_menu.commit_amend = ["a"]
commit_menu.commit_extend = ["e"]
commit_menu.commit_fixup = ["f"]
commit_menu.commit_instant_fixup = ["F"]
commit_menu.quit = ["q", "esc"]

# The log view opened to choose a commit (by `commit_menu.commit_fixup` and
# `commit_menu.commit_instant_fixup`). Navigation is as in the log view.
commit_picker.select_commit = ["enter"]
commit_picker.move_up = ["k", "up"]
commit_picker.move_down = ["j", "down"]
commit_picker.move_prev_section = ["alt+k", "alt+up"]
commit_picker.move_next_section = ["alt+j", "alt+down"]
commit_picker.move_top = ["g+g"]
commit_picker.move_bottom = ["G"]
commit_picker.half_page_up = ["ctrl+u"]
commit_picker.half_page_down = ["ctrl+d"]
commit_picker.scroll_view_up = ["ctrl+y"]
commit_picker.scroll_view_down = ["ctrl+e"]
commit_picker.toggle_section = ["tab"]
commit_picker.toggle_menu = ["h", "?"]
commit_picker.quit = ["q", "esc"]

root.fetch_menu = ["f"]
fetch_menu.--prune = ["-p"]
fetch_menu.--tags = ["-t"]
fetch_menu.fetch_all = ["a"]
fetch_menu.quit = ["q", "esc"]
fetch_menu.fetch_elsewhere = ["e"]
fetch_menu.fetch_push_remote = ["p"]
fetch_menu.fetch_upstream = ["u"]

root.log_menu = ["l"]
log_menu.log_current = ["l"]
log_menu.log_other = ["o"]
log_menu.quit = ["q", "esc"]
log_menu.-n = ["-n"]
log_menu.--grep = ["-F"]

root.merge_menu = ["m"]
merge_menu.--ff-only = ["-f"]
merge_menu.--no-ff = ["-n"]
merge_menu.merge_abort = ["a"]
merge_menu.merge_continue = ["c"]
merge_menu.merge = ["m"]
merge_menu.quit = ["q", "<esc>"]

root.pull_menu = ["F"]
pull_menu.--rebase = ["-r"]
pull_menu.pull_from_push_remote = ["p"]
pull_menu.pull_from_upstream = ["u"]
pull_menu.pull_from_elsewhere = ["e"]
pull_menu.quit = ["q", "esc"]

root.push_menu = ["P"]
push_menu.--force-with-lease = ["-f"]
push_menu.--force = ["-F"]
push_menu.--no-verify = ["-h"]
push_menu.--dry-run = ["-n"]
push_menu.push_to_push_remote = ["p"]
push_menu.push_to_upstream = ["u"]
push_menu.push_to_elsewhere = ["e"]
push_menu.quit = ["q", "esc"]

root.rebase_menu = ["r"]
rebase_menu.--keep-empty = ["-k"]
rebase_menu.--preserve-merges = ["-p"]
rebase_menu.--committer-date-is-author-date = ["-d"]
rebase_menu.--autosquash = ["-a"]
rebase_menu.--autostash = ["-A"]
rebase_menu.--interactive = ["-i"]
rebase_menu.--no-verify = ["-h"]
rebase_menu.rebase_interactive = ["i"]
rebase_menu.rebase_abort = ["a"]
rebase_menu.rebase_continue = ["c"]
rebase_menu.rebase_elsewhere = ["e"]
rebase_menu.rebase_autosquash = ["f"]
rebase_menu.quit = ["q", "esc"]

# The interactive rebase todo screen (opened by `rebase_menu.rebase_interactive`).
# It has its own keymap: single keys re-mark the selected commit and alt+up /
# alt+down reorder it. Nothing runs until `rebase_todo_start`.
rebase_todo.rebase_todo_pick = ["p"]
rebase_todo.rebase_todo_reword = ["r"]
rebase_todo.rebase_todo_edit = ["e"]
rebase_todo.rebase_todo_squash = ["s"]
rebase_todo.rebase_todo_fixup = ["f"]
rebase_todo.rebase_todo_drop = ["d"]
rebase_todo.rebase_todo_move_up = ["alt+k", "alt+up"]
rebase_todo.rebase_todo_move_down = ["alt+j", "alt+down"]
rebase_todo.rebase_todo_start = ["enter"]
rebase_todo.move_up = ["k", "up"]
rebase_todo.move_down = ["j", "down"]
rebase_todo.move_top = ["g+g"]
rebase_todo.move_bottom = ["G"]
rebase_todo.half_page_up = ["ctrl+u"]
rebase_todo.half_page_down = ["ctrl+d"]
rebase_todo.scroll_view_up = ["ctrl+y"]
rebase_todo.scroll_view_down = ["ctrl+e"]
rebase_todo.toggle_section = ["tab"]
rebase_todo.toggle_menu = ["h", "?"]
# When git is waiting on gitu as its sequence editor, leaving calls
# the rebase off.
rebase_todo.quit = ["q", "esc"]

root.remote_menu=["M"]
remote_menu.add_remote=["a"]
remote_menu.remove_remote=["K"]
remote_menu.rename_remote=["r"]
remote_menu.quit = ["q", "esc"]

root.reset_menu = ["X"]
reset_menu.reset_soft = ["s"]
reset_menu.reset_mixed = ["m"]
reset_menu.reset_hard = ["h"]
reset_menu.quit = ["q", "esc"]

root.revert_menu = ["V"]
revert_menu.--edit = ["-e"]
revert_menu.--no-edit = ["-E"]
revert_menu.--signoff = ["-s"]
revert_menu.revert_abort = ["a"]
revert_menu.revert_continue = ["c"]
revert_menu.revert_commit = ["V"]
revert_menu.quit = ["q", "esc"]

root.cherry_pick_menu = ["A"]
cherry_pick_menu.--no-commit = ["-n"]
cherry_pick_menu.--signoff = ["-s"]
cherry_pick_menu.--edit = ["-e"]
cherry_pick_menu.cherry_pick_abort = ["a"]
cherry_pick_menu.cherry_pick_continue = ["c"]
cherry_pick_menu.cherry_pick = ["A"]
cherry_pick_menu.quit = ["q", "esc"]

root.stash_menu = ["z"]
stash_menu.--all = ["-a"]
stash_menu.--include-untracked = ["-u"]
stash_menu.stash = ["z"]
stash_menu.stash_index = ["i"]
stash_menu.stash_worktree = ["w"]
stash_menu.stash_keep_index = ["x"]
stash_menu.stash_pop = ["p"]
stash_menu.stash_apply = ["a"]
stash_menu.stash_drop = ["k"]
stash_menu.quit = ["q", "esc"]