1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 01:25:00 +08:00

Updated vim plugins

This commit is contained in:
amix
2017-04-01 13:22:06 +02:00
parent 50ae0a55f6
commit 75beb5f4ba
32 changed files with 704 additions and 238 deletions

View File

@ -427,6 +427,58 @@ Let's say, for example, you want to remove trailing whitespace from all changed
```
#### Cycle through hunks in all buffers
`]c` and `[c` jump from one hunk to the next in the current buffer. You can use this code to jump to the next hunk no matter which buffer it's in.
```viml
function! NextHunkAllBuffers()
let line = line('.')
GitGutterNextHunk
if line('.') != line
return
endif
let bufnr = bufnr('')
while 1
bnext
if bufnr('') == bufnr
return
endif
if !empty(GitGutterGetHunks())
normal! 1G
GitGutterNextHunk
return
endif
endwhile
endfunction
function! PrevHunkAllBuffers()
let line = line('.')
GitGutterPrevHunk
if line('.') != line
return
endif
let bufnr = bufnr('')
while 1
bprevious
if bufnr('') == bufnr
return
endif
if !empty(GitGutterGetHunks())
normal! G
GitGutterPrevHunk
return
endif
endwhile
endfunction
nmap <silent> ]c :call NextHunkAllBuffers()<CR>
nmap <silent> [c :call PrevHunkAllBuffers()<CR>
```
### FAQ
> Why can't I unstage staged changes?