I used to use a combination of tabs and multiple gvim instances, keeping groups of related files as tabs in each instance. So long as I didn't end up with too many tabs in one instance, the tab bar shows you the name of each file you're editing at a glance.
Then I read a post by Jamis Buck on how he switched from TextMate back to vim, and learned some great tricks:
Ctrl+ws and Ctrl+wv to split the current window
Ctrl+6 to switch back and forth between two buffers in the same window.
the awesome fuzzyfinder.vim which gives you auto-completing search of files in your current directory or of buffers you currently have open
Jamis' own fuzzy_file_finder and fuzzyfinder_textmate, which slightly modify how fuzzyfinder works to behave more like a similar feature in TextMate (as far as I can tell, the difference is that it matches anywhere in the filename instead of only from the start). Watch this video to see it in action.
Now I just have one gvim instance, maximised, and split it into multiple windows so I can see several files at once. I bound Ctrl+F to fuzzyfinder\_textmate, so now if I type (say) Ctrl+Fmod/usob it opens up app/models/user\_observer.rb. I almost never bother with tabs any more.
Update 2010/08/07
While fuzzyfinder\_textmate remains awesome, as Casey points out in the comments, it's no longer maintained. Also, it (and/or fuzzyfinder.vim) gets a bit slow and unstable when working with large projects (lots of directories or files), so I've been looking for an alternative.
Fortunately, there seems to be a very nice alternative in the form of Wincent Colaiuta's Command-T plugin. This has very similar (if not slightly better) behaviour to fuzzyfinder\_textmate, but is noticeably faster; it also has nice features like being able to open the found file in a split or vertical split. Thanks (and upvotes!) to David Rivers for pointing to it.
The excellent Buffer Explorer, the be has gotten to be such strong muscle memory that I find myself wishing I could use it in other applications. I find it to be extremely fast when actively editing more than two files.
I've spent quite a while building my .vimrc to work with this HTML::Mason project I've been on for four years, so I have an odd mix of tabs and split windows. For your viewing enjoyment:
I use tselectbuffer. It's really fast and unlike bufexplorer doesn't take space in your window. It also has a incremental search.I tried minibufexplorer and I found the navigation in the buffer a bit difficult.
I have been using Wincent Colaiuta's Command-T vim plugin for a couple months now. Wincent wrote the parts of it that need to be fast in C, and I must say that it is! And, I think its file pattern matching logic is even better than Textmate's Command-T. Check out the screencast.
The Command-T plug-in for VIM provides
an extremely fast, intuitive mechanism
for opening files with a minimal
number of keystrokes. It's named
"Command-T" because it is inspired by
the "Go to File" window bound to
Command-T in TextMate.
Files are selected by typing
characters that appear in their paths,
and are ordered by an algorithm which
knows that characters that appear in
certain locations (for example,
immediately after a path separator)
should be given more weight.
Easier buffer switching contains many useful tips. I have adapted the following to my .vimrc, which does buffer-name auto-completion, maps the most useful buffer-switching commands to my <Leader> and left-side home row keys, and shows the current buffer number in the status line:
"" Tab triggers buffer-name auto-completion
set wildchar=<Tab> wildmenu wildmode=full
let mapleader = ","
map <Leader>t :CommandT<Return>
map <Leader>a :bprev<Return>
map <Leader>s :bnext<Return>
map <Leader>d :bd<Return>
map <Leader>f :b
"" Show the buffer number in the status line.
set laststatus=2 statusline=%02n:%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P
I also use MiniBufExplorer, which provides a compact listing of each listed buffer in its own horizontal split up top.
I have mapped <S-J> and <S-K> to :bp and :bn, although I admit I don't use it as the number of files is greater than 10. I have then mapped <C-J> and <C-K> to Gnome Terminal's previous and next tabs, and I usually run 4 instances of vim for each of the 4 different projects I work on. I still really wish next and previous buffer would go to the history of buffers I have been working on, and not the order int he buffer list.
To jump straight to an open buffer just use Vim's tab completion with :b. A few letters is enough to get to any open buffer with a tab or two.
Similarly to open buffers I use :e with relative paths and tab complete.
I also use :ls occasionally to see what buffers I have open (and to check their modified status).
To get rid of a buffer I use :bw to wipe the buffer. I usually make a temporary split and change buffers to preserve my layout though since :bw also closes the active window.
All the minibuf things I tried just ended up annoying me, and I don't want some smart-matching thing opening random files for me. If I really need to browse for something I use NERDtree (:e .).
IDK, Lately I also dropped Yankring (because it screws up xp) and started using registers, and I recently decided the f/t movements are the greatest thing ever...
When there are several buffers open in a Vim session, it can become difficult to keep track of the buffers and their respective buffer numbers. If this is the case, switching to a different file can be made easier using a simple map:
I use tselectbuffer. It's really fast and unlike bufexplorer doesn't take space in your window. It also has a incremental search.I tried minibufexplorer and I found the navigation in the buffer a bit difficult.