1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 20:00:05 +08:00
SpaceVim/docs/layers/git.md

59 lines
1.5 KiB
Markdown
Raw Normal View History

2017-09-28 23:31:50 +08:00
---
title: "SpaceVim git layer"
2021-06-21 20:39:29 +08:00
description: "This layer adds extensive support for git"
2017-09-28 23:31:50 +08:00
---
2018-06-23 14:37:41 +08:00
# [Available Layers](../) >> git
2017-09-28 23:31:50 +08:00
<!-- vim-markdown-toc GFM -->
- [Description](#description)
- [Install](#install)
- [Layer options](#layer-options)
2017-09-28 23:31:50 +08:00
- [Key bindings](#key-bindings)
<!-- vim-markdown-toc -->
## Description
2021-06-21 20:39:29 +08:00
This layer adds extensive support for [git](https://git-scm.com/).
2017-09-28 23:31:50 +08:00
## Install
2021-06-21 20:39:29 +08:00
To use this configuration layer, add the following snippet to your custom configuration file (`SPC f v d`).
2017-09-28 23:31:50 +08:00
```toml
[[layers]]
name = "git"
```
2017-09-28 23:31:50 +08:00
## Layer options
- `git_plugin`: default value is `git`, available values include: [`gina`](https://github.com/lambdalisue/gina.vim), [`fugitive`](https://github.com/tpope/vim-fugitive), [`gita`](https://github.com/lambdalisue/vim-gita) (obsolete), `git`.
2021-04-11 14:13:57 +08:00
if you want to use `fugitive` instead:
```toml
[[layers]]
name = "git"
git_plugin = 'fugitive'
```
2017-09-28 23:31:50 +08:00
## Key bindings
| Key Binding | Description |
| ----------- | ---------------------- |
| `SPC g s` | view git status |
| `SPC g S` | stage current file |
| `SPC g U` | unstage current file |
| `SPC g c` | edit git commit |
| `SPC g p` | git push |
2020-05-25 23:42:26 +08:00
| `SPC g m` | git branch manager |
2024-02-21 17:03:50 +08:00
| `SPC g r` | git remote manager |
| `SPC g d` | view git diff |
| `SPC g A` | stage all files |
| `SPC g b` | open git blame windows |
| `SPC g h a` | stage current hunk |
| `SPC g h r` | undo cursor hunk |
| `SPC g h v` | preview cursor hunk |