Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: open Gstatus in new tab #727

Closed
rhardih opened this issue Dec 4, 2015 · 14 comments
Closed

Feature request: open Gstatus in new tab #727

rhardih opened this issue Dec 4, 2015 · 14 comments

Comments

@rhardih
Copy link

rhardih commented Dec 4, 2015

Sometimes it's nice to have a little more vertical space to deal with preparing commits and in those cases opening Gstatus as a new tab would be nice to have.

I've tried to "promote" the window to a new tab, by either Ctrl-W_T or :tabedit %, but in both cases the navigation bindings are lost and e.g. Ctrl-d results in an error:

E486: Pattern not found: context

@tpope
Copy link
Owner

tpope commented Dec 5, 2015

Huh? Ctrl-d isn't mapped in fugitive. Either of those should work fine, or :Gtabedit :.

@rhardih
Copy link
Author

rhardih commented Dec 5, 2015

What a brainfart on my part. 😞 It totally does work. 👍, don't know how that d got in there, as I was obviously thinking of Ctrl-{n,p}.

Closing 😁

@rhardih rhardih closed this as completed Dec 5, 2015
@ipod825
Copy link

ipod825 commented Aug 1, 2016

either
autocmd BufEnter *.git/index if &ft == 'gitcommit' | wincmd T | endif
or
autocmd BufEnter *.git/index if &ft == 'gitcommit' | Gtabedit | endif
does the trick automatically.

However, I get the error message "E441 no preview window".
It seems "wincmd P " in s:Status() is making this error.

@tpope, I would like to know if I can achieve this trick without making errors?

@geneotech
Copy link

@ipod825
Looks like I can just

nmap <silent> <C-s> :Gstatus <bar> wincmd T<CR>

@ipod825
Copy link

ipod825 commented Jan 24, 2018

@geneotech
Even with the map, I still get the same error.

@tpope
Copy link
Owner

tpope commented Jan 25, 2018

:Gtabedit :

@huangzonghao
Copy link

huangzonghao commented May 23, 2018

:Gtabedit : works perfectly in opening the status window in a new tab. However, whenever I diff a file (say by dv), the 2 diff windows will kick the status window away and take the tab. And I can't seem to find a way to go back to the status window after I finished with the diff mode. So I am wondering if there is a way that I can diff a file in the same tab but still have status window persist, or how should I go back to the previous status window after I am done with diff?

@tpope
Copy link
Owner

tpope commented May 23, 2018

:set previewwindow should work.

@huangzonghao
Copy link

Thank you @tpope! That's exactly what I want!

arumoy-shome pushed a commit to arumoy-shome/dotfiles that referenced this issue Feb 12, 2019
Now viewing space and also keeps git in it's own space. Solution found
in this github issue: tpope/vim-fugitive#727.
@Melandel
Copy link

Hi, I have these lines in my vimrc:

augroup gitstatus
	autocmd!
	autocmd FileType fugitive set previewwindow
augroup END

nnoremap <silent> <Leader>G :Gtabedit :<CR>

It works fine but now the status window closes after I leave Insert mode in the commit window.

How can I keep the status window open at all times in my new tab?

@tpope
Copy link
Owner

tpope commented Apr 24, 2020

Preview window closing sounds like a completion plugin. This is one of the reasons I recommend against using a preview window!

@Melandel
Copy link

I'll :tabedit % | G instead of :Gtabedit : in that case.

Thank you for your time :)

@tpope
Copy link
Owner

tpope commented Apr 24, 2020

:tab G works!

@Melandel
Copy link

Oh. My. God.

Thanks a bunch tpope!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants