Re:Vim Recipes
by bmj on Friday January 07, 2011 @04:39PM
(#2081228)
Before I made a brief foray in the land emacs, I used tabs in VIM rather than leveraging the buffer system (I came from a Windows world, so I was used to tabs in other editors). Then emacs opened my eyes to magic of buffers, and when I returned to VIM (for various reasons), I found buffers to be better than tabs, especially once I first learned the commands, and then updated my .vimrc with a few useful shortcuts, particularly for split views.
[ Parent
| on HN ]
For any newbies who are curious what all this talk of buffers and tabs in vim is, check out:
http://img200.imageshack.us/img200/9031/windowsv.png
And, in vim you can type:
:help buffers
and :help tab-page
Re:Vim Recipes
by planckscnst on Friday January 07, 2011 @09:46PM
(#2082011)
Please tell me the difference. All I see is that it's more difficult to switch when using buffers instead of tabs (have to press :, have to add ! if it's not saved).
Re:Vim Recipes
by burgerbrain on Friday January 07, 2011 @10:02PM
(#2082046)
There are multiple plugins to cosmetically improve interaction with buffers, my favourite is minibufexplorer. Using tabs like you might in other editors is fine for a beginner, but once you begin to learn and use more advanced vim features you'll very quickly realize they don't scale.
Also, you should always make sure 'set hidden' is in your '~/.vimrc'. It's a crime that it's not default in my opinion. Takes care of the dumb "have to add ! if it's not saved)." thing.
Two words: FuzzyFinder.
Bind it to a key and switching between buffers (or on-disk files that are not even loaded) becomes as simple as typing a few letters of the filename.
No more scanning of abbreviated tab-labels, no more trial and error cycling through buffers. Highly recommended.
I checked out buffers - it's not clear to me why they are better than tabs. It seems like a different UI treatment for basically the same thing. Can you clue me in?
Re:Vim Recipes
by burgerbrain on Friday January 07, 2011 @09:58PM
(#2082039)
Tabs are all about layout. Look into the windows (and how they fit in with buffers) and you'll start to notice the difference.
Basically, the only case where you should be using tabs is when you have several different arrangements of windows that you want to switch back and forth between.
Re:Vim Recipes
by wahnfrieden on Saturday January 08, 2011 @11:52AM
(#2083336)
Right. In Django I tend to use one tab per application, with seeral split buffers inside each.