BBEdit + JavaScript + Ctags

After some trial and error, I finally got BBEdit to play nicely with Exuberant Ctags to expose the Find Definition functionality. This feature comes in especially handy as your project grows and you need to quickly look up the definition of various methods and functions without breaking your mental flow to go look them up manually.

Since BBEdit comes bundled with a version of Ctags, all you need to install are BBEdit’s command line tools via BBEdit > Install Command Line Tools… (in addition to BBEdit, of course).

Unfortunately, Ctags doesn’t work very well with JavaScript out of the box, so you’ll need to create a .ctags file and place it in your home directory with the contents of the following Gist (via Jan Larres):
https://gist.github.com/jonbeebe/d98b21cbd2f1f1670a93

Next, download Maketags.applescript (via Andrew Carter) and place it in your BBEdit Scripts folder. By default, that is: ~/Library/Application Support/BBEdit/Scripts

Whenever you need to update the Ctags for your project, just select Maketags.applescript from BBEdit’s Scripts menu and a tags file will be generated and placed in the top-level folder of your project (you’ll want to ignore this file in your VCS of choice if you use one). BBEdit knows about this file and picks it up automatically. When that happens, certain symbols will now be highlighted a different color and you can use the Find Definition feature via right-click or Cmd + -. You’ll need to run the script again anytime you want new definitions to be picked up.

 
1
Kudos
 
1
Kudos