Keybinding for emacs helm to recursively grep certain file extensions in your src directories

1 min read

Helm for Emacs is a fantastic Quicksilver-like extension, but it gets quite wordy sometimes. Instead of C-u M-x helm-do-grep *nav to dir* *enter extensions* *enter query* to recursively grep, I defined the following in my init.el. Now hitting F1 will grep actual source across all my projects.

(defun project-search ()
  (interactive)
  (helm-do-grep-1 '("/home/vaughn/src")
                  '(4)
                  nil
                  '("*.clj" "*.cljs")))

(global-set-key (kbd "<f1>") 'project-search)
Work with me

Need a CTO in the room?

Tell me what is going on. The first conversation is free, I will say honestly whether I can help, and if I can’t I’ll introduce you to someone who can. Fractional, interim, or full-time for the right company.

Open to conversations about the next engagement. Cape Town · UTC+2 · remote