motiejus/dotfiles

Unnamed repository; edit this file 'description' to name the repository.
git clone https://git.jakstys.lt/motiejus/dotfiles.git
Log | Tree | Refs | README | LICENSE

commit 8d019de97c2ea4b0fdb17cb785192be4e81e55e9 (tree)
parent b5725c1eec2f596a8e1f6295a4640b2392e5e550
Author: Tim Pope <code@tpope.net>
Date:   Fri,  7 Sep 2012 01:07:54 -0400

Accept a count with :Gstatus <C-N>/<C-P>

Diffstat:
Mplugin/fugitive.vim | 18++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim @@ -698,6 +698,20 @@ function! s:stage_info(lnum) abort endif endfunction +function! s:StageNext(count) + for i in range(a:count) + call search('^#\t.*','W') + endfor + return '.' +endfunction + +function! s:StagePrevious(count) + for i in range(a:count) + call search('^#\t.*','Wbe') + endfor + return '.' +endfunction + function! s:StageReloadSeek(target,lnum1,lnum2) let jump = a:target let f = matchstr(getline(a:lnum1-1),'^#\t\%([[:alpha:] ]\+: *\)\=\zs.*') @@ -2000,8 +2014,8 @@ function! s:BufReadIndex() call s:JumpInit() nunmap <buffer> P nunmap <buffer> ~ - nnoremap <buffer> <silent> <C-N> :call search('^#\t.*','W')<Bar>.<CR> - nnoremap <buffer> <silent> <C-P> :call search('^#\t.*','Wbe')<Bar>.<CR> + nnoremap <buffer> <silent> <C-N> :<C-U>execute <SID>StageNext(v:count1)<CR> + nnoremap <buffer> <silent> <C-P> :<C-U>execute <SID>StagePrevious(v:count1)<CR> nnoremap <buffer> <silent> - :<C-U>execute <SID>StageToggle(line('.'),line('.')+v:count1-1)<CR> xnoremap <buffer> <silent> - :<C-U>execute <SID>StageToggle(line("'<"),line("'>"))<CR> nnoremap <buffer> <silent> a :<C-U>let b:fugitive_display_format += 1<Bar>exe <SID>BufReadIndex()<CR>