3 ms·
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
by mcav 17y ago
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?
- rubbish 17y agoM-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.).
- gcv 17y agoQuite 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.
- philjackson 17y agoAs a side note; check out find-cmd.el (comes with 23).
- mechanical_fish 17y agoAnd, amazingly, you managed to get through this whole list without mentioning igrep-find, which is what I've been using: http://www.emacswiki.org/cgi-bin/wiki/igrep.el http://www.emacswiki.org/cgi-bin/wiki/igrep.el A lot of people have attacked the grep problem in emacs.
- mdemare 17y agoI 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.)