Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Git View

The heart of vig: a side-by-side diff of your working directory against a base of your choosing. Four panes across the top and main area:

  • Files — the changed files as a tree, with status indicators (A added, D deleted, M modified, R renamed, ? untracked).
  • Branches — every local branch, with a git log preview of the selected one in the main area.
  • Reflog — the repository’s reflog entries.
  • Diff / Git Log — the main area: the side-by-side diff with syntax highlighting, or the log preview while you browse branches or the reflog.

The view watches the working directory and refreshes the diff automatically when files change; r refreshes by hand. e opens the selected file in $EDITOR.

Moving between panes

KeyAction
Tab / Shift+TabCycle panes: Files → Branches → Reflog → GitLog → Diff
h / lMove between adjacent upper panes (Files, Branches, Reflog)
iJump from upper pane to main pane (GitLog / Diff)
EscReturn from main pane to previous upper pane

And within a pane:

KeyAction
j / kScroll down / up
h / lScroll left / right (in Diff view)
ggJump to top
GJump to bottom
Ctrl+d / Ctrl+uHalf page down / up

Branch list

Selecting a branch previews its git log in the main area. Enter opens the action menu — the only place in vig that writes to the repository, and it offers exactly three things: switch to the branch (git switch), delete it safely (git branch -d; git refuses if it is unmerged — vig never uses -D), or set it as the diff base so the diff pane compares your working directory against it.

KeyAction
j / kNavigate branches (git log preview updates)
EnterAction menu (switch / delete / set as diff base)
/Search branches
EscClear search / Reset comparison to HEAD

Git log

The log preview in the main area is itself navigable: walk the commits, yank a hash, or jump to the commit on GitHub.

KeyAction
j / kNavigate commits
Ctrl+d / Ctrl+uHalf page scroll
g / GTop / Bottom
yCopy commit hash
YCopy commit URL
oOpen in GitHub
/Search commits
EscClear search / Back to Branch List

Reflog

The reflog pane makes “what did I just do?” diffable: select any reflog entry and Enter sets it as the diff base, so the main pane shows what changed since that state.

KeyAction
j / kNavigate entries
Ctrl+d / Ctrl+uHalf page scroll
g / GTop / Bottom
EnterSet as diff base
/Search reflog
EscClear search / Back to Branches

The diff pane: modes

The diff pane starts in Scroll mode, where j / k / h / l scroll. Press i for Normal mode, which gives you a character cursor and vim motions — from there v and V start selections, exactly like in a vim buffer.

KeyAction
iEnter Normal mode
vVisual mode (character)
VVisual-Line mode
EscBack to Scroll mode

Yank (copy)

In Normal / Visual mode, yanks go to the system clipboard:

KeyAction
yyYank line
yw / ye / ybYank word / end of word / word back
y$ / y0Yank to end / start of line
y (in Visual)Yank selection

Text objects are also supported: iw, aw, i", a", i(, a(, i{, a{

KeyAction
/Start search
nNext match
NPrevious match

Search works in all panes (DiffView, FileTree, CommitLog, Reflog) and is case-insensitive.

Constraints

  • The action menu’s git switch and git branch -d are the only write operations in all of vig. There is no staging, committing, merging, rebasing, pushing, or force-deleting — by design, not by omission.
  • The diff always has your working directory on one side; the base (HEAD, a branch, or a reflog entry) is what you choose on the other.