Use ack instead of grep when using helm.

This commit is contained in:
Lars Tveito 2015-04-17 00:19:38 +02:00
parent 0ed6e2239f
commit 1cfd62c1d5

View File

@ -442,8 +442,16 @@
and don't have any particular complaints. Though I've got a feeling I'm and don't have any particular complaints. Though I've got a feeling I'm
missing out on something by not using [[https://github.com/emacs-helm/helm][helm]]. I will [[http://tuhdo.github.io/helm-intro.html][this excellent missing out on something by not using [[https://github.com/emacs-helm/helm][helm]]. I will [[http://tuhdo.github.io/helm-intro.html][this excellent
tutorial]] as a starting point, along with some of the suggested tutorial]] as a starting point, along with some of the suggested
configurations. Note that the changes in bindings are located in the key configurations.
bindings (found near the end of the configuration).
~helm~ has a wonderful feature, being able to grep files by ~C-s~
anywhere; this is useful, but I almost always want to do recursive greps
(which you can do by ~C-u C-s~). [[http://beyondgrep.com/][ack]] is a great ~grep~-replacement, and
is designed to search source code. Let's replace ~grep~ with ~ack~ and do
recursive searches by default.
Note that some changes in bindings are located in the key bindings (found
near the end of the configuration).
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(require 'helm) (require 'helm)
@ -456,6 +464,9 @@
helm-move-to-line-cycle-in-source t helm-move-to-line-cycle-in-source t
projectile-completion-system 'helm) projectile-completion-system 'helm)
(when (executable-find "ack")
(setq helm-grep-default-command "ack -H --no-group --no-color %e %p %f"))
(helm-mode 1) (helm-mode 1)
(helm-projectile-on) (helm-projectile-on)
(helm-adaptive-mode 1) (helm-adaptive-mode 1)