VIM Programming Bounty: FuzzyFind inside Files

(Note: I have updated this posting with some more info on what I am looking for)

Since I make a little bit of money every month in advertising off this blog, I thought I’d put some of this money to good use. I’ve been trying very hard to use vim as my editor for day-to-day use. Previously, amidst lots of waffling, I had settled on TextMate for my day-to-day work. Awesome editor, nice and lightweight and full of the cool features I needed. There were two features that were stopping me from totally switching over.

First one was Cmd-T inside a project, which allows you to search through your project doing a fuzzy search for files that match your search string. Awesome, awesome feature. Cuts down on the browsing using the project drawer that I tended to do. That particular hurdle has been fixed thanks to Jamis Buck (of Capistrano and 37 Signals) through his FuzzyFinderTextmate plugin. It’s extends the fuzzyfinder.vim plugin with a little bit of Ruby. Does the trick, but you have to do a little jiggering to get it to recognize new files. An argument for another day I guess.

The second one is the also-awesome ‘Find In Project’ feature in Textmate, which searches through all your files looking for matches for the string (or regex if you’re up to it) inside those files, then providing you with a list of files that you can open. I’m wanting functionality similar to how the fuzzyfindertextmate plugin referenced above works, but for searching inside files.

I am aware of how :vimgrep and :grep work (thanks to those who pointed it out), but I do not like how the quickfix window works, as I want a dropdown list of the files that contain what was found so I can open them. Again, very similar as to how the FuzzyFinderTextmate plugin works.

So, I am offering $100 of my own ill-gotten advertising revenue (payable via PayPal) to the person who comes up with the solution I like the best that actually works. If you don’t want the money, I can donate it to the charity of your choice as long as they will take PayPal as well.

I know *someone* out there can figure this out. I’ll give you until American Thanksgiving to come up with a solution. Please post your suggestions in the comments, but please realize that all comments are moderated and off-topic ones will definitely be sent to /dev/null

Article Tags >> || ||

6 Responses to this post.

  1. Matthew Weier O’Phinney's Gravatar

    Posted by Matthew Weier O'Phinney on 20.10.08 at 9:15 pm

    What you’re looking for is vimgrep, and I’ve written up a tutorial just for you: http://weierophinney.net/matthew/archives/194-Vimgrep-and-Vim-Project.html

  2. Michael B Allen's Gravatar

    Posted by Michael B Allen on 20.10.08 at 9:15 pm

    #!/bin/sh

    if [ $# -lt 2 ]; then
    echo “usage: rgrep \”\” \”\”"
    exit
    fi

    find . -name “$1″ -print0 | xargs -r0 egrep -H “$2″

    #end shell script

    Use like:

    $ rgrep ‘*.php’ ’someMethod\(’

    Note the quotes are necessary around the glob to prevent the shell from expanding it. Similarly you will meed to escape any characters that the shell might try to interpret.

    Mike

  3. Chris Hartjes's Gravatar

    Posted by Chris Hartjes on 20.10.08 at 9:15 pm

    @Michael

    Yeah, I do know how to use grep so this doesn’t help me that much. I’m looking for something that does the following

    1) provide me with an interface to search for something
    2) run it through vimgrep
    3) present me with a pop-up window where I can pick the file I want to open from a list

  4. francois's Gravatar

    Posted by francois on 20.10.08 at 9:15 pm

    have a look at PIDA: best of both world Vim Power and user friendly GUI

    http://pida.co.uk/

  5. Brendon's Gravatar

    Posted by Brendon on 20.10.08 at 9:15 pm

    why not try the project plugin,
    http://www.vim.org/scripts/script.php?script_id=69

    move over to that window and search for any string
    /somefilename/

    Or try out the nerdtree plugin
    http://www.vim.org/scripts/script.php?script_id=1658
    click O on your root project folder
    /somefile/

    and just use n or N to go thru the results, when you get a match click o to open the file.

  6. Dane Summers's Gravatar

    Posted by Dane Summers on 20.10.08 at 9:15 pm

    I have something that *might* work for you - its like fuzzyfinder…I never got around to publishing it til now b/c its a little buggy. But I *think* its what you are looking for.

    http://viming.blogspot.com/2008/10/file-lookups.html

Respond to this post

Want to advertise on this blog? Send email to chartjes@littlehart.net
GTcars Canadian Car Audio TurboDodge Audi Forum
Mustang Forum Dodge Intrepid Miata Turbo
GTscene Pontiac Bonneville