GithubHelp home page GithubHelp logo

ctags's Introduction

CTags

This Sublime Text 2 Package provides support for working with tags generated by Exuberant CTags

The ctags command is searched for on PATH. It works by doing a binary search of an mmap()'d `.tags` file so it will work efficiently with very large ( 50MB+ etc ) tags files if needed.

OS X

If anyone is having trouble getting the CTags -R flag to work on OSX, you are probably using the stock CTags installation.

To get a proper copy of ctags, use one of the following options:

  • Make sure that Sublime Text is using the right version of CTags:*
  • If 'which ctags' doesn't point at ctags in '/usr/local/bin', make sure you add '/usr/local/bin' to your PATH ahead of the folder that 'which ctags' reported.
    • Add or modify the 'export PATH=...' (e.g. in /.profile) to make the change permanent

Linux

To get a proper copy of ctags, use one of the following options:

  • In a terminal session: sudo apt-get install ctags

Dependencies

  • No dependencies!

Installation

If you are a git user, the best way to install the package and keep up to date is to clone the repo directly into your /Packages directory in the Sublime Text 2 application settings area.

Using Git

Go to your Sublime Text 2 `Packages` directory and clone the repository using the command below:

$ git clone https://github.com/SublimeText/CTags CTags

Download Manually

  • Download the files using the .zip download option
  • Unzip the files (and rename the folder to CTags if needed)
  • Copy the folder to your Sublime Text 2 Packages directory

About

See this forum thread for a bit of background.

Usage

This uses `.tags` files created in `ctags -R -f .tags` recursive mode.

The commands will try and find a `tags` file in the same directory as the current view, walking up directories until it finds one. If it can't find one it will offer to build some ( in the directory of the current view ) (TODO: doesn't ask as missing api from S1)

If a symbol can't be found in a tags file it will search in alternative locations.

If you create a file `tags_search_paths` in the same folder as your `tags` file, listing alternative locations (full absolute paths, one per line) it will search those files also.

eg

D:\myProject\tags

Other Settings

There's a CTags.sublime-settings file:

{
    "debug"           :  false,
    "ctags_command"   :  "ctags -R -f .tags",
    "filters"         :  {
        "source.python": {"type":"^i$"}
    },
    "definition_filters": {
        "source.php": {"type":"^v$"}
    },
    "definition_current_first": false,
    "show_context_menus": false,
    "extra_tag_paths" :  [ [["source.python", "windows"], "C:\\Python27\\Lib\\tags"]],
    "extra_tag_files" : [".gemtags"]
}

`filters` will allow you to set scope specific filters against a field of the tag. In the excerpt above, imports tags like "from a import b" are filtered.

    '(?P<symbol>[^\t]+)\t'
    '(?P<filename>[^\t]+)\t'
    '(?P<ex_command>.*?);"\t'
    '(?P<type>[^\t\r\n]+)'
    '(?:\t(?P<fields>.*))?'

`extra_tag_paths` is a list of extra places to look for keyed by (selector, platform)

`extra_tag_files` is a list of extra files relative to the original .tags file

Note the platform (`windows` in the example above) is tested against `sublime.platform()` so any values that function returns are valid.

The rest of the options are fairly self explanatory.

Support

If there are any problems or you have a suggestion open an issue and we will receive an email notification.

Thanks :)

Commands Listing

Command Key Binding Alt Binding Mouse Binding
rebuild_ctags ctrl+t ctrl+r
navigate_to_definition ctrl+t ctrl+t ctrl+> ctrl+shift+left_click
jump_back ctrl+t ctrl+b ctrl+< ctrl+shift+right_click
jump_back to_last_modification ctrl+t ctrl+m
show_symbols alt+s
show_symbols multi alt+shift+s

ctags's People

Contributors

afterdesign avatar anatol avatar barneywilliams avatar bobthecow avatar bradlarsen avatar buhrmi avatar cj avatar d2s avatar dyross avatar eric-guo avatar kasperg avatar moonfruit avatar romario333 avatar stuartherbert avatar sublimator avatar unowen avatar

Watchers

 avatar  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.