Have you ever wished github's awesome Atom text editor had better support for jumping straight to a class or method definition like Rubymine or Sublime Text? Me too! So, here's a short set of instructions how to get this functionality working on OS X!
To summarize what we're going to do:
- Install exuberant ctags from homebrew
- Install an
rbenvplugin and a gem that automatically generates ctags for rubygems
gitknow that you want to include the
ctagsbinary and your new hooks in all git tracked repos
- Create a
ctags binarythat generates a tags file for each project, and a few
githooks to keep our tags files up to date
- Ensure your git-tracked repos have the newly created hooks and
- Install a helper package in Atom called
Quick & Dirty
note: if you’ve ever installed atom-ctags, remove it, and delete any
.tagsfiles from your project repos, or you’re gonna have a bad time
Install exuberant ctags
Open your terminal and type:
brew install ctags
Configure your git template directory
# create a git template directory in your home directory mkdir -p ~/.git_template # tell git you want to use this directory to copy "template" files into all new git repos git config --global init.templatedir '~/.git_template' # tell git you want to alias a command `git ctags` git config --global alias.ctags '!.git/hooks/ctags'
Download all of the hooks files and the
ctagsbinary from here:
And copy them into your git template directory (probably at
~/.git_template). These hooks trigger a run of
git ctagswhenever you move between branches, commit, etc., so your tags file is always up to date!
git ctagscommand to your
# tell git you want to alias a command `git ctags` git config --global alias.ctags '!.git/hooks/ctags'
Install the atom package
apm install autocomplete-ctags
cd to a git-tracked project directory
# run this command to copy your hooks and ctags binary to the repo # don't worry, it won't blow away your commit history or do anything destructive! git init # to seed it once, just to prove it works run `git ctags`
symbols-viewpackage is enabled in Atom!
Relaunch Atom once
Profit by using the
go to definitionfeature in Atom!
Questions? Comments? Problems? Improvements? Anything??? Comment below and tell me, and I'll do my best to help!