This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+source-control/version-control
Ken Wu fb3f548fe8 Fix bugs when version-control-diff-tool = diff-hl
The original code is confused by diff-hl-mode and diff-hl-margin-mode.
This modification fixes all typos due to the confusion.
2016-01-23 17:21:13 +01:00
..
config.el Clean copyrights and update for year 2016 2016-01-11 21:42:17 -05:00
funcs.el Fix bugs when version-control-diff-tool = diff-hl 2016-01-23 17:21:13 +01:00
keybindings.el Clean copyrights and update for year 2016 2016-01-11 21:42:17 -05:00
packages.el Clean copyrights and update for year 2016 2016-01-11 21:42:17 -05:00
README.org Update install layer section in REAMDE.org files 2016-01-06 00:21:55 -05:00

Version-Control layer

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:

Feature diff-hl git-gutter git-gutter+
Show in fringe X X X
Extended VCS support (e.g. hg, svn) X X
Stage hunks from buffer X X
Dired support X

Key Bindings

Key Binding Description
SPC g . version control micro-state
SPC T d toggle diff margins
SPC T C-d toggle diff margins globally

Version Control Micro-state

Key Binding Description
SPC g . h Show diff of hunk
SPC g . n Next hunk
SPC g . N Previous hunk
SPC g . p Previous hunk
SPC g . r Revert hunk
SPC g . s Stage hunk
SPC g . t Toggle margin indicators
SPC g . w Stage file
SPC g . u Unstage file
SPC g . d Repo diff popup
SPC g . D Show diffs of unstaged hunks
SPC g . c Commit with popup
SPC g . C Commit
SPC g . P Push repo with popup
SPC g . f Fetch for repo with popup
SPC g . F Pull repo with popup
SPC g . l Show repo log