**Website:** https://github.com/airblade/vim-gitgutter
vim-gitgutter makes it easy to see any unstaged changes in [[vim]], to jump between unstaged hunks, and to manage staging without leaving the editor.
# Key Bindings
Some useful key bindings to know:
| Key | Description |
| ------------ | ------------------------------------------------------------------------------------------------- |
| `<Leader>hs` | Stage the current hunk |
| `<Leader>hu` | Undo staging the previously-staged hunk |
| `<Leader>hp` | Copy the current hunk into a previous window for patch-level staging (equivalent to `git add -p`) |
# My Configuration
Here's the configuration I use:
```vim
" Remove any special theme highlighting for the column, so it doesn't
" conflict with vim-gitgutter.
highlight clear SignColumn
" Jump between unstaged hunks using ]h (next) and [h (previous).
nmap ]h <Plug>(GitGutterNextHunk)
nmap [h <Plug>(GitGutterPrevHunk)
```
# Staging Hunks
To stage an individual hunk, place the cursor somewhere within the hunk and type `<Leader>hs` (e.g., `\hs`).
To do patch-level staging of hooks (letting you clearly modify which lines should be staged), press `<Leader>hp`. This will open the hunk in another buffer. From here, delete any lines that should _not_ be staged and then `:w` to `<Leader>hs` to stage. All other lines will be staged.