33 lines
869 B
EmacsLisp
33 lines
869 B
EmacsLisp
;;; ag.el --- interface to The Silver Searcher -*- lexical-binding: t; -*-
|
|
;;; Commentary:
|
|
;;; Code: https://github.com/emacsorphanage/helm-ag
|
|
|
|
(with-executable 'ag
|
|
(when (feature-p 'helm)
|
|
(use-package helm-ag
|
|
:defer
|
|
:config
|
|
(validate-setq
|
|
;; Insert word at point as search term.
|
|
helm-ag-insert-at-point 'word)))
|
|
(use-package ag
|
|
:defer
|
|
:init
|
|
(if (and (feature-p 'projectile)
|
|
(fboundp 'projectile-ag))
|
|
(global-set-key [remap find-grep] 'projectile-ag)
|
|
(global-set-key [remap find-grep] 'ag))
|
|
:config
|
|
(validate-setq
|
|
ag-project-root-function
|
|
'(lambda ()
|
|
(with-project project (path-buffer-abs)
|
|
(user/proj-root project))))
|
|
|
|
;; Search inside compressed files.
|
|
(add-to-list 'ag-arguments "--search-zip")))
|
|
|
|
|
|
(provide 'utilities/ag)
|
|
;;; ag.el ends here
|