{"id":13471357,"url":"https://github.com/jacktasia/dumb-jump","last_synced_at":"2025-05-14T07:10:46.811Z","repository":{"id":37549398,"uuid":"46448682","full_name":"jacktasia/dumb-jump","owner":"jacktasia","description":"an Emacs \"jump to definition\" package for 50+ languages","archived":false,"fork":false,"pushed_at":"2025-03-10T20:14:08.000Z","size":1333,"stargazers_count":1634,"open_issues_count":87,"forks_count":156,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-04-11T19:59:26.332Z","etag":null,"topics":["ag","developer-tools","emacs","emacs-lisp","emacs-modules","melpa","ripgrep","silver-searcher","spacemacs"],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jacktasia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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,"zenodo":null}},"created_at":"2015-11-18T21:29:17.000Z","updated_at":"2025-04-11T08:11:18.000Z","dependencies_parsed_at":"2023-01-22T20:25:12.192Z","dependency_job_id":"17b5d787-191a-4da8-8ba6-3e8a6d71f76c","html_url":"https://github.com/jacktasia/dumb-jump","commit_stats":{"total_commits":536,"total_committers":92,"mean_commits":5.826086956521739,"dds":0.2779850746268657,"last_synced_commit":"0a783d1db610ff1dc4e1b7869589cff16ff92f7a"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacktasia%2Fdumb-jump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacktasia%2Fdumb-jump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacktasia%2Fdumb-jump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacktasia%2Fdumb-jump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacktasia","download_url":"https://codeload.github.com/jacktasia/dumb-jump/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254092798,"owners_count":22013292,"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":["ag","developer-tools","emacs","emacs-lisp","emacs-modules","melpa","ripgrep","silver-searcher","spacemacs"],"created_at":"2024-07-31T16:00:43.576Z","updated_at":"2025-05-14T07:10:41.796Z","avatar_url":"https://github.com/jacktasia.png","language":"Emacs Lisp","funding_links":[],"categories":["Emacs Lisp"],"sub_categories":[],"readme":"# dumb-jump\n\n![CI](https://github.com/jacktasia/dumb-jump/workflows/CI/badge.svg) [![Coverage Status](https://coveralls.io/repos/jacktasia/dumb-jump/badge.svg?branch=master\u0026service=github\u0026x=1)](https://coveralls.io/github/jacktasia/dumb-jump?branch=master) [![MELPA](http://melpa.org/packages/dumb-jump-badge.svg?x=6)](http://melpa.org/#/dumb-jump) [![MELPA Stable](https://stable.melpa.org/packages/dumb-jump-badge.svg?x=1)](https://stable.melpa.org/#/dumb-jump)\n\n![Dumb Jump GIF](media/dumb-jump-example-v2.gif?raw=true)\n\n## About\n**Dumb Jump** is an Emacs \"jump to definition\" package with support for 50+ programming languages that favors \"just working\". This means minimal -- and ideally zero -- configuration with absolutely no stored indexes (TAGS) or persistent background processes. Dumb Jump requires at least GNU Emacs `24.3`.\n\n\n#### How  it works\nDumb Jump uses [The Silver Searcher](https://github.com/ggreer/the_silver_searcher) `ag`, [ripgrep](https://github.com/BurntSushi/ripgrep) `rg`, or `grep` to find potential definitions of a function or variable under point. It uses a set of regular expressions based on the file extension, or `major-mode`, of the current buffer. The matches are run through a shared set of heuristic methods to find the best candidate to jump to. If it can't decide it will present the user with a list in a pop-menu, helm, or ivy (see `dumb-jump-selector`).\n\n#### Success Rate\nFor the currently [supported languages](#supported-languages) it seems to do a good job of finding what you want. If you find a case where it does not work as expected do not hesitate to [open an issue](https://github.com/jacktasia/dumb-jump/issues). It can be slow if it needs to use `grep` and/or a project is large. Although it can be sped up by [installing `ag`](https://github.com/ggreer/the_silver_searcher#installing) or [installing `rg`](https://github.com/BurntSushi/ripgrep#installation) and/or creating a `.dumbjump` file in your project's root directory with paths that should be excluded ([see configuration](#configuration)).\n\n\n## Supported Languages\n\nThere is currently basic support for the following languages:\n\n* Apex\n* Bash\n* C/C++\n* C#\n* Clojure\n* CoffeeScript\n* Common Lisp\n* Coq\n* Crystal\n* Dart\n* Elixir\n* Emacs Lisp\n* Erlang\n* F#\n* Faust\n* Fennel\n* Fortran\n* Go\n* Groovy\n* Haskell\n* Java\n* JavaScript\n* Julia\n* Kotlin\n* LaTeX\n* Lua\n* Matlab\n* Nim\n* Nix\n* Objective-C\n* OCaml\n* Odin\n* OpenSCAD\n* Org mode\n* Pascal\n* Perl\n* PHP\n* Protocol Buffers\n* Python\n* R\n* Racket\n* Ruby\n* Rust\n* Sass\n* Scala\n* Scheme\n* SML\n* Solidity\n* SQL\n* Swift\n* SystemVerilog\n* Tcl\n* Terraform / HCL\n* TypeScript\n* Vala\n* VHDL\n* Zig\n\n\nIf you have any issues with the existing languages, or you want support for another one, then please [open an issue](https://github.com/jacktasia/dumb-jump/issues). PRs are also welcome. If you'd like to add a language these PRs for [lua](https://github.com/jacktasia/dumb-jump/pull/33) and [rust](https://github.com/jacktasia/dumb-jump/pull/57) are good examples.\n\n## Installing\n\nThe recommended way to install Dumb Jump is via `package.el`. It's available on [MELPA](http://melpa.org/#/dumb-jump): \u003ckbd\u003eM-x\u003c/kbd\u003e `package-install dumb-jump`\n\n#### Spacemacs\n\nIf you're using an up-to-date Spacemacs, then you already have Dumb Jump by default just make sure you install `ag` or `rg` (see below) to ensure you have the best experience.\n\n\n#### Installing `ag` or `rg`\n\nDumb Jump performs best with The Silver Searcher `ag` ([ag install instructions](https://github.com/ggreer/the_silver_searcher#installing)) or ripgrep `rg` ([rg install instructions](https://github.com/BurntSushi/ripgrep#installation)) installed on your system.\n\n## Usage\n\n#### Basic\n\nTo enable the [xref][] backend, evaluate\n\n~~~lisp\n(add-hook 'xref-backend-functions #'dumb-jump-xref-activate)\n~~~\n\nor add it to your initialisation file. Using this, you can now use\n\u003ckbd\u003eM-.\u003c/kbd\u003e (or \u003ckbd\u003egd\u003c/kbd\u003e when using Evil).\n\nXref can be customized to use `completing-read` to select a\ntarget. That way a completion framework of your choice (Icomplete,\nHelm, Ivy, ...) will be used instead of the default pop-up buffer. To\ndo this, evaluate\n\n~~~lisp\n(setq xref-show-definitions-function #'xref-show-definitions-completing-read)\n~~~\n\nNote that the function `xref-show-definitions-completing-read`\nrequires at least Xref 1.1.0. This can either be downloaded from ELPA\nor is bundled with Emacs 28.1 or newer.\n\n[xref]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Xref.html\n\n## Configuration\n\n##### Excluding project directories\n\nDumb Jump will automatically look for a project root. If it's not finding one then either put a `.dumbjump` file in your project root and optionally add excluded directories to make it faster.\n\nProject root directory denoters: `.dumbjump` `.projectile` `.git` `.hg` `.fslckout` `.bzr` `_darcs` `.svn` `Makefile` `PkgInfo` `-pkg.el`.\n\nIf you want to stop a directory from registering as the project root (and have Dumb Jump keep looking) add an empty `.dumbjumpignore` file in that directory.\n\n##### Example `.dumbjump`\n\n    -tests\n    -node_modules\n    -build\n    -images\n    +../some-lib/src\n    +/usr/lib/src\n\n*NOTE* When adding paths outside of the project (using `+`) ensure you use `dumb-jump-force-searcher` of either `'ag` or `'rg` (see below). This is required because the default searcher (`git-grep`) won't be able to search outside of the project root. This edge case will be fixed in a future release. That is, `git-grep` will NOT be set as the default searcher if a `.dumbjump` is present with a `+` path outside of the repo.\n\n##### `.emacs` options\n\n* `(setq dumb-jump-default-project \"~/code\")` to change default project if one is not found (defaults to `~`)\n* `(setq dumb-jump-quiet t)` if Dumb Jump is too chatty.\n* To support more languages and/or definition types customize `dumb-jump-find-rules` variable.\n* `(setq dumb-jump-force-searcher 'rg)` to force the search program Dumb Jump should use. It will _always_ use this searcher. If not set (`nil`) Dumb Jump will use `git-grep` if it's a git project and if not will try searchers in the following order `ag`, `rg`, `grep` (first installed wins). This is necessary if you want full control over the searcher Dumb Jump uses.\n* `(setq dumb-jump-prefer-searcher 'rg)` to let Dumb Jump know your searcher preference. If set this will still use `git-grep` if it's a git project (because it's the fastest), but will you use whatever you set here in any other situation. If not set Dumb Jump will follow the same order as mentioned in the `dumb-jump-force-searcher` description. At this time setting this value is only necessary if you prefer `rg` but have `ag` installed too.\n* `(setq dumb-jump-git-grep-search-args \"\")` to set additional command line arguments when using git-grep for searching (defaults to `\"\"`).\n* `(setq dumb-jump-ag-search-args \"\")` to set additional command line arguments when using ag for searching (defaults to `\"\"`).\n* `(setq dumb-jump-rg-search-args \"\")` to set additional command line arguments when using rg for searching (defaults to `\"--pcre2\"`).\n\n#### If your project has multi-line method signatures [you should use `ag`](https://github.com/jacktasia/dumb-jump/issues/129) or [`rg` version `0.10.0` or higher](https://github.com/jacktasia/dumb-jump/issues/255).\n\nTo learn more about how Dumb Jump picks a searcher see [this issue](https://github.com/jacktasia/dumb-jump/issues/109) and this [pull request](https://github.com/jacktasia/dumb-jump/pull/111).\n\n##### Hydra for effieciency\n\nIf you have [Hydra](https://github.com/abo-abo/hydra) installed, the following is an example hydra for easily using Dumb-Jump and not needing to remember the bindings or function names:\n\n```el\n(defhydra dumb-jump-hydra (:color blue :columns 3)\n    \"Dumb Jump\"\n    (\"j\" dumb-jump-go \"Go\")\n    (\"o\" dumb-jump-go-other-window \"Other window\")\n    (\"e\" dumb-jump-go-prefer-external \"Go external\")\n    (\"x\" dumb-jump-go-prefer-external-other-window \"Go external other window\")\n    (\"i\" dumb-jump-go-prompt \"Prompt\")\n    (\"l\" dumb-jump-quick-look \"Quick look\")\n    (\"b\" dumb-jump-back \"Back\"))\n```\n\nIt can be explicitly bound or used inside another hydra (if you already use something like [Avy](https://github.com/abo-abo/avy)/[Ace](https://github.com/winterTTr/ace-jump-mode) or similar for general \"jumping\").\n\n#### Debugging a jump\n\n1. \u003ckbd\u003eM-x\u003c/kbd\u003e `set-variable dumb-jump-debug t`\n1. try to jump\n1. go to buffer `*Messages*`\n\nMore details [here](http://p.cweiske.de/506). Thanks to @cweiske and @Glumanda99\n\n## Obsolete commands and options\n\nOlder versions of dumb jump didn't use xref, and instead had custom\ncommands. These, while marked obsolete, can still be used:\n\n* `dumb-jump-go` (former) core functionality. Attempts to jump to the\n  definition for the thing under point. This has been replaced in the\n  new interface with `xref-find-definitions` (\u003ckbd\u003eM-.\u003c/kbd\u003e).\n* `dumb-jump-back` jumps back to where you were when you jumped. These\n  are chained so if you go down a rabbit hole you can get back out or\n  where you want to be. This has been replaced with\n  `xref-pop-marker-stack` (\u003ckbd\u003eM-,\u003c/kbd\u003e), but is mostly equivalent.\n* `dumb-jump-quick-look` like `dumb-jump-go` but **only** shows\n  tooltip with `file`, `line`, and `context` it does not jump.\n* `dumb-jump-go-other-window` exactly like `dumb-jump-go` but uses\n  `find-file-other-window` instead of `find-file`\n* `dumb-jump-go-prefer-external` like `dumb-jump-go` but will prefer\n  definitions not in the current buffer\n* `dumb-jump-go-prefer-external-other-window` expected combination of\n  `dumb-jump-go-prefer-external` and `dumb-jump-go-other-window`\n* `dumb-jump-go-prompt` exactly like `dumb-jump-go` but prompts user\n  for function to jump to\n\nA few user options only have an effect when used with the legacy\ninterface. These are:\n\n* `dumb-jump-after-jump-hook` (use `xref-after-jump-hook` instead)\n* `dumb-jump-before-jump-hook` (use `xref-after-return-hook` instead)\n* `dumb-jump-selector`\n* `dumb-jump-aggressive`\n* `dumb-jump-use-visible-window`\n* `dumb-jump-confirm-jump-to-modified-file`\n\nThe minor mode `dumb-jump-mode` binds a few of these commands by\ndefault.\n\nIf you still use Emacs 24 or older, you won't have xref, and have to\nuse the legacy interface instead. In that case, there will also be no\n\"obsolete\" warnings.\n\n## Why?\n\nI wanted \"jump to definition\" functionality to \"just work\" in emacs. I use IntelliJ for Java and this functionality is basically the only thing I miss when I switch back to emacs for work in other languages. There are certainly other packages that offer this type of functionality, but they all require significantly more configuration and are often limited to a particular language. An alternative may be worth setting up if you are in a specific project or language often (see [alternatives](#alternatives)).\n\n## Contributing\n\nFeedback is very welcome via GitHub issues. I will consider supporting other languages either via issue request or PR. If submitting a PR then please add tests as well.\n\n## Running Tests\n\nOpening a PR will use CircleCI to run all the tests against all the supported emacs versions and search programs.\n\n### Running tests locally\n\nThere are a lot of options for running the tests locally:\n\n#### Basic/Classic\nrequires [Cask](https://github.com/cask/cask) using your local emacs\n```sh\ncd /path/to/dumb-jump\ncask\nmake test\n```\n\n#### Concurrent\nrequires golang and [Cask](https://github.com/cask/cask) using your local emacs\n```sh\ncd /path/to/dumb-jump\ncask\nmake test-concurrent\n```\n\n#### Docker (latest emacs)\nonly requires docker and runs tests against emacs 26.1\n```sh\ncd /path/to/dumb-jump\ncask\nmake test-in-docker\n```\n\n#### Docker (all supported emacs versions)\nonly requires docker and runs tests against all supported emacs versions\n```sh\ncd /path/to/dumb-jump\ncask\nmake test-all-in-docker\n```\n\n\n## Alternatives\n\nHere is a list of potential alternative packages for emacs:\n\n* [Tags](https://www.gnu.org/software/emacs/manual/html_node/emacs/Tags-Tables.html) supports multiple languages\n* [GNU Global](http://www.gnu.org/software/global/) supports multiple languages\n* [Tern](http://ternjs.net/) for JavaScript\n* [elpy](https://github.com/jorgenschaefer/elpy) for Python\n* [robe](https://github.com/dgutov/robe) for Ruby\n\nMost of these were sourced from this [emacs StackExchange answer](http://emacs.stackexchange.com/questions/10125/can-emacs-support-go-to-declaration-of-function-in-an-entire-project).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacktasia%2Fdumb-jump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacktasia%2Fdumb-jump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacktasia%2Fdumb-jump/lists"}