Closed jordwalke closed 7 years ago
You can set hidden
, or use :enew!
, or map something to :confirm enew
. Wintabs already handle many cases using :confirm ...
, but I'd still suggest you :h 'hidden'
and maybe :h bd
to know more about this.
BTW, due to how wintabs handles new buffer or unlisted buffer, the empty buffer tab won't show on the tabline until it's changed.
:enew!
will discard changes to the buffer! Were you aware?
Oh sorry, I know how :enew!
works but wasn't really aware that it's not what you weren't looking for.
I think setting hidden will work (I suppose I have to create an autocmd that will cause it to happen for every new file that will open). Are there any bad consequences to doing so?
set hidden
is a good default in .vimrc if you use any kind of buffer browser (like wintabs). You don't need to use autocmd for this, because the consequence of leaving it on is just that you can lose track of unsaved buffers without a buffer list. I've had set hidden
for years and never had any issue.
"because the consequence of leaving it on is just that you can lose track of unsaved buffers without a buffer list"
I see, so something like WinTabs removes all of the downside?
Yeah, any buffer browser, even the old minibufexpl, will do.
What vim command would you recommend for vim-wintabs "new tab" equivalent. I've tried
:enew
(mappingcommand + n
to this), but it doesn't actually recreate the notion of "new tab" because if my current buffer has unsaved changes, it complains that there are unsaved changes. Do you have another suggestion for a command for opening a "new tab".