Customization

May 15, 2025 · View on GitHub

Table of Contents

Usage

The tool can be customized using the git config command. String values are case-insensitive.

Example

git config --global interactive-rebase-tool.foregroundColor black

Git Configuration

Some values from your Git Config are directly used by this application.

KeyDescription
core.commentCharUsed when reading the TODO file to excluded commented lines
core.editorUsed when deciding what editor to open when trigger the external editor
diff.contextUsed by show commit when generating a diff
diff.interHunkContextUsed by show commit when generating a diff
diff.renameLimitUsed by show commit when generating a diff
diff.renamesUsed by show commit when generating a diff

General

KeyDefaultTypeDescription
autoSelectNextfalseboolIf true, auto select the next line after action modification
diffIgnoreBlankLinesnoneString¹If to ignore blank lines during diff.
diffIgnoreWhitespacenoneString¹If and how to ignore whitespace during diff.
diffShowWhitespacebothString²If and how to show whitespace during diff.
diffSpaceSymbol·StringThe visible symbol for the space character. Only used when diffShowWhitespace is enabled.
diffTabSymbolStringThe visible symbol for the tab character. Only used when diffShowWhitespace is enabled.
diffTabWidth4IntegerThe width of the tab character
undoLimit5000IntegerNumber of undo operations to store.
postModifiedLineExecCommandStringExec command to attach to modified lines. See modified line exec command for details.
verticalSpacingCharacter~StringVertical spacing character. Can be set to an empty string.

¹ Ignore whitespace can be:

  • change to ignore changed whitespace in diffs, same as the --ignore-space-change flag
  • true, on or all to ignore all whitespace in diffs, same as the --ignore-all-space flag
  • false, off, none to not ignore whitespace in diffs

² Show whitespace can be:

  • leading to show leading whitespace only
  • trailing to show trailing whitespace only
  • true, on or both to show both leading and trailing whitespace
  • false, off, none to show no whitespace

Colors

The valid colors are the eight original 8 ANSI colors. They are black, blue, cyan, green, magenta, red, white and yellow. Dimmed versions of the 8 ANSI colors can be used by prefixing the color with dark, for example dark red. Each terminal controls the exact color for these color names. On terminals that support 256 colors, a color triplet with the format <red>,<green>,<blue> can be used. Each color has a range of 0 to 255 with 255, 255, 255 resulting in white and 0,0,0 resulting in black. A value of -1 or transparent can be used to use the default terminal color.

KeyDefaultTypeDescription
backgroundColorDefault¹ColorColor used for the background
breakColorwhiteColorColor used for the break action
diffAddColorgreenColorColor used for lines and files added in a diff
diffChangeColoryellowColorColor used for lines and files changed in a diff
diffContextColorwhiteColorColor used for context in a diff
diffRemoveColorredColorColor used for lines and files removed in a diff
diffWhitespaceblackColorColor used for whitespace in a diff
dropColorredColorColor used for the drop action
editColorblueColorColor used for the edit action
execColorblueColorColor used for the exec action
fixupColormagentaColorColor used for the fixup action
foregroundColorDefault¹ColorColor used for most text and the UI
indicatorColorcyanColorColor used for text the indicates or needs to standout
labelColordark yellowColorColor used for the label action
mergeColordark yellowColorColor used for the merge action
pickColorgreenColorColor used for the pick action
resetColordark yellowColorColor used for the reset action
rewordColoryellowColorColor used for the reword action
selectedBackgroundColor35,35,40ColorColor used as the background color for the selected line
squashColorcyanColorColor used for the squash action
updateRefColordark magentaColorColor used for the update-ref action

¹ By default the foreground and background colors use the terminal defined colors

Key Bindings

Most keys can be changed to any printable character or supported special character. It is possible to provide conflicting bindings, which will result in undefined behavior. The inputConfirmYes binding has a special behavior in that it responds to both the uppercase and lowercase letter of the value set, if the variant exist.

