Coming home to Vim
Over three years ago, I was faced with a dilemma. I had recently switched to the Mac (from Linux) and was still using my text editor of choice (vim), but at the time, vim’s “integration” with OS X was pretty minimal (and that’s putting it optimistically). I experimented with emacs, but it never clicked for me, and honestly, emacs on OS X wasn’t all that better than vim at the time. Sadly, reluctantly, I said good-bye to vim and switched to TextMate.
TextMate was (and certainly still is) a fantastic text editor. The project drawer was awesome, finding files via cmd-T was super powerful, and smarter auto-completion and snippets promised a new and faster way to pound code. After a couple of months of reteaching my fingers how to edit text, I was happy.
Sometimes, though, late at night, I would think again of vim.
Fast forward three years. The vim landscape is different now. There is actually a Mac-friendly GUI version of vim now, MacVim, which actually looks like it belongs on OS X. Vim 7 supports UI tabs, and a much more powerful auto-completion mechanism than before. And plugins like rails.vim and fuzzyfinder.vim mean that TextMate no longer has a corner on powerful project navigation.
For the last few weeks I’ve been toying with switching back to vim. TextMate’s “snippet” feature never clicked for me, and the only times I used it were by accident (when it annoyed me more than it helped me), but I really was hooked on the project browser, and cmd-T, and a few other things. I realized that, with a little work, perhaps a way could be found to reimplement most of the things I loved about TextMate, in vim.
This last week I’ve worked exclusively in vim, to test that theory. It’s like coming home. As I said, TextMate is a powerful and wonderful editor, too, but differently powerful and wonderful. Vim’s wonderfulness and power is the wonderfulness and power of git, or linux, where the learning curve is steep (ridiculously steep at times), but the rewards of mastery are sublime. I didn’t even realize I had missed a sane shift-J, or using the dot key to repeat the last command. Fix transposition typos with ‘xp’. Select a single word with ‘viw’. Drop bookmarks with ‘m’, and jump right back to them with single quote.
If any of that makes your stomach roil, then vim is not for you. :) But to me, it’s like being embraced by a long-lost friend after years apart. And vim holds no grudges.
There was still the issue of the TextMate features that I had particularly come to love. First to tackle was cmd-T, since my workflow had become so dependent on that for finding files. Takeshi NISHIDA’s fuzzyfinder.vim script seemed like exactly what I wanted…at first. It’s definitely a powerful tool, but the fuzzy finder for files was not TextMate’s cmd-T, and my instinctive attempts to treat it so were causing me a lot of aggravation.
So I took an evening and wrote fuzzy_file_finder, a Ruby library that mimics (and improves on, if I do say so myself) TextMate’s cmd-T functionality. Then, I extended fuzzyfinder.vim with fuzzyfinder_textmate, which bound the fuzzy_file_finder to vim. The result?
See for yourself: http://s3.amazonaws.com/buckblog/videos/fuzzyfinder_textmate.mov (600K, QuickTime video).
I’m still working on a solution for the project browser. Yes, I know there are several (“countless” might be a more accurate term) vim plugins that present a project drawer in a split window, but even before being spoiled by TextMate those didn’t feel right to me. I’m experimenting with a cocoa tree view that sends files to a specific vim server, and it mostly works, but I’m still not sure it’s the right solution. If I do come up with something, I’ll definitely open it up and share it. (On the other hand, if any of you out there in readerland already know of such a thing, please point me at it!)
So, I’m still reacquaiting myself with all my old muscle memories, but here are some commands I wasn’t previously very familiar with which are proving useful in conquering my TextMate habits:
- :e [file]. This is great if you don’t want to use fuzzy finding. Vim will even do tab completion to make things easier.
- :ls. Shows all of your buffers.
- :buffer [file]. Fantastic for quickly switching between buffers. You can give it just part of a file name and it will jump to the buffer that matches.
- The ctrl-6 (technically ctrl-caret) key is awesome for switching back and forth between two buffers. For instance, if I just need to quickly look at one buffer, I can jump right back to where I was with ctrl-caret.
- ctrl-W introduces a whole host of options for working with split windows.
And lastly, can I just say that Vim is seriously the poster-child for documentation? I recommend spending 15-30 minutes, every day, in :help, just exploring. There is a LOT there, and all excellently documented.
So, all you vimsters out there: what commands do you frequently use? What features of vim are you so dependent on that you’d be useless without them? Do share!
Reader Comments
Jamis,
This is super-rocking. Way to go!
I use textile.vim like crazy:
http://www.vim.org/scripts/script.php?script_id=2305
I also use surround.vim, taglist.vim, bufexplorer.vim, and fuzzyfinder.vim.
I keep gravitating between TextMate and VIM. I’ve landed, for now, at using TextMate for everything rails, and VIM for everything else. The bundles in TextMate are hard to beat, and I’ve been able to use macros to overcome some TextMate pain felt by learning (and loving) VIM.
10 Oct 2008
I actually experimented with going back to VIM recently too, the missing feature for me was cmd-T also. I’ll definitely be giving this a try, thanks!
10 Oct 2008
I first switched to Vim from TextMate after losing access to my usual set up of Macbook + external display and only having the Macbook. TextMate is lovely, but it’s a hog on the screen.
I had been playing with Vim before that and was in love with how quickly I could move around in a file. Buffer Explorer and Surround (mentioned in another comment) make my Vim life complete.
I don’t miss the snippets. I found them to be a crutch and they were inhibiting my knowledge of a language or API. I spent more time trying to remember triggers than the API itself.
10 Oct 2008
One of my favorite command is ~
It converts the underlying character from upper case to lower case and vice versa.
Like all VI commands, it takes while to get it into your fingers and I really had to force myself into using it, but now it’s this really good friend that I love to have around.
I’m using Emacs in VI mode. It gives me the best of both worlds (though sure some would it the worst of both…)
10 Oct 2008
Looks like you either did not explore Textmate deep enough, or you do not like modifier keys. “Sane Shift-J” exists in TM as control+shift+j; you can transpose characters with simple ctrl+t; select one word with alt+shift+arrow (there is a bunch of nice standard keyboard shortcuts in OS X too).
10 Oct 2008
@Rimantas, please, this post was not an attack on TM users. I explored TM plenty deep. I know about control-shift-J, and to me, it is not sane. Every time I used it I had to insert a space—vim is smart enough to do that for you. And I know about alt-shift-arrow, etc.
If that all works for you, that’s great! Stay with TextMate. I’m definitely not suggesting everybody move to vim. But for me, I love vim. I always have. TM was a stopgap for me until vim’s OS X presence improved.
10 Oct 2008
My favorite vim command is definitely :s. Nothing beats vim for easy replace:
:%s/typo/correction/g
and you can use & to repeat the last substitution.
Other highlights:
Ctrl-] to jump to a tag, and Ctrl-T to jump back. Try the rails.vim :Rtags command for dead simple taglists!
do and dp for getting and putting changes in diff mode. Who needs a fancy merge tool?
surround.vim. Awesome stuff: ysiwttag> : wrap the current word with <tag></tag> cs’” : change surrounding ’ to ” http://www.vim.org/scripts/script.php?script_id=1697
rails.vim. Priceless! The smart gf alone is worth it. http://rails.vim.tpope.net/
allml.vim. Great for editing rhtml. And if you have surround.vim, it adds the rhtml tags as surround types! <insert>Ctrl-= : wrap cursor in <%= %> <insert>Ctrl—: wrap cursor in <% -%> http://www.vim.org/scripts/script.php?script_id=1896Basically anything Tim Pope has ever done. He’s making all other editors obsolete!
10 Oct 2008
You are a rockstar. I’ve wanted something like this for a long, long time. Coincidentally, just today, I googled for another solution and found something similar:
http://www.visnup.com/entries/8705-textmate-go-to-file-in-vim
... but it’s nowhere as slick as your solution. I love it. Thank you. This is worth the amt of money I paid for TextMate alone!
10 Oct 2008
After countless times of accidentally hitting the ‘q’ key and enabling recording mode, I finally read up on it and found it immensely useful for complex repetitive tasks. q<letter> starts recording into a named register. @<letter> replays the actions you did. Priceless once you start using it.
10 Oct 2008
I actually like snippets and I use them a lot (see the SnippetsEmu Vim plugin). I am a PHP coder and I like the fact that I can switch effortlessly between different coding standards (just by setting a variable and loading a different set of snippets).
An piece of advice not really related to text editing, but here goes: give Vimperator (Firefox extension) a try. I’ve never looked back. :)
10 Oct 2008
One thing… I just tried this on my app and got this error:
Error detected while processing function <snr>22_CompleteFunc..68: line 17: FuzzyFileFinder::TooManyEntries: FuzzyFileFinder::TooManyEntries
Any ideas?
10 Oct 2008
I’ve recently gotten hooked on Vim’s integration with ctags and cscope. I’m not too experienced yet but the following macros are very powerful:
10 Oct 2008
Re: the file count ceiling of 10000 files… (comment #11 above), you can change the ceiling in the fuzzyfinder_textmate.vim file (line 39):
ruby def finder; @finder ||= FuzzyFileFinder.new(”.”,50000); end
10 Oct 2008
Cmd-T is the only thing I missed from TextMate when I forced myself to learn ViM. I can’t wait to try this out!
I don’t miss the project drawer much, but NERDTree is a pretty decent text emulation: http://www.vim.org/scripts/script.php?script_id=1658
10 Oct 2008
I switched to TextMate upon coming to the Mac from Linux. I had been a die-hard vim user for many many years, but TextMate won me over for two reasons: the project drawer, and tabs.
MacVim is getting there, it appears, but until it has a real answer for the project drawer, I’m sticking it out with TextMate, and eagerly anticipating both editors improving in future versions.
Thanks for the heads up on this! Its making me so nostalgic :)
10 Oct 2008
My most frequently used rails.vim feature is :AS. This opens up the test/spec for the current file (or vice versa), and puts it in its own window.
I wish I could get :Rtags to work, but ctags barfs on one of my JS files.
project.vim + MRU.vim are acceptable. rails.vim will set up your project file with :Rproject.
Vimperator seemed great until I started using it. Probably the most irritating thing is that it seems to turn of my font size preferences for each website.
Cmd-T is the only thing I’ve ever liked about TextMate. TextMate is the worst program people love that I’ve ever used. I switched to Mac, at least partially based on the raves about TextMate. Yuck!
10 Oct 2008
Thank you so much for fuzzyfinder_textmate, Jamis. This has been something I’ve always longed for in Vim, and you’ve really nailed it.
Is there a way to reset the index without quitting and restarting Vim (if I :cd or otherwise alter the directory structure)?
10 Oct 2008
awesome vim features (for me:)
ciw, ci’, cit (html tags) which are of course related to the viw you mentioned in your post.
splits! ^w ^s will split horizontally, ^w ^v will do vertically and then ^w (h,j,k,l) will move among the splits and if you do a shift on those it will move the split you are in in that direction.
10 Oct 2008
Here are a couple custom commands from my vim config. I wish I could take credit for these but I picked them up during my internship at Atomic Object a few years ago.
10 Oct 2008
@Adam, currently, to rescan the tree, you can do this:
I meant to add a more convenient way to do that before I announced, and forgot. Ah, well!
10 Oct 2008
Awesome article! There’s a lot of good stuff here – I did find a typo, it’s Ctrl-^ (i.e. Ctrl-Shift-6), not Shift-6; ^ takes you to the beginning of the line
10 Oct 2008
There’s VimMate (http://vimmate.rubyforge.org/) but it probably won’t work as well on OS X (it’s for Linux). There’s even a git repository: http://github.com/niklas/vimmate/commits/master …
10 Oct 2008
I know how it feels to “come home to Vim.” I’ve done it several times, and I always get that warm, wonderful feeling. Vim is where it’s at; it’s like some archetype of the programming experience that’s unique unto itself.
Anyway :-) I started using other editors because I found it hard to navigate classes that had a ton of functions (I essentially had to just scroll around, or do a ”/”-find). Then one day, after missing Vim sufficiently, I was trying to find solutions online, and I ran across the taglist plugin.
Taglist will identify classes, functions, and variables, and display them in a vertical window to the side of your main editing environment. After binding <f4> to turn taglist on, and <f5> to refresh it, I’m in paradise.
I haven’t really been looking for a solution to TextMate’s project file viewer. Instead, I just leave a Windows Explorer window open, and open all my files in separate Vim instances. It works out beautifully.
10 Oct 2008
zt, zb and zz are commands that I use pretty frequently. They keep the cursor on the current line, but re-position the cursor at the top, bottom or middle of the screen.
10 Oct 2008
I use these a lot:
editing:
ct+<key> => [c]change [t]to <key>, where <key> is the next letter from the cursor.
column editing:
cntrl+v (select columns) s type away and hit j
multiple line select for copy+paste
shift+v (select rows) y copied selected lines
those are the new tricks I learned a few years ago… still haven’t picked up tabs from vim 7
10 Oct 2008
I’ve never used Textmate, but a friend who does sent me a link to ViMate awhile back… might be worth looking at to get more VI into TM…
http://sourceforge.net/projects/tm-vi-plugin/
Also, if you’re really arcane (like me) and happen to use iTerm, gnu screen, and the command line vim and want decent colors, read this. Doesn’t work with Terminal though.
http://pjkh.com/articles/osx-iterm-screen-vim-256-colors.html
10 Oct 2008
@Paul, good catch. I’ve corrected the article.
10 Oct 2008
I second the NERDTree plugin recommendation. Deal with Rails or any deep nest without a project drawer is a waste of mental energy. NERDTree really is pretty bad-ass. Just the fact that I use the hell out of it WITH NO MOUSE puts it far ahead of any GUI.
10 Oct 2008
Here’s something that regularly sends me into a killin’ rage. Iwork with a big application. It’s not uncommon for a gvim session to have 100 or more buffers open.
Now lets say I sit down to work on a bug. I surf around through my buffers, figuring out what needs to be fixed. Not often, but sometimes, I’ll accidentally modify a buffer when the file hasn’t yet been checked out of perforce.
After a few minutes of fixing stuff, I click the F8 key, which is mapped to a command to do a :wa and run a build. However, that modified buffer can’t be written because I didn’t check the file out. So what does gvim do? It tells me that it can’t write the file, but it DOESN’T TELL ME WHICH FUCKING FILE IT IS. I have to do a :buffers and try to remember what the cryptic little markers mean in order to find the buffer. Please, PLEASE make the error message better.
Here’s another one: I sync from the source code repository. Then I go back to my gvim window. Oh, look! 50 of the files in open buffers have been updated! Guess how many popups I get to deal with? 50! I HAVE TO CLICK “OK” 50 TIMES!! For christs sake just give me a “do this for all updated files” option.
I’ve been using vi since about 1983, so I’m definitely a fan otherwise.
10 Oct 2008
I’ve switched to the mac some months ago (from linux), I was so impatient to try out this wonderful thing, TextMate, so I immediately downloaded it, tried it out and… trashed it.
(Mac)Vim rules my world, I don’t think it’s entirely TextMate fault is just that vim commands feel so natural, I’ve been using it since 2001 and I can’t really stand other editors… no way. ;-)
10 Oct 2008
@Mike, does :bmodified not list the buffers that need saving?
10 Oct 2008
or, not list, sorry. Find. :bmodified [N] takes you to the Nth modified buffer, or the next one if you don’t give an argument.
10 Oct 2008
This is awesome! I still need it to do one thing, though—can I define a list of source directories for it to scan/search for files in?
I’ve got source in 7 different places that I’d like to be searching. A quick look through the fuzzy*.vims and I didn’t see anything obvious…
10 Oct 2008
cool. Two suggestions though: the video is too fast when you’re actually showing your plugin – you should slow down these parts a bit next time. Second, why not use a separate color instead of parens to show the matching part? I think it would be both easier to see and 2 characters shorter :)
10 Oct 2008
@Kevin, the key to scanning a different directory is in passing a new parameter to FuzzyFileFinder.new…but it currently only supports a single source. Could be a nice patch to allow a collection of root directories.
@Anatol, please do consider a patch for that! I’m not familiar at all with specifying colors in vim.
10 Oct 2008
Anyone figure out how to remap the esc key on the mac ?
10 Oct 2008
@justin, if you’re using macvim, snapshot 36 (the most recent, as of this writing) changelog says “modifier key can be used as Esc (useful for turning Caps Lock into Esc, see :h macvim-esc)”.
10 Oct 2008
My god, thanks for pointing out MacVim for me!
10 Oct 2008
Just a simple one: the ‘f’ and ’;’ keys. If you’re editing a long line, use f<char> to jump to a character and repeat with ’;’. This goes back to vi. You can combine with c and d etc ‘F’ is reverse.
I wrote a shell script one time which grepped all my rails files for some name or searched their file names, then created a bunch of sym links in a tmp directory which I then opened in vim. You can then open each file by using ‘o’ which splits the window into the original sym link list and the file name. But I’ve been using netbeans and its jvi plugin at the moment.
Occasionally also use in-built tabbing of vim (as opposed to split or vsplit): ”:tabnew .” will open a tab of the current directory etc
If you’re in a directory in vim, use ’-’ to go up to the parent dir; ‘o’ to open a subdir or file in split window, or just plain <return>.
10 Oct 2008
”.” is the command I miss the most in TextMate. The TxM command I was really pining for was ESC (complete word found previously). I did some digging and found the Vim version: <ctrl>-N. So that’s my tip :)
10 Oct 2008
I don’t know what cmd-T does, but from your description I thought you might be interested in the plan9 editoracme, in which selecting/using files names from text paramount.
10 Oct 2008
Chris, thank you for the ,e mapping (comment #19)!
Mike (#29), :set autoread to avoid those popups and complain to [email protected] about the unclear error message.
Kevin (#33), :set path.
My favourite vim features: keyword completion (^P/^N in insert mode), jumping to tags (^]), split windows (^W s, ^W v), vim's diff mode (vimdiff file1, file2), vcscommand.vim (for :VCSVimDiff), bufexplorer.vim. And everything else.10 Oct 2008
It sounds like a lot of us Vim guys don’t know what Cmd-T does, but it sounds like it finds a filename.
I haven’t found a real need for that, but if I need to I can use / in my project buffer (http://www.vim.org/scripts/script.php?script_id=69). It’s a little old but I’ve found it quite useful.
NERDTree looks cool and I’ll be giving it a try. But the project plugin listed above lets me organize my files in ‘working groups’, whereas they are separated on the filesystem.
fwiw.
10 Oct 2008
@Mike McNally
1. :set autoread
2. Install http://www.vim.org/scripts/script.php?script_id=240
10 Oct 2008
great Jamis, please inform us when you have a solution for the project browser!
10 Oct 2008
MacVIM is a joy to use, I’ve been on it for the past 6 months.
BufExplorer is a must have plugin.
Then adding the following key mappings has made vim a much more pleasant for me.
:imap jj <esc> :imap kk <esc>
Makes it very easy when I get moving after editing text.
10 Oct 2008
I have a plugin which is similar to what you are trying to achieve (http://www.vim.org/scripts/script.php?script_id=2013).
The difference is that it relies upon a pre-generated ctags file to be loaded in your Vim instance.
It then allows you to perform a drill down search much like yours does. My inspiration however came from Eclipse.
Keep up the good work.
10 Oct 2008
FuzzyFinderTextMate seems a bit slow when looking through even a 200 file project—Perhaps I am missing some caching options though.
Another alternative is ProjectBrowse(http://www.vim.org/scripts/script.php?script_id=943), though you have to use regular vim search—which I haven’t had a problem with.
10 Oct 2008
I’m not sure a Cocoa tree view would be the right approach for me—I like to search and navigate a file system using the same vim commands I use for navigating a source file. And to be able to do it on remote systems the same as locally.
This is my set-up: http://make-believe.org/in-words/post/vim-is-forever
If the screenshot appeals to anyone, drop a line and I can send you a zip. (It’s probably too rough-and-ready for a proper release.)
FuzzyFinder looks great, I’m going to try it out now.
11 Oct 2008
It shows all the files in a tree-like view, I can search through them with ”/”, and when I find the one that I want I can just type “gf”.
Another IMHO underrated keystroke is shift+ctrl+6, which is to switch between the last two buffers. Super handy.
11 Oct 2008
Hi,
Even though I am from that other editor I found your story very similar to my own…. great that you jumped back to where you feel comfortable!
Regards,
Arjen
11 Oct 2008
Things I use a lot in vim:
"ciw" "ci{" "ci(" : change a word, scope, condition, etc. Absolute gold. ":s///g" : yay, substitution! combine with visual mode or % for great justice.cscope : fantastic project navigation tool. find all places which call a function, all definitions of a function, etc etc. it’s powerful.
lookupfile.vim : plugin to find files easily. seems to do something similar to your fuzzyfile thing; I am going to check out your one tomorrow to see what the differences are.
ctags : I don’t actually use this for tags, I use cscope, above, for that. Instead I use ctags and some sed/awk magic to generate a custom syntax file which highlights my own definitions and types and stuff.
":sp" ":tabnew" : I like having all my code in one window; I make the current buffer fill the screen apart from 1 line of text and 1 line of status bar for all other buffers; group similar files in a tab together. really easy to navigate.That’s about it, beyond another million or so muscle memory commands I can’t recall right now. :)
Max
11 Oct 2008
At first I used Vim for all my editing because I liked the keybindings and it was a lot easier than learning Emacs. Then I tried TextMate for a bit but it’s powerful in a different way than Vim or Emacs are powerful. It’s very young and fundamentally less powerful than Vim or Emacs and the only features that I really like are the ones people add-on with Bundles that have limited control.
Then I decided to just go for it and learn Emacs, and it’s been a very good decision and I’ll never go back. It’s literally the most extensible software ever made and very enjoyable with it’s Lisp dialect; Emacs-Lisp.
11 Oct 2008
Interesting post … and good info in the comments too.
Yes, vim is great – and as others said, it has a huge number of commands and pretty good documentation.
@Jamis:
You might know this already, but, if instead of single quote, you use the backquote key to go back to your mark, the cursor goes back to the exact cursor position you were at when you marked the line with the m command, not just to the beginning of that line (as it does with single quote).
One of my favorite vim commands, and a powerful one, is this:
If you prefix most vim commands that would move the cursor (through some part of the file) with an exclamation mark (!), and suffix the movement command with a call to an external shell command, like sort, ls, etc, vim pipes the range of text (that would have been moved through) to that shell command, and then replaces that text (in the file) with the output of that command. The command should be a filter (a command that reads standard input and writes to standard output). This also worked in vi.
Example:
Take this simple file, called a, created by redirecting the output of the ls command while in some directory (I’ve deleted the filenames at the end of each line, as they are not relevant, and also the “total” line that ls adds at the top):
I opened it in vi, then gave this command:
!Gsort -n -k 5
Then saved the file as file b:
The lines in the file are now sorted by file sizes.
The command sort -n -k 5 sorts whatever is in its standard input, in numerical order (-n), using the 5th column or field (space-separated fields are the default) as the key to sort on (-k 5). Since the G command moves to the end of the file being edited, and I was on the first line when I gave the overall command, the full command results in the entire file being sorted by the file sizes (the 5th field of ls output), and that sorted output replaces the contents of the entire file. By just changing the column number (and dropping the -n if you want alphabetical sorting), you can also sort by number of links, modification date, file name, file owner, etc. Of course, this technique works on any text file, including program code, program input data, etc., not just on ls listings.
Instead of sort, you can use uniq, awk, sed, tr or any other standard Linux/UNIX filter. Or any one that you wrote.
- Vasudev
11 Oct 2008
And yes – while all the readers here seem to be familiar with vim, here’s a tutorial on vi that I wrote for Linux For You magazine a while ago – feel free to share it with any friends learning vim. Couple of Windows sysadmin friends told me it helped them get up to speed on vi/vim pretty fast. Its quite short and clear, that’s why. Thought it’s for vi, everything in it works for vim (except the bit about vedit).
11 Oct 2008
Oops, forgot to give the vi tutorial link – here it is:
http://www.dancingbison.com/writings/vi_quickstart.txt
- Vasudev
11 Oct 2008
I haven’t learned this much about vim in a long time! Great comments. And great plugin, I’ve already installed it.
A couple maps I can’t live without are:
:nnoremap <c-l> gt
:nnoremap <c-h> gT
I use tabs a lot, so this makes it real easy to navigate left and right across tabs.
11 Oct 2008
I really like the Project plugin (http://vim.sourceforge.net/scripts/script.php?script_id=69). Vim 7 added tab support so I no longer need a plugin for that.
vcscommand.vim is pretty good as well.
11 Oct 2008
Forgot to add,
Welcome home, Jamis :)
11 Oct 2008
Why dont you use any of bigger IDE like Eclipse or Netbeans? All developers in 37signals are using simple editors?
11 Oct 2008
Thanks for this! Command-T was the biggest thing preventing me from using MacVim regularly.
11 Oct 2008
Is cmd-T like the :sfind command?
11 Oct 2008
This is a fantastic post. I found it on Reddit, and am glad. Welcome home to Vim! Love it.
11 Oct 2008
Hi. Thanks for this, works pretty nicely :-) Although I have a problem when I use an ‘autocmd’ to keep the working path to the file being edited… For example, with the following structure:
project/file1.c project/tests/in1
If my path is project/ and I use the plugin to edit project/tests/in1, the next time I use it to navigate to file1.c it tries to edit a “new” file in project/tests/.
Any way to fix it?
Thanks!
11 Oct 2008
@Joe, cmd-T is similar to :sfind, except it lets you match loosely on the pattern you enter. With sfind, for instance, the characters you enter must be exactly adjacent to one another in the file name. With cmd-T, they simply need to exist in the file name, in order, but not necessarily adjacent.
Also, cmd-T gives you real-time autocompletion of the files that match the pattern, as you type, which feels less like guesswork than sfind (and friends).
11 Oct 2008
@ttaveira, that’s really odd, I don’t see that behavior. I wonder if you have a plugin or something that is setting the working directory when you open a file?
11 Oct 2008
@Mike, Have you tried using tabs? :tabn <tabname> will give you a named tab. Cycle through tabs with gt… or use screen if you’re using a terminal.
11 Oct 2008
I was never a huge vim guy, but tried it out again recently because I really like modal editing, etc. I abandoned it again because rails.vim (or some other plugin) was making it so that when I did a git checkin I got an error. At any rate…
Being a neophyte at setting VIM up, I was wondering if you would share your plugins and configuration (file, directory, whatever).
11 Oct 2008
The fuzzy finder textmate is exactly what I had been looking for! I have been using rails.vim, buffexplorer and a few others. I also wanted to thank you for turning me onto MacVim—I’d been using the carbon version for a while and was not happy with the font rendering at all. MacVim is beautiful.
We need some place to share our entire vimrc+plugin configuration, I would love to see how you, and others (say Tim Pope) have everything set up.
11 Oct 2008
Your fuzzy_file_finder code reminded me of the Quicksilver string ranking algorithm, which has been ported to JavaScript:
http://rails-oceania.googlecode.com/svn/lachiecox/qs_score/trunk/qs_score.js
11 Oct 2008
Interesting. Last month, I did the same—only moving back to Emacs after having abondoned it for TextMate after switching to OS X. So I share your feelings of “homecoming” and rediscovery.
11 Oct 2008
Might I suggest trying out Komodo Edit: http://www.activestate.com/Products/komodo_ide/komodo_edit.mhtml
Has an awesome VIM mode, some great auto-completion and syntax checking features, plus much much more.
11 Oct 2008
Thirding the NERDTree recommendation! I love that plugin.
11 Oct 2008
Kudos, this is great work! How hard would it be to extend this script to fuzzy match cscope or ctags tag symbols? If I had that, I could finally stop using Slickedit.
11 Oct 2008
Does anybody know why this happens, and how to fix it?
In Debian/Ubuntu, after I install the vim-python packages (possibly before, too) whenever I am editing a python file, and want to write out a comment, I type the # (hash) symbol. But vim always moves the # to the beginning of the line on a new line. It ignores the smart autoindenting when I start to write a new comment. Why? How do I fix this?
11 Oct 2008
Nevermind, I found one solution:
http://vim.wikia.com/wiki/VimTip644
But it doesn’t work with >> to reindent.
11 Oct 2008
@Mike.. I set files which are readonly (in the filesystem) to be non-modifiable buffers like this:
” set modifiable state of buffer to match readonly state (unless overridden ” manually) function UpdateModifiable() if &readonly setlocal nomodifiable else setlocal modifiable endif endfunction
autocmd BufReadPost * call UpdateModifiable()
11 Oct 2008
One of my favourite vi commands is
:%sg
and another is to select a set of text and then run
:!fmt
Great for making sure comments are nicely word wrapped in a file.
11 Oct 2008
I love Vim, but the thing that keeps me from using it as my primary editor is the scripting language. It drives me to a rage every time.
11 Oct 2008
Vim is definitely my #1 choice, nevermind on which platform! For those who wants vim commands, I have listed 100 on my blog. http://www.catswhocode.com/blog/web-development/100-vim-commands-every-programmer-should-know-11
11 Oct 2008
MacVim supports a GUI plugin system, so you could add the project drawer right to the MacVim window. See http://groups.google.com/group/vim_mac/browse_thread/thread/d74a9ede4a5a8155/a003c75521f0d14f?lnk=gst&q=FileBrowser#a003c75521f0d14f for an example. Post to the vim_mac list if you need changes to the API.
Nico
11 Oct 2008
Awesome plugin. One thing that I would like is predefined filters to reduce the match list, e.g. by filtering out binary files (like *.o) and other generated formats. By predefined i mean you put them in your .vimrc or similar…
12 Oct 2008
I’ll definitely look at it :) I personnaly use project.vim and minibufexplorer.vim for file and buffers browsing.
12 Oct 2008
Just what the doctor ordered!
Unfortunately I can’t quite get it to work. I’ve installed the gem and in irb everything works swell. In a standalone program I can
require ‘rubygems’ reqiure ‘fuzzy_file_finder’
and again all is good.
But MacVim no likey.
The error while loading is:
Error detected while processing function InstantiateTextMateMode: line 17: LoadError: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’: no such file to load—fuzzy_file_finder
It’s as though the ‘require “rubygems”’ does not fire?
It works fine if I move the .rb file to my ~/.vim/plugin/ directory, but only if I launch MacVim from that directory!
I’ve spent fifteen minutes poking at it and moving “require ‘rubygems’” around in the file but to no avail.
Any hints gratefully received …
12 Oct 2008
The only reason I’m still using TextMate and not either Emacs or Vim is TextMate has Command-Shift-F and I use it at least every five minutes. Without that command, and the necessary idea of project (probably per window) to make it work, I think I’m stuck in TextMate.
12 Oct 2008
re #84, most likely you installed a different ruby (via macports, etc.), while macvim tries to use the ruby that ships with OS X.
Simple solution: take fuzzy_file_finder.rb and put it in ~/.vim/ruby (you’ll probably have to create the directory).
Harder solution: find the ruby executable that ships with OS X, and the corresponding ‘gem’ script, and use that to install the fuzzy_file_finder gem.
12 Oct 2008
Not only do I get the plugin I’ve been dreaming of but I get personalized tech support, too?!
Great!
That was exactly my problem, and now it works superbly. Thanks!
I notice that you don’t ignore internal spaces in the search string like Cmd-T does. Is that an intentional change on aesthetic grounds? I kinda liked it. I may slip it in.
12 Oct 2008
This is easily the best blog post + comment thread I’ve read this year…
12 Oct 2008
Anyone have a good suggestion for comment #85 concerning find in all files? The :grep command automatically opens the first file and you can only edit other files by typing in the number found in :clist. It would be better if it was like fuzzyfinder where you just scroll down to the file you want and start editing by pressing enter.
Also, I found a bug in fuzzyfinder_textmate where if you run FuzzyFinderTextMate in one directory then cd into another directory, FuzzyFinderTextMate still only searches among the files in the previous directory.
+1 vote for comment #34 where the pattern matches should be colorized instead of parenthesized.
Thank you, Jamis, for this great plugin!
12 Oct 2008
Another plugin I just found, that I can’t live without, is CSApprox:
http://www.vim.org/scripts/script.php?script_id=2390
It let’s you use Gvim themes in console Vim. It’s a new plugin, it seems (released 2008-10-05). The amount of good looking themes that I can use now is enormous!
13 Oct 2008
Great post and comments!
I am also coming home to Vim with MacVim. I’ll check out the plugin – thanks Jamis!
Currently using BufExplorer, Project, Rails.vim, SimpleFold, VCS and have integrated Javascript Lint checking based on http://thomas.tanrei.ca/javascript-lint-and-vim/ (but with “new” instead of “tabnew” in the function so that I can keep report and code together).
13 Oct 2008
Hey thanks, that’s a great idea. I love it. :)
Also, this really-tiny patch should silently avoid errors when the plugin hits directories it cannot read : http://cyprio.net/check_readable.patch
HTH.
13 Oct 2008
Something you might already know, running ’’ instead of specifying a mark will move to your position before the last jump. Then you can run ’’ again to jump back. Useful if you make an edit, then snoop around some code and want to jump back quickly.
13 Oct 2008
I use NERDTree.vim when I develop Rails apps. I only use it half of the time. I never used TextMate, so I have no idea if it is a good project drawer replacement or not. I do know it does what I want it to do: I can browse the project tree, and when I open up files from the tree, it does not collapse the drawer. It does use split-window though, so it might not be something acceptable for people who want native-Cocoa widgets.
13 Oct 2008
Is there a way to set a list of ignore regex/suffixes? If not, there should be :)
I’m a pythonista, and a web developer, which means I always have plenty of files lying around I couldn’t care less about editing. For now just ignoring pyc would be enough, but adding ’.svn’, known binary extensions, etc, would be nice. Couldn’t figure out how, so I added this change to the code in `fuzzyfinder_textmate.vim` for now:
after the `matches.sort_by …` line:
13 Oct 2008
@jmoiron, grab the latest version of both fuzzyfinder_textmate.vim and fuzzy_file_finder. I committed a change late last night that adds support for ignore patterns. See the README for fuzzyfinder_textmate.vim for a list of variables you can set (including g:fuzzy_ignore).
13 Oct 2008
@Jamis: Fantastic! You read my mind, then :) Great work on this plugin; and thanks for your contribution to the community!
13 Oct 2008
@Jamis, I just updated the gem and plugin. The ignore option works great, but find.rescan! seems to do nothing now. Is it just me?
13 Oct 2008
Just found out something else cool. If you read the docs for fuzzyfinder.vim, you will find some cool keystrokes (which in turn also work for fuzzyfinder_textmate).
When you have the file you want selected, you can do:
CTRL-] – open in new tab.
CTRL-j – open in split window.
CTRL-k – open in vertical split window.
I use tabs a LOT, so CTRL-] is AWESOME.
13 Oct 2008
I have to echo the “Macvim is awesome” remarks.
Not only that, the Macvim developer is awesome. He single handedly improved my Mac programming productivity about 50%.
I’m a blind programmer. Originally I ran on Linux in, believe it or not, Emacs. Then I switched to the Mac. But do you think I could find a decent editor? BBedit? No. It won’t work with the accessibility stuff for OS X and the author claimed to have no intention of it ever doing so. Textmate? No. Same problem, and the author said it was incredibly hard and he didn’t know if he’d ever do it. Emacs? No. same problem again. So I languished. I used Smultron. I used subethaedit. I hacked and struggled with applescript and tiny shell scripts and Quicksilver to get basic editors to be even slightly adequate. I even had to give up programming in python altogether due to the lack of really good indent and navigation support.
Admittedly that wasn’t all bad, it let me find Ruby, but still, that hurt. But then I found Macvim. At first it didn’t work, no cursor tracking, but one query on the Macvim list and a patch, and it worked brilliantly. And I love it. And I’m going to be committing heresy, but Vim fits my brain better than Emacs ever did. Talk about coming home to an editor.
13 Oct 2008
@Yvonne, that is an awesome story. Thanks for sharing that!
13 Oct 2008
I’d be screwed without the likes of
di) ya} da} ... etc.
== is a winner since i deal with a lot of generated XML
I love macros and repeating commands via ’.’
I’m also a fan of CTRL-]
I have to say that I need to get better at just general movement. I’m quick but need to get quicker.
Great post, praise be to VIM!
OJ
14 Oct 2008
Excuse the newbie question… But how do I set the new variables in .vimrc? I can’t figure out the syntax.
14 Oct 2008
<< @ttaveira, that’s really odd, I don’t see that behavior. I wonder if you have a plugin or something that is setting the working directory when you open a file? >>
Yep, I have autocmd BufEnter * exec ”:lcd %:p:h” to keep the path on the file being edited.
Any quick & dirty fix to that? :) Perhaps absolute paths?
14 Oct 2008
I found a similar plugin named lookupfile.vim. If you haven’t seen it yet, it would be nice to take a look to see how else to improve fuzzyfinder_textmate.
@Jens:
to set variable ‘asdf’ to 1, you can put this in your .vimrc:
let asdf=1
14 Oct 2008
@David Lee:
Thanks! What tripped me up was that Jamis had misspelled the variables in the documentation. g:fuzzy_match_limit should be g:fuzzy_matching_limit.
15 Oct 2008
Had a chance to play with this now, and it’s working great.
One of the things that annoyed me about TextMate’s cmd-T, and of course exacerbated by RESTful Rails projects, was the inability to filter the path as well as the file name. I usually have a lot of index files, sometimes under multiple namespaces, and the ability to slap in say “a/j/i” to drill to admin/jobs/index is a godsend.
I don’t have too many views outside of the typical REST action collection, so abbrebiated controller paths + first letter of action is a much more attractive proposition than scrolling down lists of index files in TextMate.
Nice one Jamis!
15 Oct 2008
Im getting the following error when invoking ”:FuzzyFinderTextMate”
Error detected while processing function FuzzyFinderTextMateLauncher..InstantiateTextMateMode: line 53: E121: Undefined variable: g:FuzzyFinderMode E116: Invalid arguments for function copy(g:FuzzyFinderMode.Base) E15: Invalid expression: copy(g:FuzzyFinderMode.Base) line 64: E121: Undefined variable: g:FuzzyFinderMode line 65: E121: Undefined variable: a:findstart E15: Invalid expression: a:findstart line 70: E121: Undefined variable: self E116: Invalid arguments for function <snr>10_HighlightPrompt line 77: E121: Undefined variable: self E15: Invalid expression: self.matching_limit line 91: E121: Undefined variable: self E15: Invalid expression: self.remove_prompt(a:base) E121: Undefined variable: l:limit E15: Invalid expression: l:limit NoMethodError: undefined method `strip!’ for nil:NilClass Error detected while processing function FuzzyFinderTextMateLauncher: line 4: E127: Cannot redefine function FuzzyFinderTextMateLauncher: It is in use line 5: E121: Undefined variable: g:FuzzyFinderMode
I did the gem install, and added the .vim script in my ~/.vim/plugin dir.
When i run ‘vim—version’ I see that i have ruby support.
I’m running Linux with vim 7.1.
15 Oct 2008
@Jens, whoops. I’ll fix the docs today.
@savvy, did you install the fuzzyfinder.vim script, as well as the fuzzyfinder_textmate.vim script?
15 Oct 2008
I noticed that a few people above were asking for a set of Rails based Vim plugins/configurations. I store my Vim config on github. Here it is if anyone’s interested:
http://github.com/manalang/vim-config/tree/master
It includes everything you need for Rails dev (JS, HTML, CSS included). It also includes Jamis’ supercool fuzzy_finder_textmate plugin. Just do a:
git clone [email protected]:manalang/vim-config.git
Then:
mv vim-config ~/.vim mv ~/.vim/.vimrc ~/.vimrc
Enjoy!
15 Oct 2008
My vim tip:
Searching with / takes an offset. The offset allows to move the cursor after a match is made. This is very handy when combined with .
Given this string: “blah blah blah”.
Let’s say we want to replace the first and third occurence of ah, with AH.
/bl/b+2 # => searches for bl and moves the cursor on top of a cwAH<esc> # => changes the ah to AH n # => go to second match n # => go to third match . # => change third match
:h /
15 Oct 2008
Err, silly formatting. That should be:
15 Oct 2008
@jamis, i indeed forgot to install fuzzyfinder.vim script.
I however still with a problem, when i open up the :FuzzyFinderTextMate and select a file from the list get the following error instead of vim opening up that file:
—User defined completion (U^NP) Pattern not found
I must be doing something wrong :)
16 Oct 2008
Good vim integration in bash as well:
set -o vi
export FCEDIT=vim [ctrl-x-e] # press ctrl-x-e keys
see http://codesnippets.joyent.com/posts/show/1625
16 Oct 2008
This is great. One thing I can’t figure out is how to get it to learn about newly created files. Is there something simple I’m missing? Thanks.
16 Oct 2008
@Brian, you need to tell it to rescan the project:
It doesn’t automatically rescan, unfortunately.
16 Oct 2008
Vim + NERDTree works great.
Tabs and a file tree all in one vim plugin
16 Oct 2008
This is very cool =)
Only issue I’m having is trying to alternate different g:fuzzy_roots - I can let and unlet g:fuzzy_roots, but FuzzyFinderTextMate seems to only search what every directory tree’s were in g:fuzzy_roots when it was initially loaded.
I’ve tried :ruby finder.rescan! but that didn’t seem to make any difference. Any ideas?
17 Oct 2008
@Dave, the fuzzy_roots are set when the finder is instantiated, and once instantiated, the instance is cached. You can force it to be reinstantiated by doing something like this:
And then running the fuzzy finder again.
18 Oct 2008
Cool. Exactly what I was after. Thanks for that =)
I’m not sure if you’ve already looked at Project? (http://www.vim.org/scripts/script.php?script_id=69), but I’ve been using that for a while, and find it pretty handy.
Instead of just browsing fs directories, you set up the specific files in the project you’re interested in, and you can set it to run arbitrary scripts when you enter/exit a working directory. This lets it integrate very well with FuzzyFinderTextMate – I’ve created an “in.vim” for each project that looks something like:
let code='/home/dgs/code/uwh/' let g:fuzzy_roots=[code."app", code."config"] ruby @finder = nil
Which will automatically flip it to the new fuzzy_roots dependent on what files you’re currently working on. Very handy =)
18 Oct 2008
Unfortunately it doesn’t look like colorizing the matching bits is even a possibility. I spent quite a while trying to get it working, and it turns out that there aren’t any real options for colorizing specific parts of the text in that autocompletion popup menu. More info here: http://vim.dindinx.net/vim7/html/insert.txt.php#popupmenu-keys
For fun, I asked around in #vim, and got the same answer. I tried even tried using the terminal escape codes for colors, even though that would be a pretty poor solution, and those get ignored when the menu is generated.
Oh well, maybe in a future version of Vim. Thanks for the plugin!
18 Oct 2008
The last Vim color scheme you’ll ever need
http://blog.infinitered.com/entries/show/8
Just my two cents.
20 Oct 2008
@jamis: Thanks for the post. It echos much of my same feelings re: Textmate and Vim for OSX peeps.
http://www.martini.nu/blog/2008/07/vim.html
One of my standby tricks when dedicating a vim session to a particular project is to always do a “set path=**” and :chdir to the project’s location.
Then, I rarely (if ever) use the regular :e and :sp commands for opening buffers, instead using :find and :sf, which search against the path variable. Very handy.
Where this falls short is when you’ve got two files with the same name—:find only gives you the first. I’ll definitely be checking out your plugin to get around this (I’m using the regular fuzzyFinder at the moment.)
While I’m here, I’ll pimp two other creations… ;)
A different RSpec integration with Vim (that capitalized on what I describe above): http://www.vim.org/scripts/script.php?script_id=2286
Automated Vim plugin builds using Vimball+Make: http://vim.wikia.com/wiki/Using_VimBall_with_%27Make%27
The last thing I’m looking for that I feel would really make things “complete”—is a “find in project” for Vim. I can’t seem to find one that allows cherry-picking files to apply the search/replace to. :vimgrep is close, but no easy “multi-select and apply.” If anyone here knows of something that replicates that sweet shift-cmd-F action… holler at me. :)
20 Oct 2008
sorry to come late to the party but shouldn’t
def initialize(directories=[’.’], ceiling=10_000, ignores=nil)
be
def initialize(directories=[’.’], ceiling=10000, ignores=nil)
???
http://github.com/jamis/fuzzy_file_finder/tree/master/lib/fuzzy_file_finder.rb
Anko
20 Oct 2008
nevermind, they are equivilent – my directory was just really really big!
20 Oct 2008
Great article… but… an OSX GUI version of Vim called MacVim ? Hmmm… my initial WTF’s:
1. I use Vim, as it is portable. Jump into any machine, and you’re good to go. Getting comfortable with a specific machines GUI version of the program seems odd.
2. Any programmatic sequences that you could set in MacVim could be done in Vim, albeit, probably not as easy I’m assuming. But… if Vim is your primary editor, it is a good idea to be familiar with it’s configuration and customization options.
3. Vim works fine on OSX. Why use something else ? anti-aliasing ?
Any feedback that could possibly point a Vim purist in another direction would be appreciated ;)
21 Oct 2008
@D, MacVim works exactly like Vim, as you said. If I “get comfortable” with macvim, I’m not digging myself into any holes, as I’ll be using the same key bindings and same config options via any command-line vim.
The benefit of a GUI version, as I see it, is the ability to differentiate multiple open vim windows from my multiple open console windows. If I only use console windows, then everything looks like a console window, both in the alt-tab switcher, and in the dock. Using a GUI, MacVim has it’s own icon.
Then again, if you’ve not felt this particular pain, then you’re definitely not the target audience for MacVim. Don’t go lording it over us lesser vim users, though. Let’s just agree that different people have different preferred development environments.
21 Oct 2008
I use vimblog.vim (vim ruby script, based on Brad Choate’s Textmate blogging bundle) to post, edit, del, list, publish/draft blog articles, so that when you are coding and have an urge to post something, related or not, do:
:new # new window :Blog np # new “blank” formated post #write… :Blog publish # publish article and receive formatted article from server
Or if you need to get a quick list of articles from the blog: :Blog rp # get 10 (default) most recent posts :Blog rp 15 # get 15 recent posts :Blog gp 144 # get (fetch) post 144
screenshots: http://www.flickr.com/photos/keynote/446153651 http://www.flickr.com/photos/keynote/397369388/
script here: http://blog.tquadrado.com/?page_id=146 or at vim’s: http://www.vim.org/scripts/script.php?script_id=2030
21 Oct 2008
MacVim as part of a cross-platform desktop workflow setup:
http://writequit.org/blog/?p=171
22 Oct 2008
Man, your script is awesome! I’ve never had heard about fuzzyfinder before, and now I love it! Fuzzyfinder_textmate just makes me even happier with that!
Thank you very much!
23 Oct 2008
Jamis,
:e [file] has been fine for me to find files but I’ll be taking fuzzy_file_finder for a test drive now. Thanks for your work on that!
If you like the project drawer of TextMate, as many of us do, NERDTree is a great alternative (as others have mentioned). Here is a screen shot of it, from one of my old posts: http://www.ktaylor.name/2007/03/crossplatform_t.html
Regarding favorite commands, that would be my mappings for moving between split windows using CTRL+h,j,k,l keys!:Cheers!
23 Oct 2008
TextMate Footnotes With VIM Support
http://blog.commonthread.com/2008/6/11/textmate-footnotes-with-vim-support
(from yet another vim switcher)
23 Oct 2008
:set gdefault
23 Oct 2008
Whenever I start MacVim through the mvim command I get this output on the terminal:
Error detected while processing function InstantiateTextMateMode: line 17: NoMethodError: undefined method `-@’ for nil:NilClass ~/config[master]% Error detected while processing function InstantiateTextMateMode: line 17: NoMethodError: undefined method `-@’ for nil:NilClass
any idea’s??
23 Oct 2008
I added an extension similar to yours, but I think it might be more functional and more buggy :(
http://viming.blogspot.com/2008/10/file-lookups.html
24 Oct 2008
Jamis, couldn’t find a way to contact you otherwise, so here goes. Don’t suppose you’d be willing to share your original code for the NPC generator that used to be hosted at arrg? I’m a web developer with too much time on my hands, a new group of folks I RPGee with and a need to populate the world I’ve developed with NPCs. Drop me a line if you’re interested in passing the torch, or, even if I could host the script and get in back into the public domain. Thanks!
Joel Bailey
24 Oct 2008
@Joel, the code for the NPC generator (and my other generators, fwiw) is all on github: http://github.com/jamis/dnd-npc/tree/master. I’ve released it all into the public domain, so do what you will with it. Enjoy!
24 Oct 2008
I have a “Best Of Vim” page on my wiki:
http://notesmine.com/vim_best_of
I also have my Vim config files on github:
https://github.com/Tookelso/vim-dotfiles/tree
I do a lot of Groovy/Grails programming, which has a lot of the same needs as Ruby/Rails. I can’t stand how slow IDEs are, and Textmate really never did it for me, either.
27 Oct 2008
Not sure what I’m doing wrong here but How do exclude the vendor/rails directory ?
Thought this would work :
let g:fuzzy_ignore=’vendor/rails/’
Great plugin BTW
Thanks
28 Oct 2008
@cryso You no longer need this with the latest MacVim. The latest MacVim supports a URL handler:
mvim://open?<arguments>
Just add this to your environment.rb:
Footnotes::Filter.prefix ||= ‘mvim://open?url=file://’ if RUBY_PLATFORM.include?(‘darwin’)
28 Oct 2008
@Justin, the fuzzy_ignore setting only ignores files, not directories. (Insane, I know, but the feature was originally intended to ignore things like *.o or *.pyc, etc. You can maybe try setting g:fuzzy_ignore to ‘vendor/rails/**’, until someone submits a patch to improve the ignore support.
28 Oct 2008
Thanks Jamis , great work as always. $20 bucks in the tip jar for this and cap. Justin
29 Oct 2008
I cannot get this work without getting FuzzyFileFinder::TooManyEntries. I thought ignoring files would do it, or setting a high ceiling would do it, but no dice. Any suggestions?
29 Oct 2008
@Justin, thanks! You rock.
@Karmen, setting a high ceiling will do it. Either you’re not setting the ceiling right, or you’re not setting it high enough.
29 Oct 2008
@jamis, I bumped it ridiculously high and yes it did work. Now, I’ll fine tune it for speed. Thanks!!
29 Oct 2008
I got a tremendous speedup after I set g:fuzzy_roots to specific locations. This is awesome stuff!
29 Oct 2008
Hi Jamis,
Just thought I’d throw my setup into the fray;
I’ve set my make program to rake and mapped tests to ”;mt”. I think I will have to sit down and look at your plugin for sure!
Cheers,
Nathan
31 Oct 2008
A number of people I know have been having similar thoughts. With erb I was loving me the snippets, but now that I’ve switched to haml I don’t use snippets at all.
1 Nov 2008
I recently copied my vimrc and plugins from my home machine to my work machine and started getting the following error when I ran the textmate fuzzy finder:
Error detected while processing function <snr>11_CompleteFunc…160: Line 27: NoMethodError: undefined method `times’ for nil:NilClass
Turns out the problem was that I had some directories defined in the g:fuzzy_roots array in my vimrc that existed at home but not at work.
Just figured I’d post this here in case it saves someone some headscratching.
3 Nov 2008
As I told you tonight on Twitter, I’m trying to keep going with the same transition. Right now I use Vim for all of my text editing and find it enjoyable, but what you have here might just push it over the edge to a full “love/love” relationship between the two of us.
11 Nov 2008
This is a fantastic plugin. Thank you!
14 Nov 2008
@Jamis said: “Don’t go lording it over us lesser vim users, though. Let’s just agree that different people have different preferred development environments.”
Aha ! I wasn’t lording at all, but sincerely wanting to know how MacVim helped out, and why you prefer it.
Another case toward the belief that editor threads seem to be the case of highest flame-age, and quick to chap someone’s hide :)
I do love these Vim posts. It’s great to see someone of your stature posting about it, and getting more people involved… in the best editor in the world !
:)
17 Nov 2008
wow, you had to go and just ABSOLUTELY MAKE MY DAY!
Here is the absolute best feature of Vim. An’ ya’ll just remember how jz hooked you up aight? big ups!
Mac users that ssh to where they use vim make sure you have X11Forwarding enabled on the /etc/ssh/sshd_config (ubuntu) and then when you log in to your shell you’ll be using the REAL Vim. None of this hax0red MacVim cocoa garbage. I’ve written cocoa, i’ve written rails, I know all about you girly frameworks, I also know this little language .. his name is C. Vim is written in C. Let your girlfriend make the cocoa!
So yeah, the tip!
(in sshd_config) X11Forwarding yes X11UseLocalHost no <leave>make sure you slap her with some SUDO!
sudo /etc/init.d/sshd restart
From the leopard you will no longer use the pitiful and defunct Terminal.App. Me and my crew spit on Terminal.App. That is, one we got wit mz. iTerm. Yeah, man, iTerm got this naughty feature- check it. With iTerm the mouse actually works in x11 apps properly so I go to write me some c0d3z with a :
vim newMasonsKrew.nf0y0
now checkz it:
:set mouse=a
bingo-bango-shake-yo-thang-yo cuz now you cookin wit gazolin3.
please people change your default port, don’t make us hax0r your boxes
..
again.
..
if you need our help, we are a l3@d3r$ of the pack .. that is .. we are extremely sarcastic programmers that love vim and the far out places it takes our minds. find us on our irc server eyearesee.saur.us.
move with it shake with it. aight.
jz
18 Nov 2008
My favorite command for editing emails is ‘v+a+p+g+q’.
18 Nov 2008
Awesome!
24 Nov 2008
After using this plugin for several weeks, I gotta say it still is rockin’ my world. Thank you Jamis.
25 Nov 2008
Jamis, still getting this “error”on the commandline after starting MacVim with the mvim command
Error detected while processing function InstantiateTextMateMode: line 17: NoMethodError: undefined method `-@’ for nil:NilClass
Any Ideas?
26 Nov 2008
Hi Jamis, is there a way to issue a refresh of files indexed by the plugin? Whenever you :cd away from the starting :pwd, it won’t find the files inside the new :pwd. Do you see what I mean? This post and this plugin are 2 big reasons I’m back to Vim after years of pointless wondering in the land of Productive Editors™. Cheers, Francesco
30 Nov 2008
@AdulteratedJedi, I’m afraid I’ve no idea why that’s happening. If you figure it out, please post an update.
@flevour, you can refresh the index by issuing this vim command:
I need to package that in a more sane vim function, but in the meantime it’s not hard to map that to something yourself.
2 Dec 2008
I’ve found out that one can do this
mvim—remote-send ’:ruby finder.rescan!<cr>‘
Just trying to create a Daemon to watch for files/dir and send that command when there are new ones.
Should make for a better textmate like experience :-)
4 Dec 2008
This is great, thanks! Small FYI, seems that fuzzyfinder.vim has renamed the matching_limit variable in the latest (12-02-08) release, which breaks fuzzyfinder_textmate. Using fuzzyfinder.vim V2.13 works just fine though. Thanks again1
4 Dec 2008
This is a really cool idea! It’s not a function I really used in TextMate because the drawer was excellent, but I’ve not been able to find something so versatile for Vim. However, as ek says, this doesn’t work with the latest version of fuzzyfinder.vim (2.16).
I’m a relative beginner to Vim. I’m primarily a web developer and I do a lot of my work over secure shell connections. This obviously means that TextMate doesn’t play (without great pain on my part), so I took to installing Vim and having a play around. Needless to say, it blew nano out of the water and after having played with MacVim and reading the docs to add support for things I want (NERDTree, fuzzyfinder, surround, closetag) I really love it. I’m trialling it as my full time editor right now, and it’s going very well.
The only thing that annoys me now is that I find myself hitting escape and trying to navigate text in other apps now. Mildly annoying, but more “damn, I’m stupid”!
15 Dec 2008
One thing, it only seems to ever search through the highest directory it’s indexed. For example, if it’s indexed from ~/, then I can only ever perform searches from there, which is obvious slower if I’ve :cd into ~/Freelance/ and only want to be looking for files in that directory. Have I missed/misunderstood something obvious?
15 Dec 2008
@Jamis: I have been thinking of switching over to another operating system besides Windows (most prob Linux even though the learning curve is steep). I was just wondering why you switched over to the Mac after Linux (good insight on vim, but you didn’t mention the reasons for switching)?
In my limited knowledge i assume the Rails Core Team developers use MACS and deploy on LINUX servers.
24 Dec 2008
@Jamis: On Ubuntu, I’m trying to use FuzzyFinderTextMate but it gives me an error saying:
E492: Not an editor command: FuzzyFinderTextMate
Do u know what the problem be? I’ve installed everything just like the README says at your GitHub page.
Thank you very much!
4 Jan 2009