nvim: functions: Drop functions for cycling through all hunks in all buffers

We can just call GitGutterQuickFix and then cycle through all hunks. No
need for this.

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
Sanchayan Maity 2020-05-19 14:34:42 +05:30
parent 491ffb9bee
commit 7875f6d8ab
2 changed files with 0 additions and 45 deletions

View file

@ -2,49 +2,6 @@ function! NvimGdbNoTKeymaps()
tnoremap <silent> <buffer> <Esc> <C-\><C-n> tnoremap <silent> <buffer> <Esc> <C-\><C-n>
endfunction endfunction
" Taken from gitgutter README. Cycles through all hunks in all open buffers.
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())
1
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
function! GotoJump() function! GotoJump()
jumps jumps
let j = input("Please select your jump: ") let j = input("Please select your jump: ")

View file

@ -81,8 +81,6 @@ nnoremap <Leader>g+ :Gina stash<SPACE>
" For gitgutter " For gitgutter
nnoremap ]h :GitGutterNextHunk<CR> nnoremap ]h :GitGutterNextHunk<CR>
nnoremap [h :GitGutterPrevHunk<CR> nnoremap [h :GitGutterPrevHunk<CR>
nnoremap ]c :call NextHunkAllBuffers()<CR>
nnoremap [c :call PrevHunkAllBuffers()<CR>
nnoremap <Leader>sh :GitGutterStageHunk<CR> nnoremap <Leader>sh :GitGutterStageHunk<CR>
nnoremap <Leader>uh :GitGutterUndoHunk<CR> nnoremap <Leader>uh :GitGutterUndoHunk<CR>
nnoremap <Leader>ph :GitGutterPreviewHunk<CR> nnoremap <Leader>ph :GitGutterPreviewHunk<CR>