Closed jordwalke closed 7 years ago
I'll fix this.
Meanwhile I'd really suggest close vim using vim commands (:quit, ZZ, ZQ) as they work very well with session and vimtabs (you can restore last session with all vimtab buffers re-opened).
@zefei As a user, I just want to be able to hit my keyboard shortcut for "close the thing", and have it close my buffers (wintabs actually) one by one, and then when I've finally closed all of them, that same command should close out of the final window, which quits Vim. This is how most applications that I use function (such as Chrome for example).
Wintabs works well in this way for closing the window/tab when you've closed all the buffers inside of it - I just think that same consistency should extend to the final window, and therefore the entire app.
@zefei Do you know of any way to do everything just as wintabs currently does it, but then have it automatically use :q
for the final close? Is there a way to programmatically check how many wintabs remain assigned to the current window? I can create a custom key mapping that checks if I am the last window open, and then if I am also the last wintabs buffer assigned to this window, I would then have the keymapping call :q
instead of WinTabsClose
. I do feel like this should be the default behavior, but I'm definitely willing to create my own mapping that does it, if you are aware of a way to do this.
@jordwalke I didn't have much time last week, I'll probably fix it this weekend as this is just a one line fix. If you really want to do it now, you can do
noremap <KEY> :<C-U>call <SID>close_wintab()<CR>
function! s:close_wintab()
try | WintabsClose | catch | quit | endtry
endfunction
Thanks for the suggestion.
It seems this results in an error.
This function parses correctly:
function! s:close_wintab()
try
WintabsClose
catch
quit
endtry
endfunction
Thank you!
I added option g:wintabs_autoclose_vim
, closing this.
Thanks so much!
When I try to close the last window using
:WintabsClose
, I get the mentioned error. I would like it to close vim entirely when I run:WintabsClose
on the final window/buffer.No configuration of
|g:wintabs_autoclose|
or*g:wintabs_autoclose_vimtab*
make this work.I am testing in MacVim.