2 ms·
Fast fuzzy search across your entire project is called grep. Why do we keep rediscovering tools that have existed for such a long time? Edit: I suppose people
by IgorPartola 15y ago
Fast fuzzy search across your entire project is called grep. Why do we keep rediscovering tools that have existed for such a long time?
Edit: I suppose people keep rediscovering these tools because even if they use vim, they often times insist on running it as a stand-alone GUI application, rather than in a terminal emulatir where the built-in task switching/multitasking makes it very easy to run complex shell commands, move files around, use your VCS and switch back to your editor. Another benefit is that now you can have the exact same work environment over ssh as locally.
- danieldk 15y agoFirst, grep requires specify intermediate characters. For instance, to match SublimeText, you need the regular expression 'S.*B', while in Sublime you could just type 'SB'. (Neither is better, they just serve different purposes.) Second, grep is not comparable, it's a different tool. For instance, if you would want to open the openCorpus function in the file MainWindow.cpp, in Sublime you'd just type "MWcp@opC", and you are there. While typing the pane and window dynamically update, allowing you to narrow down the 'search space' quickly. Grep is for searching for text strings in files in the shell or shell scripts. Sublime's Goto Anything is for searching files and symbols in a text editor. Edit: I like and use both vim and ST2, but neither grep, ctags, nor Peepopen provide the smooth experience of 'Goto Anything'. Of course, conversely vim also has many things to like over ST2 (such as modeful editing that is definitely better than ST2's Vintage).
- gabyar 15y agoNope, fast fuzzy search is closer to find than grep since it looks for files. But it requires less keystrokes and precision, allow you to be lazier. It's a much more fluid experience. I still use grep a lot while using ST2, but I use it for other purposes.
- cmurphycode 15y agoI think one huge benefit is the "instant"-esque nature of a find as you type fuzzy search in a GUI. In Bash, you can do incremental (find as you type) history search with Ctrl+R. Something analogous for grep would be fantastic. Displaying more than one result at a time would also be great. Another thing that grep/find lacks is a index that could make large fuzzy searches faster, but clearly that can be added too.
- losvedir 15y agoThree key differences: 1) The search occurs as you type, so you don't need to specify more of a query than you need to. 2) ST2 searches delineate between searching file names and searching file contents, (with, e.g. "#") and you can combine both in a single query, if you want, to go to a particular location in a particular file. 3) At the end of the search you can hit "Enter" to go to the found file and edit it, or "Esc" to return to where you were before the search (which is great for just poking into another file to check something). In fact, thinking about it now, they're quite different. The thing that grep excels at can't even be done easily (that I know of) in ST2: "I'm looking for this function called xyz, but I don't remember which file in this directory it's in."
- batista 15y agoFast fuzzy search across your entire project is called grep. Why do we keep rediscovering tools that have existed for such a long time? Yeah. And a car is called a horse carriage. Why do we keep rediscovering tools that have existed for such a long time? (facepalm) Grep does not: 1) know about the scope of the project, i.e what files to search, without instructed so specifically. 2) have knowledge of code structure (methods, classes, etc). So "fuzzy" here means just using regex. 3) does not know how to present you with the results in a way that you can open quickly in tabs, etc.