Stage and revert individual hunks.

This commit is contained in:
Andy Stewart
2014-01-08 17:07:06 +01:00
parent 7ce6309a01
commit 92abcce1ff
4 changed files with 136 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
## Vim Git Gutter
A Vim plugin which shows a git diff in the 'gutter' (sign column). It shows whether each line has been added, modified, and where lines have been removed.
A Vim plugin which shows a git diff in the 'gutter' (sign column). It shows whether each line has been added, modified, and where lines have been removed. You can also stage and revert individual hunks.
### Screenshot
@@ -65,6 +65,18 @@ nmap gh <Plug>GitGutterNextHunk
nmap gH <Plug>GitGutterPrevHunk
```
When your cursor is in a hunk, you can:
* stage the hunk with `<Leader>hs` or
* revert it with `<Leader>hr`.
To set your own mappings for these, for example if you prefer the mnemonics hunk-add and hunk-undo:
```viml
nmap <Leader>ha <Plug>GitGutterStageHunk
nmap <Leader>hu <Plug>GitGutterRevertHunk
```
Finally, you can force vim-gitgutter to update its signs across all visible buffers with `:GitGutterAll`.
See the customisation section below for how to change the defaults.