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?

Fractional, interim or full-time: technical leadership, AI strategy you can actually ship, and honest due diligence. The first conversation is free, and if I can’t help I’ll introduce you to someone who can.

Cape Town · UTC+2 · remote