Giter Club home page Giter Club logo

elixir-ctags's Introduction

ctags-elixir

Exuberant CTags support for the Elixir language.

This means that if you are writing your Elixir code using an editor that supports Ctags (e.g. Vim, Emacs, Sublime Text, and many others), you can easily jump to the definition of any symbol. Handy for navigating your way around a large, unfamiliar source tree.

To enable:

Copy or append this .ctags file to your own ~/.ctags.

Once you have done that, you can build tags for an Elixir app with the usual ctags command line: cd into your project, and then

$ ctags -R .

What is this Exuberant Ctags thing and how do I use it?

Well, that's a separate topic, really. But here's a quick start.

Ctags is a tool to make it easier to implement "go to definition" in lots of different text editors and for lots of different programming languages. It has parsers for many languages, and it generates a simple tags file that any editor can read in order to find the file and line where a given symbol is defined.

The original Ctags supported only C (I think). Exuberant Ctags is a rewrite that supports many more languages.

Install Exuberant Ctags

If you don't already have Exuberant Ctags, install it. On OSX, the best way is using brew:

$ brew install ctags

On Windows, the best way is using chocolatey:

choco install ctags

Vim

If you are using the vim editor:

  1. Do the above ctags -R . command
  2. Open an Elixir source file in vim.
  3. Put the cursor on any symbol name, and type the ^] (Control-]) key. The cursor will jump to the definition of that symbol.
  4. Type ^O (or ^T) to return cursor to previous location.

Sublime Text 2

If you are using Sublime Text, there is a package you can install that adds CTags support. I haven't tried it, but this is what you would do:

  1. If you have not already done so, install Sublime Package Control.
  2. From Sublime Text, Cmd-Shift-P, "install package"
  3. Pick "CTags" from the list of packages, and install it
  4. Put the cursor on any symbol name, and then type ^T^T. This should jump to the symbol definition.
  5. See the rest of the key bindings here.

Other editors

There are also other editors that support Ctags. Check your editor's documentation, or Google for it.

Feedback

Feedback is more than welcome; I'm new to the Elixir language, so I probably got some things wrong.

elixir-ctags's People

Contributors

mmorearty avatar amacgregor avatar jeremiahredekop avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.