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 2b9faa8c7fb90ac89b4b78a5017807d74bcf3e2a (tree)
parent 562ab96b2ff1f277b04e413d06df38208a98ae33
Author: Tim Pope <code@tpope.net>
Date:   Sun, 25 Jul 2010 22:38:10 -0400

Press dh in :Gstatus to do a horizontal diff

Diffstat:
Mdoc/fugitive.txt | 7++++---
Mplugin/fugitive.vim | 12+++++++-----
2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/doc/fugitive.txt b/doc/fugitive.txt @@ -52,9 +52,10 @@ that are part of Git repositories). *fugitive-:Gstatus* :Gstatus Bring up the output of git-status in the preview window. Press D to |:Gdiff| the file on the cursor - line. Press - to stage or unstage the file on the - cursor line. Press p to do so on a per hunk basis - (--patch). Press C to invoke |:Gcommit|. + line, or dh to |:Gdiff!|. Press - to stage or unstage + the file on the cursor line. Press p to do so on a + per hunk basis (--patch). Press C to invoke + |:Gcommit|. *fugitive-:Gcommit* :Gcommit [args] A wrapper around git-commit. If there is nothing diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim @@ -538,7 +538,7 @@ function! fugitive#reload_status() abort endfor endfunction -function! s:StageDiff() abort +function! s:StageDiff(bang) abort let section = getline(search('^# .*:$','bnW')) let line = getline('.') let filename = matchstr(line,'^#\t\%([[:alpha:] ]\+: *\)\=\zs.*') @@ -549,13 +549,13 @@ function! s:StageDiff() abort elseif line =~# '^#\trenamed:' && filename =~ ' -> ' let [old, new] = split(filename,' -> ') execute 'Gedit '.s:fnameescape(':0:'.new) - return 'Gdiff HEAD:'.s:fnameescape(old) + return 'Gdiff'.a:bang.' HEAD:'.s:fnameescape(old) elseif section == '# Changes to be committed:' execute 'Gedit '.s:fnameescape(':0:'.filename) - return 'Gdiff -' + return 'Gdiff'.a:bang.' -' else execute 'Gedit '.s:fnameescape('/'.filename) - return 'Gdiff' + return 'Gdiff'.a:bang endif endfunction @@ -1377,7 +1377,9 @@ function! s:BufReadIndex() setlocal ro noma nomod nomodeline bufhidden=delete nnoremap <buffer> <silent> a :<C-U>let b:fugitive_display_format += 1<Bar>exe <SID>BufReadIndex()<CR> nnoremap <buffer> <silent> i :<C-U>let b:fugitive_display_format -= 1<Bar>exe <SID>BufReadIndex()<CR> - nnoremap <buffer> <silent> D :<C-U>execute <SID>StageDiff()<CR> + nnoremap <buffer> <silent> D :<C-U>execute <SID>StageDiff('')<CR> + nnoremap <buffer> <silent> dd :<C-U>execute <SID>StageDiff('')<CR> + nnoremap <buffer> <silent> dh :<C-U>execute <SID>StageDiff('!')<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> p :<C-U>execute <SID>StagePatch(line('.'),line('.')+v:count1-1)<CR>