Skip to content

Instantly share code, notes, and snippets.

@daviderestivo
Created August 22, 2017 06:18
Show Gist options
  • Save daviderestivo/932ffe0b10a12ab04257c62fd7051cd7 to your computer and use it in GitHub Desktop.
Save daviderestivo/932ffe0b10a12ab04257c62fd7051cd7 to your computer and use it in GitHub Desktop.
Replace helm grep with ag (The Silver Searcher)
;; Replace the default helm grep command with ag.
;; Requires "The Silver Searcher" (ag) to be installed.
;; On macOS use: 'brew install the_silver_searcher'
(when (executable-find "ag")
;; For helm to recognize correctly the matches we need to enable
;; line numbers and columns in its output, something the
;; --vimgrep option does.
(setq helm-grep-default-command "ag --vimgrep --nogroup --nocolor -z %p %f"
helm-grep-default-recurse-command "ag --vimgrep --nogroup --nocolor -z %p %f"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment