mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
Add snippet for cycling hunks in current buffer.
Thanks @andys8 :) Closes #667.
This commit is contained in:
16
README.mkd
16
README.mkd
@@ -519,6 +519,22 @@ Let's say, for example, you want to remove trailing whitespace from all changed
|
||||
```
|
||||
|
||||
|
||||
#### Cycle through hunks in current buffer
|
||||
|
||||
This is like `:GitGutterNextHunk` but when it gets to the last hunk in the buffer it cycles around to the first.
|
||||
|
||||
```viml
|
||||
function! GitGutterNextHunkCycle()
|
||||
let line = line('.')
|
||||
silent! GitGutterNextHunk
|
||||
if line('.') == line
|
||||
normal! 1G
|
||||
GitGutterNextHunk
|
||||
endif
|
||||
endfunction
|
||||
```
|
||||
|
||||
|
||||
#### Cycle through hunks in all buffers
|
||||
|
||||
You can use `:GitGutterQuickFix` to load all hunks into the quickfix list or the current window's location list.
|
||||
|
||||
Reference in New Issue
Block a user