1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 17:30:04 +08:00
SpaceVim/docs/layers/VersionControl.md

70 lines
2.0 KiB
Markdown
Raw Normal View History

2018-03-12 21:00:24 +08:00
---
title: "SpaceVim VersionControl layer"
2021-06-21 20:39:29 +08:00
description: "This layer provides general version control features for SpaceVim. It should work with all VC backends such as Git, Mercurial, Bazaar, SVN, etc"
2018-03-12 21:00:24 +08:00
---
2018-06-23 14:37:41 +08:00
# [Available Layers](../) >> VersionControl
2018-03-12 21:00:24 +08:00
<!-- vim-markdown-toc GFM -->
2018-06-23 14:37:41 +08:00
- [Description](#description)
2018-03-12 21:00:24 +08:00
- [Features](#features)
2018-06-23 14:37:41 +08:00
- [Install](#install)
2019-01-27 16:55:50 +08:00
- [Layer options](#layer-options)
2018-03-12 21:00:24 +08:00
- [Key bindings](#key-bindings)
<!-- vim-markdown-toc -->
2018-06-23 14:37:41 +08:00
## Description
2018-03-12 21:00:24 +08:00
2021-06-21 20:39:29 +08:00
This layer provides general functions for version control. It should work with all VC backends such as Git, Mercurial, Bazaar, SVN, etc.
2018-03-12 21:00:24 +08:00
## Features
- Show a diff using Vim its sign column
- Show vcs info on statusline
2018-06-23 14:37:41 +08:00
## Install
To use this configuration layer, update custom configuration file with:
```toml
[[layers]]
name = "VersionControl"
```
2019-01-27 16:55:50 +08:00
## Layer options
2021-06-21 20:39:29 +08:00
`enable-gtm-status`: Enable displaying time spent within SpaceVim's statusline. This feature needs [gtm](https://github.com/git-time-metric/gtm) command to be installed.
2019-01-27 16:55:50 +08:00
2018-03-12 21:00:24 +08:00
## Key bindings
| Key Binding | Description |
| ----------- | ------------------------------- |
| `SPC g .` | version control transient-state |
**Version Control Transient-state**
| Key Binding | Description |
| ----------- | ---------------------------- |
| `w` | Stage file |
| `u` | Unstage file |
| `n` | next hunk |
| `N/p` | previous hunk |
| `t` | toggle diff signs |
| `l` | Show repo log |
| `D` | Show diffs of unstaged hunks |
| `f` | Fetch for repo with popup |
| `F` | Pull repo with popup |
| `P` | Push repo with popup |
| `c` | Commit with popup |
| `C` | Commit |
**Unimpaired bindings**
| Key Binding | Description |
| ----------- | --------------------------- |
| `[ c` | Go to the previous vcs hunk |
| `] c` | Go to the next vcs hunk |