• Stars
    star
    671
  • Rank 64,898 (Top 2 %)
  • Language
    Emacs Lisp
  • Created almost 6 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

fast, friendly searching with ripgrep and Emacs

Deadgrep: use ripgrep from Emacs โ˜ ๏ธ

Deadgrep is the fast, beautiful text search that your Emacs deserves.

Coverage Status MELPA

screenshot

Table of Contents

Usage

Installation

  1. Install ripgrep. You need version 0.8 or later.

  2. Install deadgrep from MELPA (do M-x package-install RET deadgrep within Emacs 25.1 or later), or copy it into your ~/.emacs.d.

  3. (Optional) add deadgrep to a convenient shortcut. I like F5.

(global-set-key (kbd "<f5>") #'deadgrep)

Keybindings

Navigating results:

Key Action
RET Visit the result, file or push button at point
o Visit the result in another window
n and p Move between search hits
M-n and M-p Move between file headers

The commands deadgrep-forward and deadgrep-backward are also available to move between buttons as well as search hits.

Starting/stopping a search:

Key Action
S Change the search term
T Cycle through available search types: string, words, regexp
C Cycle through case sensitivity types: smart, sensitive, ignore
F Cycle through file modes: all, type, glob
I Switch to incremental search, re-running on every keystroke
D Change the search directory
^ Re-run the search in the parent directory
g Re-run the search
TAB Expand/collapse results for a file
C-c C-k Stop a running search
C-u A prefix argument prevents search commands from starting automatically.

Additional interactive commands

Name Action
imenu Move between files in a results buffer.
deadgrep-kill-all-buffers Kill all open deadgrep buffers.
deadgrep-debug In a results buffer, view the rg command, output and environment used.

Minibuffer

You use the minibuffer to enter a new search term.

You can also reuse a previous search term with M-p in the minibuffer. To edit the default search term, use M-n.

Easy Debugging

The easiest way to debug search results is to review the actual rg command executed.

Fortunately, the deadgrep-debug function makes it easy:

  • Move to the deadgrep results buffer.
  • Type M-x deadgrep-debug.
  • Strike enter, and the debug buffer will appear.
  • Move to the deadgrep debug buffer.

Study the results to review the rg command string and other debugging information to assist you.

Features

Super Fast

Deadgrep uses ripgrep for extremely fast text searches.

If you change your search settings, deadgrep will immediately re-run your search.

Context Aware

Deadgrep works hard to minimise your keystrokes.

Search term: If the region is active, deadgrep uses that.

Search directory: If your current file is in a VCS repository, deadgrep uses that for your search directory.

Regexp and case sensitivity options: Deadgrep re-uses whatever settings you used in your last search.

Globbing and file types: Deadgrep suggests file types and globbing options that match the file you started the search from.

Host: If you're editing a remote file with Tramp, deadgrep will search the remote machine. This requires rg to be installed on that machine.

Easy Filtering

Didn't get the results you wanted? It's easy to change the search term, search type, or search directory, directly from the results buffer. Just push the relevant button.

screenshot

Polish

Deadgrep uses spinners to give you feedback on whether your search has finished.

screenshot

It highlights regexp syntax according to the syntax accepted by rg.

screenshot

When navigating to a line that matched, the relevant part of the line is temporarily highlighted.

screenshot

You can collapse and expand files with TAB.

screenshot

Deadgrep handles minified files robustly.

screenshot

You can always jump to exactly the position that point is on, even when searching files that contain tab characters. You can also navigate to the file itself from the file headings.

Beta Features

You can now edit files directly from results buffers with M-x deadgrep-edit-mode.

It is currently in beta. Alternatively, package wgrep added support for editing deadgrep buffers in April 2023 via wgrep-deadgrep. (One feature unlocked that way is, e.g., the ability to delete a line in edit mode via C-d)

Alternative Projects

I believe that deadgrep is the best tool for doing Emacs text searches, but there are some other great tools out there. See ALTERNATIVES for a discussion.

Why the name?

The name "deadgrep" is a pun on "R.I.P. grep", and ripgrep.el was already taken.

R.I.P wasn't actually the intention of the name "ripgrep" (see their FAQ), but deadgrep is easy to remember and type.

More Repositories

1

difftastic

a structural diff that understands syntax ๐ŸŸฅ๐ŸŸฉ
Rust
15,946
star
2

helpful

A better Emacs *help* buffer
Emacs Lisp
972
star
3

ag.el

An Emacs frontend to The Silver Searcher
Emacs Lisp
521
star
4

babyc

A toy C compiler
C
496
star
5

bfc

An industrial-grade brainfuck compiler
Rust
479
star
6

suggest.el

discover elisp functions that do what you want
Emacs Lisp
344
star
7

emacs-refactor

language-specific refactoring in Emacs
Emacs Lisp
341
star
8

ht.el

The missing hash table library for Emacs
Emacs Lisp
235
star
9

elisp-refs

semantic code search for emacs lisp
Emacs Lisp
111
star
10

refine

interactive value editing in emacs lisp
Emacs Lisp
85
star
11

tco.el

Tail call optimisation in Emacs lisp
Emacs Lisp
76
star
12

pyimport

Manage Python imports from Emacs!
Emacs Lisp
73
star
13

mustache.el

A mustache templating library for Emacs
Emacs Lisp
68
star
14

elisp-def

Find Emacs Lisp definitions
Emacs Lisp
61
star
15

propcheck

Quickcheck/hypothesis style testing for elisp
Emacs Lisp
59
star
16

.emacs.d

My emacs configuration
Emacs Lisp
52
star
17

pip-requirements.el

Major mode for editing pip requirements files
Emacs Lisp
51
star
18

tree-sitter-elisp

tree-sitter grammar for emacs lisp
C
46
star
19

loop.el

friendly imperative loop structures for Emacs lisp
Emacs Lisp
36
star
20

simpla-vortaro

Inteligenta vortaro de Esperanto / An intelligent Esperanto dictionary
Python
34
star
21

python-info

The python manual in texinfo format, particularly for Emacs users
Makefile
31
star
22

Brainfrack

BF implementations in different languages
Smalltalk
29
star
23

bison-mode

Emacs major mode for Bison/Jison, Yacc and Lex grammars
Emacs Lisp
27
star
24

garden

an interactive programming language
Rust
26
star
25

company-try-hard

Get all completions from company-mode backends
Emacs Lisp
24
star
26

Minimal-scheme

A simple scheme interpreter in Python
Python
23
star
27

logstash-conf.el

Emacs major mode for editing logstash configuration files
Emacs Lisp
21
star
28

trifle

A friendly lisp with a focus on interactivity and collaboration
Python
21
star
29

django-test-mixins

Additional assertions and test conveniences for testing django sites
Python
19
star
30

linkdoc

Rust tool for finding dead links on a site
Rust
14
star
31

cask-mode

Major mode for editing Cask files
Emacs Lisp
12
star
32

flymake-jshint.el

JSHint with flymake for Emacs
Emacs Lisp
12
star
33

emacsbench

Benchmarking Emacs itself
C
12
star
34

Blackjack

Simple blackjack simulator in Haskell
Haskell
11
star
35

flycheck-title

show flycheck errors in the frame title
Emacs Lisp
11
star
36

flycheck-pyflakes

flycheck support for pyflakes
Emacs Lisp
10
star
37

flycheck-pkg-config

Configure flycheck using pkg-config
Emacs Lisp
10
star
38

dotfiles

Configuration files for unix utilities
Shell
10
star
39

ReVo-utilities

a few handy scripts to work with XML dumps from ReVo
XSLT
10
star
40

Lython

Toy Lisp to Python compiler
Python
9
star
41

ez-query-replace

query-replace in Emacs with smarts and history!
Emacs Lisp
9
star
42

mal_pharo

A Make A Lisp implementation in Pharo
Smalltalk
8
star
43

FuzzyBranch

git-checkout with fuzzy branch names
Haskell
7
star
44

peval

partial evaluator for elisp
Emacs Lisp
6
star
45

wilfred.github.com

My personal blog
HTML
6
star
46

versor

Mirror of https://sourceforge.net/projects/emacs-versor/
Emacs Lisp
5
star
47

django-function-cache

Cache (memoize) a function's output using Django's caching API
Python
5
star
48

elisp-complete

Emacs Lisp
5
star
49

metawiki

Proof-of-concept self-hosting metawiki
JavaScript
5
star
50

line-numbers

accessing line numbers by string offsets
Rust
4
star
51

the_end_times

comparing programming language implementation performance
Ruby
4
star
52

autotoc

Generate and insert tables of contents in markdown files
Clojure
4
star
53

elisp-fu

Emacs Lisp
4
star
54

oosh

Object Oriented Shell
Python
4
star
55

company-smart-elisp

a contextual company backend for elisp
Emacs Lisp
4
star
56

podkastaro

Podcast aggregator, targeted at Esperanto radio
PHP
3
star
57

gameboy_emulator

Rust code following along with http://imrannazar.com/GameBoy-Emulation-in-JavaScript
Rust
3
star
58

HandyBot

IRC Bot in Clojure
Clojure
3
star
59

with-namespace.el

interoperable elisp namespaces
Emacs Lisp
3
star
60

advent-of-code

Racket
2
star
61

not-quite-modal.el

Modal-inspired movement in Emacs
Emacs Lisp
2
star
62

srch

Emacs Lisp
2
star
63

sudoku

A sudoku solver in CoffeeScript
CSS
2
star
64

userinfo

cross-platform user details library in Rust
Rust
2
star
65

nmap-service

A service for telling clients what ports they have open
Python
2
star
66

smart-eval.el

helpful eval and re-eval for elisp
Emacs Lisp
2
star
67

Jeweled

A Bejeweled bot
Python
2
star
68

elisp-index

Emacs Lisp
2
star
69

Picky

An opinionated wiki
JavaScript
2
star
70

expenses

Categorising and analysing personal expenses
Python
1
star
71

ButlerBot

Haskell news email bot
Haskell
1
star
72

syntax-cafe

programming languages to suit all tastes
TypeScript
1
star
73

podkastaro2

Nova versio de Podkastaro, uzanta Django-n
Python
1
star
74

commonmark-extract-text

extract plain text from commonmark/markdown source
JavaScript
1
star
75

hubot-tube-status

A hubot script for getting the current tube status
CoffeeScript
1
star
76

bf_bench

BF implementation benchmarking
Brainfuck
1
star
77

rustls.el

Emacs Lisp
1
star
78

emailomatic

web scraper for collecting interesting events to attend
Clojure
1
star
79

sooty

a dumb lisp with a handwritten GC
Rust
1
star
80

chrome_crash_example

JavaScript
1
star
81

parsimonious

Simple command line calculator using hand written parser
Java
1
star
82

commonmark-wikiwords

Convert WikiWords to links in commonmark source
JavaScript
1
star
83

zorklike

a text adventure game inspired web page
JavaScript
1
star
84

is_my_internet_filtered

A website that tests whether any content is being filtered
JavaScript
1
star
85

dumb-code-quick

more tests, less code
TypeScript
1
star
86

blog-comments

a simple blog comments system in Clojure
Clojure
1
star