top | item 907027

Nice Find: An asynchronous find in project plugin for TextMate

53 points| naz | 16 years ago |github.com | reply

25 comments

order
[+] kneath|16 years ago|reply
This seems like a good effort, but I think I'll stick with the tried and true ack-in-project http://github.com/protocool/ack-tmbundle

No beachballs, and you get the crazy awesome speed of ack.

[+] naz|16 years ago|reply
I used ack-tmbundle before creating nice_find, and it drove me mad for two reasons. Firstly, the command doesn't work from the project unless you have one of its files open. Secondly, pressing the hotkey to bring back your search results will display a modal dialog over your results.

It's not the developer's fault, they did a great job. It is limitations of being a tmbundle. If you look on AIP's lighthouse page you will see that they can't resolve these problems. That's what drove me to write a plugin instead.

Also Ack (a perl script) is slower than grep -r and git-grep ignores all the irrelevant files. But feel free to fork it to use Ack.

[+] mcav|16 years ago|reply
This is going to be immensely useful.

I've one unrelated question for emacs users, since I'm trying to wean myself off of TextMate: How do you accomplish this same type of "find-in-multiple-files" in emacs?

[+] gcv|16 years ago|reply
Quite a few ways.

1. Start with M-x rgrep, it may do everything you need.

2. If not, M-x find-grep lets you run arbitrary grep commands. You may wish to customize grep-find-command to some reasonable default, e.g., mine:

    (setq grep-find-command
          (concatenate
           'string
           "find . \\( -path '*.svn' -o -path '*.git' -o -path '*.hg' \\)" 
           " "
           "-prune -o -type f -print0 | xargs -0 grep -I -i -n -e "))
3. If you want to just search open buffers, you may find M-x multi-occur-in-matching-buffers useful. I use this simple wrapper, which you invoke using M-x search-all-buffers:

    (defun search-all-buffers (regexp)
      (interactive "sRegexp: ")
      (multi-occur-in-matching-buffers "." regexp t))
4. You may find filtering files and query-based search replace useful, in which case you should try dired-mode. It does a lot, so try marking files (look in the Mark menu for various options), then operate on them (Operate menu). For example, hit "% m" to mark files by name regex, type "\.[c|h]" to mark all C and header files, then press "Q" to start interactive search-and-replace through all marked files.

5. I don't know of a direct equivalent to Nice Find, e.g., basing a search on "git grep" output, but if you look through the various Git modes, you may find something useful.

[+] rubbish|16 years ago|reply
M-x rgrep

That's one option. There's also find-dired. I also believe there are a bunch of different extensions that can do this as well (find-in-project, etc.).

[+] mdemare|16 years ago|reply
I have the same question, but for Vim. Also, for find-and-replace.

I think it requires a plugin, but I'm baffled why it isn't there out-of-the-box. (Unless it is there, and I haven't found it yet.)

[+] iloveyouocean|16 years ago|reply
I installed the bundle. Now when I open a TextMate project file, and try cmd-shift-f, NiceFind will search in the parent directory of the TextMate project file, but not through all of the files in the project.

??

[+] naz|16 years ago|reply
You're using tmproj files? I'll add support for those to the "coming soon" list, I have only tested on folders as projects so far. Sorry about that. You can remove the plugin by removing:

~/Library/Application\ Support/TextMate/Plugins/NiceFind.tmplugin

[+] tlrobinson|16 years ago|reply
Now if only TextMate didn't hang when loading a large directory, or a directory containing a circular symlink path...
[+] jpcx01|16 years ago|reply
I'm excited about this app. It's barely usable (doesn't respect textmate's file ignore patterns, no replace, and it doesn't report progress very well). But, it's fast, and hopefully it continues progress to make things a bit cleaner.

However... god damn, is Textmate ever the saddest project I've ever seen. Why the fuck are we still using this abandoned app? Seriously...

[+] naz|16 years ago|reply
We keep getting told TM2 is around the corner and we keep believing him. As for the lack of features, I thought I'd release early and iterate :)
[+] naz|16 years ago|reply
It now does respect textmate's file ignore patterns. Enjoy