forked from purcell/emacs.d
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit-grep.el
28 lines (21 loc) · 773 Bytes
/
init-grep.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
;;; init-grep.el --- Settings for grep and grep-like tools -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
(setq-default grep-highlight-matches t
grep-scroll-output t)
(when *is-a-mac*
(setq-default locate-command "mdfind"))
(require-package 'wgrep)
(with-eval-after-load 'grep
(dolist (key (list (kbd "C-c C-q") (kbd "w")))
(define-key grep-mode-map key 'wgrep-change-to-wgrep-mode)))
(when (and (executable-find "ag")
(maybe-require-package 'ag))
(require-package 'wgrep-ag)
(setq-default ag-highlight-search t)
(global-set-key (kbd "M-?") 'ag-project))
(when (and (executable-find "rg")
(maybe-require-package 'rg))
(global-set-key (kbd "M-?") 'rg-project))
(provide 'init-grep)
;;; init-grep.el ends here