Re:VimR – Refined Vim Experience for OS X
by itry on Saturday August 16, 2014 @01:20PM
(#8186818)
Does anybody know how to really close a tab in vim? When I type t on a file to open it in a tab and then type :q, it looks like ist closed. But when I type :ls I see that its still open.
[ Parent
| on HN ]
When you write `:ls` you see all the buffers, not tabs. To remove the buffer you can use `:bd :bdel :bdelete` (see `:help :bdel`) which unloads a buffer and deletes it from the bugger list.
Sure. But I want to close the buffer AND the tab. :bd only closes the tab if there are multiple tabs open. It does not close the tab when its the last tab before the file explorer:
1) in the shell run "vim ."
2) hit "t" on a file
3) type ":bd<enter>"
You still have 2 tabs open. One with the file explorer and one with an empty file. Probably because the file explorer has type "nofile" or something, so vim things the buffer you just closed was the last one. Im not sure why its not closing the tab. It might be a bug.
Is there a way to tell vim "When I type :bd close the frickin tab, even if its the last one!"?
Re:VimR – Refined Vim Experience for OS X
by mackwic on Saturday August 16, 2014 @06:07PM
(#8187731)
Yes, see my other answer here: https://news.ycombinator.com/item?id=8187723
Re:VimR – Refined Vim Experience for OS X
by mackwic on Saturday August 16, 2014 @01:27PM
(#8186833)
`:bdel` is what you're looking for. ;-)
Problem with ":bd" or ":bdel" is that it leaves open the last tab:
1) in the shell run "vim ."
2) hit "t" on a file
3) type ":bdel<enter>"
The tab is still open.