{"id":23879335,"url":"https://github.com/ceedubs/sbt-ctags","last_synced_at":"2025-04-09T17:14:52.063Z","repository":{"id":14722097,"uuid":"17442728","full_name":"ceedubs/sbt-ctags","owner":"ceedubs","description":"SBT ctags is an SBT plugin that will generate ctags for your Scala project.","archived":false,"fork":false,"pushed_at":"2020-08-25T08:07:47.000Z","size":51,"stargazers_count":99,"open_issues_count":3,"forks_count":20,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-09T17:14:46.544Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ceedubs.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}},"created_at":"2014-03-05T14:13:36.000Z","updated_at":"2025-02-06T00:42:54.000Z","dependencies_parsed_at":"2022-09-11T07:22:05.754Z","dependency_job_id":null,"html_url":"https://github.com/ceedubs/sbt-ctags","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceedubs%2Fsbt-ctags","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceedubs%2Fsbt-ctags/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceedubs%2Fsbt-ctags/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceedubs%2Fsbt-ctags/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ceedubs","download_url":"https://codeload.github.com/ceedubs/sbt-ctags/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248074923,"owners_count":21043490,"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":"2025-01-03T22:51:31.627Z","updated_at":"2025-04-09T17:14:52.043Z","avatar_url":"https://github.com/ceedubs.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Abandoned #\n\nThis project has been abandoned. I haven't used it or maintained it in years. I recommend using [Metals](https://scalameta.org/metals/) (which is much more feature-rich) instead.\n\nAny issues created in this repository will probably be ignored. Feel free to fork this project in accordance with its [license](LICENSE).\n\n# SBT ctags #\n\nSBT ctags is an SBT plugin that will generate ctags for your Scala project.\n\nIt unzips the source jars for your project dependencies and generates ctags for these dependency sources in addition to the Scala/Java source of your project itself.\n\n# Release notes #\n\nJust want to find out what's new in the most recent version? Check out the [release notes](https://github.com/ceedubs/sbt-ctags/tree/master/release-notes).\n\n# Setting it up #\n\n## Adding the plugin dependency ##\n\nAdd the following to `~/.sbt/1.0/plugins/plugins.sbt` (or wherever you like to configure your global SBT settings):\n```scala\nresolvers ++= Seq(\n  \"Sonatype OSS Releases\" at \"https://oss.sonatype.org/content/repositories/releases/\",\n  \"Sonatype OSS Snapshots\" at \"https://oss.sonatype.org/content/repositories/snapshots/\"\n)\n\naddSbtPlugin(\"net.ceedubs\" %% \"sbt-ctags\" % \"0.3.0\")\n```\n\nAlternatively you can add this plugin to individual SBT projects by adding those lines to `\u003cproject-dir\u003e/project/plugins.sbt`.\n\n## Configuring ctags ##\n\nBy default, the plugin assumes you have a `ctags` executable on your path that is syntax-compatible with [Exuberant Ctags](http://ctags.sourceforge.net/). Some systems will already have a version of `ctags` installed that isn't compatible with this syntax. If you get errors and you are on Mac OS X, you might want to try `brew install ctags`.\n\nIf you'd rather go the advanced route and customize the way tags are generated, see [Configuration](#configuration).\n\nBy default ctags will not index scala files.  One such `~/.ctags` configuration which enables indexing might look like:\n\n```shell\n--langdef=scala\n--langmap=scala:.scala\n--regex-scala=/^[ \\t]*((abstract|final|sealed|implicit|lazy)[ \\t]*)*(private|protected)?[ \\t]*class[ \\t]+([a-zA-Z0-9_]+)/\\4/c,classes/\n--regex-scala=/^[ \\t]*((abstract|final|sealed|implicit|lazy)[ \\t]*)*(private|protected)?[ \\t]*object[ \\t]+([a-zA-Z0-9_]+)/\\4/c,objects/\n--regex-scala=/^[ \\t]*((abstract|final|sealed|implicit|lazy)[ \\t]*)*(private|protected)?[ \\t]*case class[ \\t]+([a-zA-Z0-9_]+)/\\4/c,case classes/\n--regex-scala=/^[ \\t]*((abstract|final|sealed|implicit|lazy)[ \\t]*)*(private|protected)?[ \\t]*case object[ \\t]+([a-zA-Z0-9_]+)/\\4/c,case objects/\n--regex-scala=/^[ \\t]*((abstract|final|sealed|implicit|lazy)[ \\t]*)*(private|protected)?[ \\t]*trait[ \\t]+([a-zA-Z0-9_]+)/\\4/t,traits/\n--regex-scala=/^[ \\t]*type[ \\t]+([a-zA-Z0-9_]+)/\\1/T,types/\n--regex-scala=/^[ \\t]*((abstract|final|sealed|implicit|lazy)[ \\t]*)*def[ \\t]+([a-zA-Z0-9_]+)/\\3/m,methods/\n--regex-scala=/^[ \\t]*((abstract|final|sealed|implicit|lazy)[ \\t]*)*val[ \\t]+([a-zA-Z0-9_]+)/\\3/l,constants/\n--regex-scala=/^[ \\t]*((abstract|final|sealed|implicit|lazy)[ \\t]*)*var[ \\t]+([a-zA-Z0-9_]+)/\\3/l,variables/\n--regex-scala=/^[ \\t]*package[ \\t]+([a-zA-Z0-9_.]+)/\\1/p,packages/\n```\n\nThis was taken from the excellent blog post [Editing Scala with vim](http://leonard.io/blog/2013/04/editing-scala-with-vim/) by Leonard Ehrenfried.\n\n# Using the plugin #\n\nTo generate ctags for a project, run `sbt genCtags` from the project's root directory. This will unzip dependency source jars into `target/sbt-ctags-dep-srcs` (configurable) and create a tags file (default location is `.tags` inside the root dir).\n\n# Using the tags #\n\nYour text editor of choice that supports ctags will need to be configured to look for the generated `.tags` file (the file name may be different depending on your plugin configuration). I use vim and this is accomplished by adding `set tags=./.tags,.tags,./tags,tags` to my `.vimrc`.\n\nThe Vim Tips Wiki has some useful information for [Browsing programs with tags](http://vim.wikia.com/wiki/Browsing_programs_with_tags)\n\nEmacswiki has some useful information for [navigating using tags](http://www.emacswiki.org/emacs/EmacsTags)\n\n# Configuration #\n\nThere are a number of configurable settings declared in [SbtCtags.scala](https://github.com/ceedubs/sbt-ctags/blob/master/src/main/scala/net/ceedubs/sbtctags/SbtCtags.scala). The best way to get to know what the configuration options are is probably to browse the `CtagsKeys` object within that file.\n\nI would suggest putting your sbt-ctags configuration in `~/.sbt/1.0/sbt-ctags.sbt` or something similar.\n\n## Languages ##\n\nBy default, sbt-ctags generates tag files for both Java and Scala source. If you prefer to generate tags only for Scala source, you can add the following to your sbt-ctags file:\n\n```scala\nimport net.ceedubs.sbtctags.CtagsKeys\n\nCtagsKeys.ctagsParams ~= (_.copy(languages = Seq(\"scala\")))\n```\n\n## Emacs ##\n\nBy default, the tags file is named `.tags` and is created at the project root through an external call `ctags` with Exuberant Ctags syntax.\n\nIf you want the tags file to be named `TAGS` and to be in Emacs format, you could set the following to your sbt-ctags file:\n\n```scala\nCtagsKeys.ctagsParams ~= (default =\u003e default.copy(tagFileName = \"TAGS\", extraArgs = \"-e\" +: default.extraArgs))\n```\n\n## Preventing tag file generation\n\nIf you just want to use this plugin to unzip dependency sources so you can generate ctags outside of SBT, you could set `net.ceedubs.sbtctags.CtagsKeys.ctagsGeneration := { _ =\u003e () }` to make the generation of ctags a noop.\n\n## Relative paths\n\nIf you need/want to have relative paths in your `.tags` file, set the following to your sbt-ctags file:\n\n```scala\nCtagsKeys.ctagsParams ~= (_.copy(\n  useRelativePaths = true))\n```\n\n# Disclaimers and warnings #\nBe very careful if you are going to change the `dependencySrcUnzipDir` setting. This directory is cleared every time the `genCtags` task runs.\n\nThis plugin makes some assumptions about your system and how you want tags to be generated. Hopefully the customizable settings make it easy for you to use to your liking. If not, I encourage you to send a pull request to make this plugin more flexible/useful/robust.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceedubs%2Fsbt-ctags","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fceedubs%2Fsbt-ctags","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceedubs%2Fsbt-ctags/lists"}