mirror of
https://github.com/SqrtMinusOne/dotfiles.git
synced 2025-12-11 19:45:25 +03:00
feat(emacs): add deadgrep
This commit is contained in:
parent
1d3e2940b4
commit
dee410617f
2 changed files with 37 additions and 2 deletions
|
|
@ -265,7 +265,8 @@
|
||||||
magit
|
magit
|
||||||
prodigy
|
prodigy
|
||||||
slime
|
slime
|
||||||
forge)))
|
forge
|
||||||
|
deadgrep)))
|
||||||
|
|
||||||
(use-package avy
|
(use-package avy
|
||||||
:straight t
|
:straight t
|
||||||
|
|
@ -653,6 +654,18 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
||||||
|
|
||||||
(save-place-mode 1)
|
(save-place-mode 1)
|
||||||
|
|
||||||
|
(defun my/deadgrep-fix-buffer-advice (fun &rest args)
|
||||||
|
(let ((buf (apply fun args)))
|
||||||
|
(with-current-buffer buf
|
||||||
|
(toggle-truncate-lines 1))
|
||||||
|
buf))
|
||||||
|
|
||||||
|
(use-package deadgrep
|
||||||
|
:straight t
|
||||||
|
:commands (deadgrep)
|
||||||
|
:config
|
||||||
|
(advice-add #'deadgrep--buffer :around #'my/deadgrep-fix-buffer-advice))
|
||||||
|
|
||||||
(use-package ivy
|
(use-package ivy
|
||||||
:straight t
|
:straight t
|
||||||
:config
|
:config
|
||||||
|
|
@ -724,6 +737,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
||||||
"f" 'project-find-file
|
"f" 'project-find-file
|
||||||
"c" 'counsel-yank-pop
|
"c" 'counsel-yank-pop
|
||||||
"a" 'counsel-rg
|
"a" 'counsel-rg
|
||||||
|
"d" 'deadgrep
|
||||||
"A" 'counsel-ag)
|
"A" 'counsel-ag)
|
||||||
|
|
||||||
(general-define-key
|
(general-define-key
|
||||||
|
|
|
||||||
23
Emacs.org
23
Emacs.org
|
|
@ -490,7 +490,8 @@ Do ex search in other buffer. Like =*=, but switch to other buffer and search th
|
||||||
magit
|
magit
|
||||||
prodigy
|
prodigy
|
||||||
slime
|
slime
|
||||||
forge)))
|
forge
|
||||||
|
deadgrep)))
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Avy
|
*** Avy
|
||||||
[[https://github.com/abo-abo/avy][Avy]] is a package that helps navigate Emacs in a tree-like manner.
|
[[https://github.com/abo-abo/avy][Avy]] is a package that helps navigate Emacs in a tree-like manner.
|
||||||
|
|
@ -1100,6 +1101,25 @@ Save the last place visited in the file.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(save-place-mode 1)
|
(save-place-mode 1)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
*** Deadgrep
|
||||||
|
[[https://github.com/Wilfred/deadgrep][deadgrep]] is a nice Emacs for [[https://github.com/BurntSushi/ripgrep][ripgrep]]. Running =ivy-occur= in =counsel-rg= does something a bit similar, but the deadgrep is much more full-featured.
|
||||||
|
|
||||||
|
Somehow I couldn't hook =toogle-truncate-lines= into the existing hooks, so I add advice.
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(defun my/deadgrep-fix-buffer-advice (fun &rest args)
|
||||||
|
(let ((buf (apply fun args)))
|
||||||
|
(with-current-buffer buf
|
||||||
|
(toggle-truncate-lines 1))
|
||||||
|
buf))
|
||||||
|
|
||||||
|
(use-package deadgrep
|
||||||
|
:straight t
|
||||||
|
:commands (deadgrep)
|
||||||
|
:config
|
||||||
|
(advice-add #'deadgrep--buffer :around #'my/deadgrep-fix-buffer-advice))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
** Completion
|
** Completion
|
||||||
*** Ivy, counsel, swiper
|
*** Ivy, counsel, swiper
|
||||||
Minibuffer completion tools for Emacs.
|
Minibuffer completion tools for Emacs.
|
||||||
|
|
@ -1194,6 +1214,7 @@ Setting up quick access to various completions.
|
||||||
"f" 'project-find-file
|
"f" 'project-find-file
|
||||||
"c" 'counsel-yank-pop
|
"c" 'counsel-yank-pop
|
||||||
"a" 'counsel-rg
|
"a" 'counsel-rg
|
||||||
|
"d" 'deadgrep
|
||||||
"A" 'counsel-ag)
|
"A" 'counsel-ag)
|
||||||
|
|
||||||
(general-define-key
|
(general-define-key
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue