delta-gitu 0.1.9

An experimental fork of gitu (a git client inspired by Magit), published as a library for delta to embed
Documentation
# This file contains Gitu's default configuration.
# It is possible to override settings with an equivalent file at:
# `~/.config/gitu/config.toml`

[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 git's wording: 'On 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", "keep-plus-minus-markers"]

# Top-level keys that toggle features, e.g. `{ side-by-side = "x" }`. A key
# already bound at the top level is refused. In the `renderer_features` list, a
# letter sets the selected feature's key, the same letter again unsets it, and
# Gitu writes it here.
diff_renderer.feature_keys = {}

# 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"

# 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

# 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"]
# 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 = ["&"]
root.move_up = ["k", "up"]
root.move_down = ["j", "down"]
root.move_up_line = ["ctrl+k", "ctrl+up"]
root.move_down_line = ["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"]
# Turn a renderer feature (side-by-side, line numbers, ...) on or off in place.
root.renderer_features = ["-"]

picker.next = ["down", "ctrl+n", "tab"]
picker.previous = ["up", "ctrl+p", "shift+tab"]
picker.done = ["enter"]
picker.cancel = ["esc", "ctrl+c"]

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"]