Symbols View setting page
In Atom, by default there's a package called symbols-view. It basically allows you to search for particular functions, classes, variables etc. Most often not by typing but by search based on whatever word the cursor is currently on.

With this all installed and set up I can now press Cmd-alt-Down and it automatically jumps to the definition of that thing. If the result is ambiguous (e.g. two functions called get_user_profile) it'll throw up the usual search dialog at the top.

To have this set up you need to use something called ctags. It's a command line tool.

This Stack Overflow post helped tremendously. The ctags I had installed was something else (presumably put there by installing emacs). So I did:

$ brew install ctags

And then added

alias ctags="`brew --prefix`/bin/ctags"

...in my ~/.bash_profile

Now I can run ctags -R . and it generates a binary'ish file called tags in the project root.

However, the index of symbols in a project greatly varies with different branches. So I need a different tags file for each branch. How to do that? By hihjacking the .git/hooks/post-checkout hook.

Now, this is where things get interesting. Every project has "junk". Stuff you have in your project that isn't files you're likely to edit. So you'll need to list those one by one. Anyway, here's what my post-checkout looks like:


#!/bin/bash

set -x

ctags -R \
  --exclude=build \
  --exclude=.git \
  --exclude=webapp-django/static \
  --exclude=webapp-django/node_modules \
  .

This'll be run every time I check out a branch, e.g. git checkout master.

Comments

Your email will never ever be published.

Previous:
Whatsdeployed on only one site February 26, 2016 Python, Web development, Mozilla
Next:
Web performance optimization's dark side March 16, 2016 Web development
Related by category:
fnm is much faster than nvm. December 28, 2023 macOS
Set up iTerm to delete whole words on Option-Backspace May 13, 2025 macOS
Be careful with Date.toLocaleDateString() in JavaScript May 8, 2023 macOS
Fastest way to find out if a file exists in S3 (with boto3) June 16, 2017 Web development
Related by keyword:
Mozilla Symbol Server (aka. Tecken) load testing September 6, 2017 Python, Web development, Django, Mozilla
How to log ALL PostgreSQL SQL happening July 20, 2015 PostgreSQL, macOS
Best Atom packages of 2015 January 22, 2016 Web development, macOS
WSSE Authentication and Apache December 13, 2007 Python