{"id":13602210,"url":"https://github.com/SublimeText/CTags","last_synced_at":"2025-04-11T08:31:48.143Z","repository":{"id":47627746,"uuid":"1954275","full_name":"SublimeText/CTags","owner":"SublimeText","description":"CTags support for Sublime Text","archived":false,"fork":false,"pushed_at":"2024-01-18T18:55:23.000Z","size":707,"stargazers_count":989,"open_issues_count":37,"forks_count":167,"subscribers_count":77,"default_branch":"development","last_synced_at":"2024-05-16T21:12:28.921Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SublimeText.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-06-26T01:12:01.000Z","updated_at":"2024-07-10T13:32:42.550Z","dependencies_parsed_at":"2024-01-16T23:30:18.712Z","dependency_job_id":"74774e4d-762e-495d-bacb-76384e6fc9e0","html_url":"https://github.com/SublimeText/CTags","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SublimeText%2FCTags","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SublimeText%2FCTags/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SublimeText%2FCTags/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SublimeText%2FCTags/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SublimeText","download_url":"https://codeload.github.com/SublimeText/CTags/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248361573,"owners_count":21090934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T18:01:16.530Z","updated_at":"2025-04-11T08:31:47.673Z","avatar_url":"https://github.com/SublimeText.png","language":"Python","funding_links":[],"categories":["代码效率","Python"],"sub_categories":[],"readme":"# CTags\n\n![CI](https://github.com/SublimeText/CTags/actions/workflows/ci.yaml/badge.svg)\n\nThis [Sublime Text][] package provides support for working with tags generated\nby [Exuberant CTags][] or [Universal CTags][].\n\n`ctags` command is searched for on the system PATH. It works by doing a binary\nsearch of a memory-mapped tags file, so it will work efficiently with very large\n(50MB+) tags files if needed.\n\n\n## Installation\n\n### Package Control\n\nThe easiest way to install is using [Package Control][]. It's listed as `CTags`.\n\n1. Open `Command Palette` using menu item `Tools → Command Palette...`\n2. Choose `Package Control: Install Package`\n3. Find `CTags` and hit `Enter`\n\n### Manual Download\n\n1. [Download the `.zip`][release]\n2. Unzip and rename folder to `CTags`\n3. Copy folder into `Packages` directory, \n   which can be found using the menu item `Preferences → Browse Packages...`\n\n### Using Git\n\nGo to your Sublime Text Packages directory and clone the repository\nusing the command below::\n\n```sh\ngit clone https://github.com/SublimeText/CTags\n```\n\n\n## Additional Setup Steps\n\n### Linux\n\nTo install ctags use your package manager. \n\n* For Debian-based systems (Ubuntu, Mint, etc.)::\n\n  ```sh\n  sudo apt-get install exuberant-ctags\n  ```\n\n  or\n\n  ```sh\n  sudo apt-get install universal-ctags\n  ```\n\n* For Red Hat-based systems (Red Hat, Fedora, CentOS)::\n\n  ```sh\n  sudo yum install ctags  \n  ```\n \n### MacOS\n\nThe default `ctags` executable in OSX does not support recursive directory\nsearch (i.e. `ctags -R`). To get a proper copy of ctags, use one of the\nfollowing options:\n\n* Using [Homebrew][]\n\n  ```sh\n  brew install ctags\n  ```\n\n* Using [MacPorts][]\n  \n  ```sh\n  port install ctags  \n  ```\n  \nEnsure that the `PATH` is updated so the correct version is run:\n\n* If `which ctags` doesn't point at ctags in `/usr/local/bin`, make sure\n  you add `/usr/local/bin` to your `PATH` ahead of the folder \n  `which ctags` reported.\n* Alternatively, add the path to the new `ctags` executable to the settings,\n  under `command`. If you have Xcode / Apple Developer Tools installed this\n  path will likely be `/usr/local/bin/ctags`.\n \n### Windows\n\n* Download [Exuberant CTags binary][] or [Universal CTags binary][]\n\n* Extract `ctags.exe` from the downloaded zip to \n  `C:\\Program Files\\Sublime Text` or any folder within your PATH so that\n  Sublime Text can run it.\n\n* Alternatively, extract to any folder and add the path to this folder to\n  the `command` setting.\n\n\n## Usage\n\nThis uses tag files created by the `ctags -R -f .tags` command by default\n(although this can be overridden in settings).\n\nThe plugin will try to find a `.tags` file in the same directory as the\ncurrent view, walking up directories until it finds one. If it can't find one\nit will offer to build one (in the directory of the current view)\n\nIf a symbol can't be found in a tags file, it will search in additional\nlocations that are specified in the `CTags.sublime-settings` file (see \nbelow).\n\nIf you are a Rubyist, you can build a Ruby Gem's tags with the following\nscript:\n\n```ruby\nrequire 'bundler'\npaths = Bundler.load.specs.map(\u0026:full_gem_path)\nsystem(\"ctags -R -f .gemtags #{paths.join(' ')}\")\n```\n\n\n## Settings\n\nTo open CTags.sublime-settings\n\n1. Open `Command Palette` using menu item `Tools → Command Palette...`\n2. Choose `Preferences: CTags Settings` and hit `Enter`\n\n---\n\n* `filters` will allow you to set scope specific filters against a field of\n  the tag. In the excerpt above, imports tags like `from a import b` are \n  filtered:\n\n  ```\n  '(?P\u003csymbol\u003e[^\\t]+)\\t'\n  '(?P\u003cfilename\u003e[^\\t]+)\\t'\n  '(?P\u003cex_command\u003e.*?);\"\\t'\n  '(?P\u003ctype\u003e[^\\t\\r\\n]+)'\n  '(?:\\t(?P\u003cfields\u003e.*))?'\n  ```\n\n* `extra_tag_paths` is a list of extra places to look for keyed by \n* `(selector, platform)`. Note the `platform` is tested against \n  `sublime.platform()` so any values that function returns are valid.\n* `extra_tag_files` is a list of extra files relative to the original file\n* `command` is the path to the version of ctags to use, for example::\n\n  ```json\n  \"command\" : \"/usr/local/bin/ctags\"  \n  ```\n  \n  or:\n\n  ```json\n  \"command\" : \"C:\\\\Users\\\\\u003cusername\u003e\\\\Downloads\\\\CTags\\\\ctag.exe\"\n  ```\n\nThe rest of the options are fairly self explanatory.\n\n### Hide .tags files from side bar\n\nBy default, Sublime will include ctags files in your project, which causes\nthem to show up in the file tree and search results. To disable this behaviour\nyou should add a `file_exclude_patterns` entry to your \n`Preferences.sublime-settings` or your project file. For example:\n\n```json\n\"file_exclude_patterns\": [\".tags\", \".tags_sorted_by_file\", \".gemtags\"]\n```\n\n\n## Support\n\nIf there are any problems or you have a suggestion, [open an issue][issues], and\nwe will receive a notification.\n\n\n## Commands Listing\n\n| Command                      | Key Binding                 | Alt Binding          | Mouse Binding\n|---                           |---                          |---                   |---\n| rebuild_ctags                | \u003ckbd\u003ectrl+t, ctrl+r\u003c/kbd\u003e   |                      |\n| navigate_to_definition       | \u003ckbd\u003ectrl+t, ctrl+t\u003c/kbd\u003e   | \u003ckbd\u003ectrl+\u0026gt;\u003c/kbd\u003e | \u003ckbd\u003ectrl+shift+left_click\u003c/kbd\u003e\n| jump_back                    | \u003ckbd\u003ectrl+t, ctrl+b\u003c/kbd\u003e   | \u003ckbd\u003ectrl+\u0026lt;\u003c/kbd\u003e | \u003ckbd\u003ectrl+shift+right_click\u003c/kbd\u003e\n| show_symbols                 | \u003ckbd\u003ealt+s\u003c/kbd\u003e            |                      |\n| show_symbols (all files)     | \u003ckbd\u003ealt+shift+s\u003c/kbd\u003e      |                      |\n| show_symbols (suffix)        | \u003ckbd\u003ectrl+alt+shift+s\u003c/kbd\u003e |                      |\n\n\n[issues]: https://github.com/SublimeText/CTags/issues\n[release]: https://github.com/SublimeText/CTags/releases/latest\n\n[Sublime Text]: http://sublimetext.com/\n[Package Control]: http://packagecontrol.io/\n\n[Exuberant CTags]: http://ctags.sourceforge.net/\n[Exuberant CTags binary]: http://prdownloads.sourceforge.net/ctags/ctags58.zip\n\n[Universal CTags]: https://github.com/universal-ctags/ctags\n[Universal CTags binary]: https://github.com/universal-ctags/ctags-win32/releases/latest\n\n[Homebrew]: https://brew.sh/\n[MacPorts]: https://www.macports.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSublimeText%2FCTags","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSublimeText%2FCTags","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSublimeText%2FCTags/lists"}