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)

Need a CTO in the room?

Tell me what is going on. The first conversation is free, and I will say honestly whether I can help. If I can’t, I’ll introduce you to someone who can.

Cape Town, working remotely. My mornings overlap with Australian afternoons, and my afternoons with the UK, Europe and the US east coast. Or message me on LinkedIn.