Add snippet for cycling hunks in current buffer.

Thanks @andys8 :)

Closes #667.
This commit is contained in:
Andy Stewart
2019-11-25 12:12:49 +00:00
parent fa8d0feb41
commit bced2175f8

View File

@@ -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 #### 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. You can use `:GitGutterQuickFix` to load all hunks into the quickfix list or the current window's location list.