Configure Source control layersλ︎
Recommended layers to add source control support:
git- provides Magit, a feature rich git client that is easy to use
github- access GitHub / GitLab APIs to access and create issues, pull requests, etc.
version-control- general features including diff highlights in the window fringe
Add layers to .spacemacs configurationλ︎
SPC f e d opens the
.spacemacs configuration file (
M-m f e d Emacs state)
SPC s s and start typing
configuration-layers to search for the
RTN to jump to the highlighted line,
C-j to move down the matching lines,
C-k to move up.
Add the following configuration to provide the recommended setup.
The layers and variables are explained in their own sections below.
git provides the Magit, a rich Git client that does everything a command line client can do.
git-magit-status-fullscreen opens Magit status (
SPC g s) in a full frame window,
q restores previous window layout. Fullscreen is easier to read the diff of a commit will plenty of space to enter a commit messages.
magit-diff-refine-hunk configures diffs show the specific word changes when a hunk is active, making it easier to spot the exact changes.
git-enable-magit-todos-plugin lists matching TODO lines from the current project in the Magit Status buffer, helping work and issues be tracked
Ensure you follow the Git Configuration steps required for this layer.
version-control layer highlights changes in the fringe of a buffer and a vcs transient state to quickly navigate through changes (hunks).
version-control-diff-tool uses diff-hl to highlight file change against local commits, with markers appearing in the fringe.
version-control-global-margin enables highlighting changes in all buffers automatically.