Leave Diff view with Fugitive
Asked Answered
H

1

4

With vim-fugitive,

is there an easy way to "unsplit" and :Gedit (return to the current object in the working tree)?

E.g. when in Gcommit/Gstatus buffers, you would press D to enter side-by-side diff. Now, pressing ZZ would just leave me with a single editor, viewing the fugitive:// side...

To get back to single editor (with the working-tree version I have to do

ZZ:GeditEnter

(or ZZZZ to close both sides).

I'd like to have something like gq as documented under Gblame:

        q     close blame and return to blamed window
        gq    q, then |:Gedit| to return to work tree version
Hypno answered 5/11, 2013 at 13:12 Comment(0)
D
1

As suggested by Tim Pope you can simply close the other window with <C-W><C-O>.

Deductible answered 5/11, 2013 at 13:20 Comment(3)
That would also close the status view, if you started from there: i.sstatic.net/XWowq.png (I'd like to "zap" the LHS of the diff panes, but keep the rest)Hypno
I don't think you have an easy way out on that :SDeductible
Thanks anyway. I guess I'll have to simply nnoremap g<C-q> ZZ:Gedit<CR> thenHypno

© 2022 - 2024 — McMap. All rights reserved.