{"id":15653681,"url":"https://github.com/jimporter/urgrep","last_synced_at":"2025-10-11T23:42:45.200Z","repository":{"id":77370006,"uuid":"364450140","full_name":"jimporter/urgrep","owner":"jimporter","description":"Universal recursive grep for Emacs","archived":false,"fork":false,"pushed_at":"2025-03-16T00:31:51.000Z","size":242,"stargazers_count":30,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T10:06:38.213Z","etag":null,"topics":["ack","ag","emacs","emacs-package","git-grep","grep","ripgrep","ugrep"],"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/jimporter.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","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":"2021-05-05T03:22:46.000Z","updated_at":"2025-03-16T00:31:54.000Z","dependencies_parsed_at":"2023-11-11T00:25:02.187Z","dependency_job_id":"9c1b9eca-3db7-45f0-bc4e-1da707aa8db5","html_url":"https://github.com/jimporter/urgrep","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimporter%2Furgrep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimporter%2Furgrep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimporter%2Furgrep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimporter%2Furgrep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jimporter","download_url":"https://codeload.github.com/jimporter/urgrep/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249048738,"owners_count":21204306,"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":["ack","ag","emacs","emacs-package","git-grep","grep","ripgrep","ugrep"],"created_at":"2024-10-03T12:46:29.392Z","updated_at":"2025-10-11T23:42:40.172Z","avatar_url":"https://github.com/jimporter.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Urgrep - Universal Recursive Grep\n\n[![GNU ELPA version][elpa-image]][elpa-link]\n\n**Urgrep** is an Emacs package to provide a universal frontend for *any*\ngrep-like tool, as an alternative to the built-in `M-x rgrep` (and other similar\npackages). Currently, [`ugrep`][ugrep], [`ripgrep`][ripgrep], [`ag`][ag],\n[`ack`][ack], [`git grep`][git-grep], and [`grep`][grep]/[`find`][find] are\nsupported.\n\n## Why Urgrep?\n\n#### One package, many tools\n\nNo matter which tool you prefer, you can use it with Urgrep. If a new tool comes\nalong, you won't need to find a new Emacs package for it.\n\n#### Rich minibuffer interface\n\nEasily manipulate per-search options with Isearch-like key bindings within the\nUrgrep minibuffer prompt.\n\n#### Seamless support for Tramp\n\nEach host can use a different set of tools depending on what the system has\ninstalled without any special configuration.\n\n## Using Urgrep\n\nThe primary entry point to Urgrep is the interactive function `urgrep`. This\nprompts you for a query to search for in, by default, the root directory of the\ncurrent project (or the `default-directory` if there is no project). By\nprefixing with \u003ckbd\u003eC-u\u003c/kbd\u003e, this will always start the search within the\n`default-directory`. With \u003ckbd\u003eC-u\u003c/kbd\u003e \u003ckbd\u003eC-u\u003c/kbd\u003e, Urgrep will first\nprompt you for the search directory. Within the search prompt, there are several\nIsearch-like key bindings to let you modify the search's behavior:\n\n| Key binding                 | Action                                   |\n|:----------------------------|:-----------------------------------------|\n| \u003ckbd\u003eM-s\u003c/kbd\u003e \u003ckbd\u003eh\u003c/kbd\u003e | Describe key bindings                    |\n| \u003ckbd\u003eM-s\u003c/kbd\u003e \u003ckbd\u003er\u003c/kbd\u003e | Toggle regexp search                     |\n| \u003ckbd\u003eM-s\u003c/kbd\u003e \u003ckbd\u003ec\u003c/kbd\u003e | Toggle case folding                      |\n| \u003ckbd\u003eM-s\u003c/kbd\u003e \u003ckbd\u003eH\u003c/kbd\u003e | Toggle searching in hidden files         |\n| \u003ckbd\u003eM-s\u003c/kbd\u003e \u003ckbd\u003ef\u003c/kbd\u003e | Set wildcards to filter files¹           |\n| \u003ckbd\u003eM-s\u003c/kbd\u003e \u003ckbd\u003eC\u003c/kbd\u003e | Set number of lines of context²          |\n| \u003ckbd\u003eM-s\u003c/kbd\u003e \u003ckbd\u003eB\u003c/kbd\u003e | Set number of lines of leading context²  |\n| \u003ckbd\u003eM-s\u003c/kbd\u003e \u003ckbd\u003eA\u003c/kbd\u003e | Set number of lines of trailing context² |\n| \u003ckbd\u003eM-s\u003c/kbd\u003e \u003ckbd\u003et\u003c/kbd\u003e | Set the search tool                      |\n\n\u003e 1. Prompts with a recursive minibuffer\u003cbr\u003e\n\u003e 2. With a numeric prefix argument, set immediately; otherwise, use a recursive\n\u003e    minibuffer\n\nIn addition to the above, you can call `urgrep-run-command`, which works like\n`urgrep` but allows you to manually edit the command before executing it.\n\n### Modifying your search\n\nAfter performing a search, you can adjust an existing query with \u003ckbd\u003eC-u\u003c/kbd\u003e\n\u003ckbd\u003eg\u003c/kbd\u003e, reopening the original search prompt. You can also adjust some of\nthe search options, such as case folding, immediately:\n\n| Key binding  | Action                            |\n|:-------------|:----------------------------------|\n| \u003ckbd\u003ec\u003c/kbd\u003e | Toggle case folding               |\n| \u003ckbd\u003eH\u003c/kbd\u003e | Toggle searching in hidden files  |\n| \u003ckbd\u003eC\u003c/kbd\u003e | Expand lines of context¹          |\n| \u003ckbd\u003eB\u003c/kbd\u003e | Expand lines of leading context¹  |\n| \u003ckbd\u003eA\u003c/kbd\u003e | Expand lines of trailing context¹ |\n\n\u003e 1. Expand by one line by default, or by *N* lines with a prefix argument\n\n### Configuring the tool to use\n\nBy default, Urgrep tries all search tools it's aware of to find the best option.\nTo improve performance, you can restrict the set of tools to search for by\nsetting `urgrep-preferred-tools`:\n\n```elisp\n(setq urgrep-preferred-tools '(git-grep grep))\n```\n\nIf a tool is installed in an unusual place on your system, you can specify this\nby providing a cons cell as an element in `urgrep-preferred-tools`:\n\n```elisp\n(setq urgrep-preferred-tools '((ag . \"/home/coco/bin/ag\")))\n```\n\nThis also works with connection-local variables:\n\n```elisp\n(connection-local-set-profile-variables 'urgrep-ripgrep\n '((urgrep-preferred-tools . (ripgrep))))\n\n(connection-local-set-profiles\n '(:application tramp :machine \"imagewriter\") 'urgrep-ripgrep)\n```\n\n### Using with wgrep\n\n[wgrep][wgrep] provides a convenient way to edit results in grep-like buffers.\nUrgrep can hook into wgrep to support this as well. To enable this, just load\n`urgrep-wgrep.el`.\n\n### Using with Xref\n\n[Xref][xref] lets you search through your projects to find strings, identifiers\netc. You can make Xref use Urgrep to generate its search command by loading\n`urgrep-xref.el`.\n\n### Using with `outline-minor-mode`\n\nInside of Urgrep buffers, you can enable `outline-minor-mode`. This will let you\ntoggle the visibility of each file's results.\n\n### Using with Eshell\n\nIn Eshell buffers, you can call `urgrep` much like you'd call any command-line\nrecursive grep command. The following options are supported:\n\n| Option                      | Action                                      |\n|:----------------------------|:--------------------------------------------|\n| `-G`, `--basic-regexp`      | Pattern is a basic regexp                   |\n| `-E`, `--extended-regexp`   | Pattern is an extended regexp               |\n| `-P`, `--perl-regexp`       | Pattern is a Perl-compatible regexp         |\n| `-R`, `--default-regexp`    | Pattern is a regexp with the default syntax |\n| `-F`, `--fixed-strings`     | Pattern is a string                         |\n| `-s`, `--case-sensitive`    | Search case-sensitively                     |\n| `-i`, `--ignore-case`       | Search case-insensitively                   |\n| `-S`, `--smart-case`        | Ignore case if pattern is all lower-case    |\n| `--group` / `--no-group`    | Enable/disable grouping results by file     |\n| `--hidden` / `--no-hidden`  | Enable/disable searching hidden files       |\n| `-Cn`, `--context=n`        | Show *n* lines of context                   |\n| `-Bn`, `--before-context=n` | Show *n* lines of leading context           |\n| `-An`, `--after-context=n`  | Show *n* lines of trailing context          |\n\n## Programmatic interface\n\nIn addition to interactive use, Urgrep is designed to allow for programmatic\nuse, returning a command to execute with the specified query and options:\n`urgrep-command`. This takes a `query` as well as several optional keyword\narguments. For more information, consult the docstring for `urgrep-command`.\n\n## Contributing\n\nThis project [assigns copyright][fsf-copyright] to the Free Software Foundation,\nso if you'd like to contribute code, please make sure you've filled out the\nassignment form and that it's up to date. In any case, before submitting\npatches, it's probably best to [file an issue][new-issue] first so that we\ncan discuss the best way to do things.\n\n[elpa-image]: https://elpa.gnu.org/packages/urgrep.svg\n[elpa-link]: https://elpa.gnu.org/packages/urgrep.html\n[ugrep]: https://github.com/Genivia/ugrep\n[ripgrep]: https://github.com/BurntSushi/ripgrep\n[ag]: https://github.com/ggreer/the_silver_searcher\n[ack]: https://beyondgrep.com/\n[git-grep]: https://git-scm.com/docs/git-grep\n[grep]: https://www.gnu.org/software/grep/\n[find]: https://www.gnu.org/software/findutils/\n[wgrep]: https://github.com/mhayashi1120/Emacs-wgrep\n[xref]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Xref.html\n[fsf-copyright]: https://www.gnu.org/prep/maintain/html_node/Copyright-Papers.html\n[new-issue]: https://github.com/jimporter/urgrep/issues/new\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimporter%2Furgrep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimporter%2Furgrep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimporter%2Furgrep/lists"}