Want to take your software engineering career to the next level? Join the mailing list for career tips & advice Click here

CTags

CTags support for Sublime Text 2/3

Subscribe to updates I use CTags


Statistics on CTags

Number of watchers on Github 930
Number of open issues 68
Average time to close an issue 22 days
Main language Python
Average time to merge a PR 8 days
Open pull requests 6+
Closed pull requests 14+
Last commit about 5 years ago
Repo Created over 9 years ago
Repo Last Updated over 2 years ago
Size 1.79 MB
Organization / Authorsublimetext
Latest Release0.4.0
Contributors52
Page Updated
Do you use CTags? Leave a review!
View open issues (68)
View CTags activity
View on github
Book a Mock Interview With Me (Silicon Valley Engineering Leader, 100s of interviews conducted)
Software engineers: It's time to get promoted. Starting NOW! Subscribe to my mailing list and I will equip you with tools, tips and actionable advice to grow in your career.
Evaluating CTags for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

=====

CTags

.. image:: https://travis-ci.org/SublimeText/CTags.svg?branch=development :target: https://travis-ci.org/SublimeText/CTags

About

This Sublime Text 2/3_ package provides support for working with tags generated by Exuberant CTags_

.. _Sublime Text 2/3: http://sublimetext.com/ .. _Exuberant CTags: http://ctags.sourceforge.net/

The ctags command is searched for on the system PATH. It works by doing a binary search of a memory-mapped tags file, so it will work efficiently with very large (50MB+) tags files if needed.

See this forum thread_ for a bit of historical background on the Sublime Text plugin.

.. _forum thread: http://www.sublimetext.com/forum/viewtopic.php?f=5&t=144

Installation

The easiest way to install this plugin, is to use the Package Control_ plugin, by Will Bond_

.. _Package Control: http://wbond.net/sublime_packages/package_control/ .. _Will Bond: http://wbond.net/

Alternatively, the plugin can be installed manually using one of the following methods.

Using Git

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

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

Manual Download

  • 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 Packages directory

Additional Setup Steps

OS X

The default ctags executable in OSX does not support recursive directory search (i.e. ctags -R). To get a proper copy of ctags, use one of the following options:

  • Using Homebrew_::

    brew install ctags

  • Using MacPorts_::

    port install ctags

.. _Homebrew: http://mxcl.github.com/homebrew/ .. _MacPorts: http://www.macports.org/

Ensure that the PATH is updated so the correct version is run:

  • 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 which ctags reported.
  • Alternatively, add the path to the new ctags executable to the settings, under command. If you have Xcode / Apple Developer Tools installed this path will likely be /usr/local/bin/ctags.

Linux

To install ctags use your package manager.

  • For Debian-based systems (Ubuntu, Mint, etc.)::

    sudo apt-get install exuberant-ctags

  • For Red Hat-based systems (Red Hat, Fedora, CentOS)::

    sudo yum install ctags

And so forth

Windows

  • Download the CTags binary_ from the Exuberant CTags_ site.
  • Extract ctags.exe from the downloaded zip to C:\Program Files\Sublime Text 2 or any folder within your PATH so that Sublime Text can run it.
  • Alternatively, extract to any folder and add the path to this folder to the command setting.

.. _CTags binary: http://prdownloads.sourceforge.net/ctags/ctags58.zip

Usage

This uses tag files created by the ctags -R -f .tags command by default (although this can be overriden in settings).

The plugin will try to 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 one (in the directory of the current view)

If a symbol can't be found in a tags file, it will search in additional locations that are specified in the CTags.sublime-settings file (see below).

If you are a Rubyist, you can build a Ruby Gem's tags with the following script::

require 'bundler' paths = Bundler.load.specs.map(&:full_gem_path) system(ctags -R -f .gemtags #{paths.join(' ')})

Settings

By default, Sublime will include ctags files in your project, which causes them to show up in the file tree and search results. To disable this behaviour you should add a file_exclude_patterns entry to your Preferences.sublime-settings or your project file. For example::

file_exclude_patterns: [.tags, .tags_sorted_by_file, .gemtags]

In addition to this setting, there's a CTags.sublime-settings file, which can be edited like any other .sublime-settings file

  • 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[\t]+)\t' '(?P[\t]+)\t' '(?P.?);"\t' '(?P[\t\r\n]+)' '(?:\t(?P.))?'

  • extra_tag_paths is a list of extra places to look for keyed by

  • (selector, platform). Note the platform is tested against sublime.platform() so any values that function returns are valid.

  • extra_tag_files is a list of extra files relative to the original file

  • command is the path to the version of ctags to use, for example::

    command : /usr/local/bin/ctags

or::

