Use buffers effectively!
You might consider use
:tabclose to close your tabs. This has the benefit of closing the tab (and keeping you away from your mouse) but also being just annoying enough to motivate a workflow change over to using buffers and splits. As for a warning about closing a tab with multiple windows, I see little benefit if you have
'hidden' set then the buffers are still there so no harm. If you do not have
'hidden' than any modified buffers will be prompted before they are closed.
Why not tabs
Tab pages are great. However it all comes down to vim treating tab pages as more of view-ports into a group of windows or workspaces. Tab pages just don't scale well. Just open some other GUI editor and open up 20 or so tabs. It becomes tricky to deal with. I have had over a 100 buffers open and switch between them without worrying. Buffers just scale in ways that tabs do not. Buffers and splits also work well with smaller windows which is often the case when using terminals.
Don't just take my word for it. Here are some more supporting information:
Quick Buffer Tips and Tricks
set hidden will hide buffers when abandoned.
:sb to switch to a buffer you already opened.
:b both can take partial names and globs. e.g.
- Take a look at
'switchbuf' and change to your preferences.
- Learn to love
:new, and all type of split commands.
- Learn some
<c-w> commands to make your life with splits easier.
- Use capital letter marks to jump back to buffers where you know you will jump back to.
- Use tags to jump to definitions.
- Possibly use
cscope along with tags
<c-6> to switch to the previously edited file.
<c-i> to move older/newer positions in your jump list.
- Possibly make use of one of the many buffer plugins out there. e.g
For more information see: