Skip to content
/
Try

Git in Skink: diff, stage hunks, blame, commit, branches

Next change, peek and stage, the git panel, blame.

Skink shows git changes next to the line numbers and lets you stage, revert, commit and switch branches without leaving the editor.

Press Alt+Shift+C for the git panel, Alt+Shift+D to peek at the change under the cursor, and :diff to compare the file side by side.

Next to the line numbers, compared with the index:

  • Green bar: added lines
  • Blue bar: modified lines
  • Red mark: deleted lines
  • Dotted bar: a change that is already staged

The scrollbar (the editor’s last column) shows the same marks for the whole file.

Turn them off with "gitgutter": false.

Key Command Does
Alt+Shift+N :nexthunk Next change
Alt+Shift+P :prevhunk Previous change
Alt+Shift+D :hunk Peek at the change: s stage, u unstage, r revert, Esc
Alt+Shift+S :stagehunk Stage the change at the cursor
:unstagehunk Unstage it
:reverthunk Put the index version back

Clicking a gutter mark opens the same peek. Reverting is a normal edit, so Ctrl+Z undoes it.

  • Inline blame: the faded author, date and summary at the end of the cursor line. On by default.
    • Alt+Shift+B (:inlineblame) toggles it.
    • "inlineblame": false turns it off for good.
  • :blame: the whole file’s blame in a tab. Enter on a line shows that commit.
Command Shows
:diff This file side by side against the index
:diff HEAD This file against the last commit
:diff all git diff of the whole tree, in a tab

Alt+Shift+C (or :gitstatus, :status) opens the panel. In it:

Key Does
Enter Open the file
s / u Stage / unstage the file
S / U Stage / unstage all
d Discard changes (asks first; untracked files go to the trash)
c Commit
C Amend
b Branches
z / Z Stash / list stashes
g Refresh
P / p / f Push / pull / fetch

Push, pull and fetch run in a terminal tab, so git asks for passwords, passphrases and keys itself.

Skink never handles your credentials.

  • :commit MESSAGE commits with that message.
  • :commit alone opens a message tab. Write the message and save it (Ctrl+S) to commit. Closing the tab cancels.
  • In the message tab, :amend toggles amending the last commit and :signoff toggles a Signed-off-by line.

To use Skink for git commit run from a shell too, see Use Skink as your $EDITOR.

:stage [PATH] and :unstage [PATH] work on the current file or PATH.

Command Does
:branches List local branches. Enter switches, D deletes (asks first)
:branch NAME Create NAME and switch to it
:switch NAME (:checkout) Switch to a branch
:stash [MESSAGE] Stash the current changes
:stashes List stashes. Enter applies, p pops, D drops
:push, :pull, :fetch [ARGS] In a terminal tab
:git ARGS Run any git command, output in a tab
Command Does
:conflicts Open every conflicted file at its first marker
:nextconflict / :prevconflict Move between conflict blocks
:ours / :theirs / :both Resolve the block under the cursor

Conflict blocks are tinted: ours green, theirs blue.

The first line of each block shows “Accept ours | theirs | both”, and you can click one. Every resolution is undoable.

File names are coloured by status:

  • modified: yellow
  • added: green
  • untracked: teal
  • conflicted: red
  • ignored: grey

A folder takes the colour of its most serious file.

Skink runs your installed git for these features, so it needs git on your PATH.