"command" : "C:\Users\<username>\Downloads\CTags\ctag.exe"

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 a notification.

.. _open an issue: https://github.com/SublimeText/CTags/issues

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_prev ctrl+t, ctrl+b ctrl+< ctrl+shift+right_click show_symbols alt+s show_symbols (all files) alt+shift+s show_symbols (suffix) ctrl+alt+shift+s ============================== ================ =========== ======================

CTags open issues Ask a question     (View All Issues)
  • about 4 years std::cout not found
  • about 4 years Feature request: Jump to definition in other focus group (panel)
  • about 4 years IndexError: list index out of range on `loading symbols from file`
  • about 4 years "find call hierarchy" feature
  • over 4 years Create CTags Outside of Sublime
  • over 4 years ST3 Build 3114 incompatible with ctag "Navigate to Definition" functionality
  • over 4 years Annoying getting all the "Please wait while tags are built" dialogs
  • over 4 years cannot find macros
  • over 4 years Can't find FUNCTION_NAME
  • over 4 years Can't find any relevant tags file
  • over 4 years Incomplete README
  • almost 5 years sublime text osx
  • almost 5 years [suggestion]:put path at first line in the definition list panel.
  • almost 5 years [Bug]:Rebuild tags won't work
  • about 5 years Update to 0.4.0 version : navigate doesn't work for now
  • about 5 years "extra_tag_paths" does not work on Mint Linux using ST3
  • about 5 years Cannot search using ctags from "Find Results"
  • about 5 years Cannot navigate to variable definition in php project
  • about 5 years JumpPrev buffer is global
  • over 5 years Search in *all* .tags files, not just the one found in some parent folder
  • over 5 years "CTags" can't be found
  • almost 6 years Walking up directories does not appear to work.
  • almost 6 years scroll_to_tag doesn't work for ex_command without end of line ($)
  • almost 6 years extra_tag_paths does not work on OSX
  • almost 6 years Show all files does not work when not using .tags
  • almost 6 years list index out of range. ST3
  • almost 6 years Valid MySQL escape characters likely to cause 'IndexError: list index out of range'
  • almost 6 years Make directly jumping to file at single match optional
  • almost 6 years extra_tag_paths are not searched if .tags file is not found relative to the file.
  • almost 6 years Setting to show_symbols in "file order"
CTags open pull requests (View All Pulls)
  • use project's options file
  • warn short lines in resort_tags(), and continue
  • Read Project Settings
  • Fix CTags always search the tag file in the first top folder in a project
  • Integrate with sublime's jump history list.
  • Integrate with Sublime Text history
CTags questions on Stackoverflow (View All Questions)
  • Synergy between ctags and cscope
  • How do I generate recursive ctags without Exuberant Ctags?
  • Exuberant Ctags: undocumented extension fields
  • VHDL tags not efficient in vim with ctags+taglist
  • Vim and Ctags tips and tricks
  • run a shell command (ctags) in cmake and make
  • ctags is not indexing class member function
  • Do you know an alternative ctags generator for Ruby
  • Emacs: Ctags table don't working on projectile plugin
  • How to use Ctags with C++ trailing return types
  • How to use ctags for golang?
  • The ctags command doesn't recurse saying "it is not a regular file"
  • Vim ctags: can we toggle focus between taglist window and source code window without closing the taglist window?
  • Usage of cscope & ctags in FreeBSD
  • Which version of ctags had the `-T` option?
  • ctags doesn't search recursively
  • Tell Ctags not to parse content inside comments
  • Using ctags to find variables declared with a constructor in c++
  • ctags in sublime text
  • Getting ctags to include Javascript variable declarations
  • Not able to create ctags in linux
  • Incorrect ctags called from OS X command line
  • Adding tag scopes in universal-ctags
  • Adding ctags for a 3rd party library
  • ctags : unable to create the tag for system verilog(.sv) files
  • How can I get ctags to generate tags for a yeoman generated AngularJS webapp completely?
  • Ctags error: "Unknown option -"
  • ctags doesn't undestand -e option (no exuberant tags option)
  • How to cause ctags to show tag definition on vertical split without opening a new split?
  • How to configure ctags to work with CSS, SCSS, HTML?
CTags list of languages used
CTags latest release notes
0.4.0 Khan

This release adds support for the Ranking Manager and fixes a number of outstanding bugs and other issues.

0.3.9 Jackal

This release fixes a number of outstanding bugs and other issues.

0.3.8 Iron Man

This release adds building ctags from the sidebar. Additionally, it incorporates a number of bug fixes and other minor code improvements.

Other projects in Python
Powered by Autocode - Instant Webhooks, Scripts and APIs
Autocode logo wordmark