Skip to content

Latest commit

 

History

History
89 lines (74 loc) · 3.46 KB

File metadata and controls

89 lines (74 loc) · 3.46 KB

Version-Control layer

Table of Contents

Description

This layers adds general configuration for Emacs VC. It should work with all VC backends such as Git, Mercurial, Bazaar, SVN, etc…

Features

  • highlights uncommitted changes in the fringe or margin with diff-hl,

git-gutter, or git-gutter+

  • adds vcs micro-state SPC g. to allow quick navigation and modification of

buffer hunks.

Install

Layer

To use this configuration layer, add it to your ~/.spacemacs. You will need to add version-control to the existing dotspacemacs-configuration-layers list in this file.

Configuration

You can choose the package to facilitate the diff micro-state and show margins by setting version-control-diff-tool

'(version-control :variables
                  version-control-diff-tool 'diff-hl)

To automatically enable diff margins in all buffers, set version-control-global-margin

'(version-control :variables
                  version-control-global-margin t)

Differences between margin programs

This layer contains generalized mappings for three diff margin packages: diff-hl, git-gutter, and git-gutter+.

There are some differences between packages that might have some people prefer one over the other:

Featurediff-hlgit-guttergit-gutter+
Show in fringeXXX
Extended VCS support (e.g. hg, svn)XX
Stage hunks from bufferXX
Dired supportX

Key Bindings

Key BindingDescription
SPC g .version control micro-state
SPC T dtoggle diff margins
SPC T C-dtoggle diff margins globally

Version Control Micro-state

Key BindingDescription
SPC g . hShow diff of hunk
SPC g . nNext hunk
SPC g . NPrevious hunk
SPC g . pPrevious hunk
SPC g . rRevert hunk
SPC g . sStage hunk
SPC g . tToggle margin indicators
SPC g . wStage file
SPC g . uUnstage file
SPC g . dRepo diff popup
SPC g . DShow diffs of unstaged hunks
SPC g . cCommit with popup
SPC g . CCommit
SPC g . PPush repo with popup
SPC g . fFetch for repo with popup
SPC g . FPull repo with popup
SPC g . lShow repo log