Introducing the File Finder
github.com
github.com
Previously if I had to do it more than once I would copy the gem to disk, import to Netbeans, and then use Netbean's equivalent function. (Which I use so frequently during development I should really map it to, I dunno, tab.)
com/ => company/ => moar_hierarchy/ => etc/ => even_more/ => files
Clicking though all of those empty directories, even with new slide from earlier this year, was still a pain in the butt.lets you type
gem edit <gem>
and it opens the gem dir in your $EDITORbundle open <gem>
$ echo $GEMEDITOR
editgem.sh
$ cat ~/bin/editgem.sh
#!/bin/sh
cd $1 && mvim $1You don't need that if you put everything in OneBigFile. Mine is 24KLOC. http://simplijs.com/OneBigFileFormat
Modern editors can handle big files.
BTW: I'm still looking for an editor that could open multiple files in a single buffer/window.
"Search" is my friend to move around in my one big file.
I think of it like a the same shift introduced by Google Mail with their "label" thing. At the time it was quite disturbing, we used to classify mails in hierarchical directories. Nowadays, when I want to retrieve a msg, do I navigate a directory structure? No. I just "search".
Same for source code.
You'll probably enjoy that.
Problem is, grasping what they means turn to be difficult, it's like wherever you look you just have to look elsewhere and feel like the real job is done... no where. You basically struggle to get the "big picture".
Well... it's probably better than Forth.
There is more than one way to do it. I don't split a big function in two until the other function is called from at least two places. What's the point of having a function when all calls to it come from a single place?
But let the code speak, have a look at mine if you wish, this nice javascript loader for example http://simpliwiki.com/loadfire.js.html -- extracted automatically from my one big file of course. :)
;-)
It's speedy too. I fired up Chrome Inspector and it looks like it works by Ajaxing in a full list of files in your repo the first time you hit "t", then doing the actual searching in the browser. Here's the URL it loaded for one of my projects:
https://github.com/simonw/bugle_project/tree-list/1c7793bf60...
I can also tell it to open what it finds in vim.
But I probably use the "grep files of a certain type for a certain string and open them in vim" version more often.
And no, I don't think Bespin/Skywriter/Ace is good enough right now.
1. I create a TAGS file with exuberant ctags (not the default etags - note that both have a file called etags, to find out which one you have, issue `etags -v`.).
2. Use the ido-find-file-in-tag-files mentioned here: http://www.emacswiki.org/emacs/TextMate Answer 3, mapped to `C-x C-g`.
This might be a bad choice due to C-g, but it's close to C-x C-f, so I prefer that.
I would love to see a similar grep-type feature, where I can quickly search through the files in a repository for text. (Yes, I know there's advanced search, but that's so disruptive to my code reading.)
More seriously, I wonder if this would be an interesting direction for GitHub to move in; sorta picking up where Heroku left off. They already do let you edit files via the web, it'd just be keybindings... and a ton of other details since I know nothing of GitHub's internals.
In fact, that's probably a terrible idea. But something to think about...
Github also has very good keyboard shortcuts in the Issues section. Gmail shortcut users will feel right at home.