diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index be7377c..43e8490 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -1810,12 +1810,12 @@ function! fugitive#BufReadStatus() abort call s:Map('n', 'u', ":execute Do('Unstage',0)", '') call s:Map('x', 'u', ":execute Do('Unstage',1)", '') call s:Map('n', 'U', ":exe EchoExec('reset', '-q')", '') - call s:MapEx('gu', "exe StageJump(v:count, 'Untracked', 'Unstaged')") - call s:MapEx('gU', "exe StageJump(v:count, 'Unstaged', 'Untracked')") - call s:MapEx('gs', "exe StageJump(v:count, 'Staged')") - call s:MapEx('gp', "exe StageJump(v:count, 'Unpushed')") - call s:MapEx('gP', "exe StageJump(v:count, 'Unpulled')") - call s:MapEx('gr', "exe StageJump(v:count, 'Rebasing')") + call s:MapMotion('gu', "exe StageJump(v:count, 'Untracked', 'Unstaged')") + call s:MapMotion('gU', "exe StageJump(v:count, 'Unstaged', 'Untracked')") + call s:MapMotion('gs', "exe StageJump(v:count, 'Staged')") + call s:MapMotion('gp', "exe StageJump(v:count, 'Unpushed')") + call s:MapMotion('gP', "exe StageJump(v:count, 'Unpulled')") + call s:MapMotion('gr', "exe StageJump(v:count, 'Rebasing')") call s:Map('n', 'C', ":Gcommit:echohl WarningMsgecho ':Gstatus C is deprecated in favor of cc'echohl NONE", '') call s:Map('n', 'a', ":execute Do('Toggle',0)", '') call s:Map('n', 'i', ":execute NextExpandedHunk(v:count1)", '') @@ -5365,7 +5365,7 @@ function! s:NavigateUp(count) abort return rev endfunction -function! s:MapEx(lhs, rhs) abort +function! s:MapMotion(lhs, rhs) abort call s:Map('n', a:lhs, ":" . a:rhs . "", "") call s:Map('o', a:lhs, ":" . a:rhs . "", "") call s:Map('x', a:lhs, ":exe 'normal! gv'" . a:rhs . "", "") @@ -5406,20 +5406,20 @@ function! fugitive#MapJumps(...) abort endif nnoremap :execute NextItem(v:count1) endif - call s:MapEx('(', 'exe PreviousItem(v:count1)') - call s:MapEx(')', 'exe NextItem(v:count1)') - call s:MapEx('K', 'exe PreviousHunk(v:count1)') - call s:MapEx('J', 'exe NextHunk(v:count1)') - call s:MapEx('[c', 'exe PreviousHunk(v:count1)') - call s:MapEx(']c', 'exe NextHunk(v:count1)') - call s:MapEx('[/', 'exe PreviousFile(v:count1)') - call s:MapEx(']/', 'exe NextFile(v:count1)') - call s:MapEx('[m', 'exe PreviousFile(v:count1)') - call s:MapEx(']m', 'exe NextFile(v:count1)') - call s:MapEx('[[', 'exe PreviousSection(v:count1)') - call s:MapEx(']]', 'exe NextSection(v:count1)') - call s:MapEx('[]', 'exe PreviousSectionEnd(v:count1)') - call s:MapEx('][', 'exe NextSectionEnd(v:count1)') + call s:MapMotion('(', 'exe PreviousItem(v:count1)') + call s:MapMotion(')', 'exe NextItem(v:count1)') + call s:MapMotion('K', 'exe PreviousHunk(v:count1)') + call s:MapMotion('J', 'exe NextHunk(v:count1)') + call s:MapMotion('[c', 'exe PreviousHunk(v:count1)') + call s:MapMotion(']c', 'exe NextHunk(v:count1)') + call s:MapMotion('[/', 'exe PreviousFile(v:count1)') + call s:MapMotion(']/', 'exe NextFile(v:count1)') + call s:MapMotion('[m', 'exe PreviousFile(v:count1)') + call s:MapMotion(']m', 'exe NextFile(v:count1)') + call s:MapMotion('[[', 'exe PreviousSection(v:count1)') + call s:MapMotion(']]', 'exe NextSection(v:count1)') + call s:MapMotion('[]', 'exe PreviousSectionEnd(v:count1)') + call s:MapMotion('][', 'exe NextSectionEnd(v:count1)') endif call s:Map('n', 'S', ':echoerr "Use gO"', '') call s:Map('n', '-', ":exe 'Gedit ' . fnameescape(NavigateUp(v:count1)) if getline(1) =~# '^tree \x\{40,\}$' && empty(getline(2))call search('^'.escape(expand('#:t'),'.*[]~\').'/\=$','wc')endif", '')