KeyDefaultTypeDescription
inputAbortqStringKey for abort rebase with prompt
inputActionBreakbStringKey for setting action to rebase
inputActionDropdStringKey for setting action to drop
inputActionEditeStringKey for setting action to edit
inputActionFixupfStringKey for setting action to fixup
inputActionPickpStringKey for setting action to pick
inputActionRewordrStringKey for setting action to reword
inputActionSquashsStringKey for setting action to squash
inputConfirmNonStringKey for rejecting a confirmation
inputConfirmYesyStringKey for confirming a confirmation
inputEditEStringKey for entering edit mode
inputForceAbortQStringKey for forcing an abort of the rebase
inputForceRebaseWStringKey for forcing a rebase
inputHelp?StringKey for showing the help
inputInsertLineIStringKey for inserting a new line
inputDuplicateLineControl+dStringKey for duplicating the selected line
inputMoveDownDownStringKey for moving the cursor down
inputMoveEndEndStringKey for moving the cursor to the end of the list
inputMoveHomeHomeStringKey for moving the cursor to the top of the list
inputMoveLeftLeftStringKey for moving the cursor left
inputMoveRightRightStringKey for moving the cursor right
inputMoveSelectionDownjStringKey for moving the selected line(s) down
inputMoveSelectionUpkStringKey for moving the selected line(s) up
inputMoveStepDownPageDownStringKey for moving the cursor down by a large step
inputMoveStepUpPageUpStringKey for moving the cursor up by a large step
inputMoveUpUpStringKey for moving the cursor up
inputOpenInExternalEditor!StringKey for opening the external editor
inputRebasewStringKey for rebasing with confirmation
inputRedoControl+yStringKey for redoing the previous undone change
inputRemoveLineDeleteStringKey for removing selected commits
inputScrollDownDownStringKey for scrolling the view down
inputScrollEndEndStringKey for scrolling the view to the bottom
inputScrollHomeHomeStringKey for scrolling the view to the top
inputScrollLeftLeftStringKey for scrolling the view to the left
inputScrollRightRightStringKey for scrolling the view to the right
inputScrollStepDownPageDownStringKey for scrolling the view one step down
inputScrollStepUpPageUpStringKey for scrolling the view one step up
inputScrollUpUpStringKey for scrolling the view to the up
inputShowCommitcStringKey for showing the overview of the selected commit
inputShowDiffdStringKey for showing the diff of the selected commit
inputToggleVisualModevStringKey for toggling visual mode
inputUndoControl+zStringKey for undoing the previous change

Example

# single value
git config --global interactive-rebase-tool.inputRebase S
# multiple values
git config --global interactive-rebase-tool.inputRebase "S L K"

Supported Special Keys

Keys that do not have easily printable characters, such as the arrow keys, are set using the special values defined in the table below. Some special keys do not work correctly on some setups.

KeyDescription
BackTabBack tab key
BackspaceBackspace key
DeleteDelete key
DownDown arrow key
EndEnd key
EnterEnter key
EscEscape key
F{1..255}Function X key
HomeHome key
InsertInsert key
LeftLeft arrow key
PageDownPage down key
PageUpPage up key
RightRight arrow key
TabTab key
UpUp arrow key

Modifier Keys

Most bindings can be prefixed with Shift, Control or Alt, followed by a +. These bindings can also be combined in any order, for example Alt+Control+Delete. Shift combined with any ASCII alphabetical character will not work, and the uppercase character must be used instead.

Multiple Key Bindings

A single action can have multiple bindings by providing a whitespace separate list of keys. For example the binding, "u Control+z Control+Z" would respond to a keypress of a, Control z and Control Z.

Restricted Keys

Some key combinations are restricted as they have special meaning. They are:

KeyDescription
Control+cImmediately aborts the program without writing the rebase todo file to disk

External Editor

The external editor action will first attempt to start the editor defined by the Git configuration "core.editor", followed by the VISUAL and EDITOR environment variables. Finally, if neither is set, the external editor defaults to using vi.

The % character in the value will be replaced with the rebase todo file. If the % character is not found, then the git rebase todo file will be provided as the last argument.