I've tried MiniBufExplorer, but I usually end up with several windows showing it or close it altogether. What I'd like is something like LustyJuggler with incremental search, the way I switch between buffers in Emacs. Surely there is a script like this?
Pressing Alt-F12 opens a window listing the buffers, and you can press Enter on a buffer name to go to that buffer. Or, press F12 (next) or Shift-F12 (previous) to cycle through the buffers.
Just put it to your . vim/plugin directory and then use :BufOnly command to close all buffers but the active one.
To move between the buffers, type C-x b. Emacs shows you a default buffer name. Press Enter if that's the buffer you want, or type the first few characters of the correct buffer name and press Tab. Emacs fills in the rest of the name.
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:
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+F mod/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.
I use the basics - ':ls
' + ':bn
'/':bp
' + ':b <part-of-name>
'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With