Skip to content

Instantly share code, notes, and snippets.

@jaycfields
Created November 3, 2012 17:50
Show Gist options
  • Save jaycfields/4008106 to your computer and use it in GitHub Desktop.
Save jaycfields/4008106 to your computer and use it in GitHub Desktop.
(defun grep-in (project-root)
(interactive (list (read-directory-name "Project Root: "
(locate-dominating-file
default-directory
"project.clj"))))
(er/mark-clj-word)
(grep (concat "grep -nH -e "
(buffer-substring-no-properties (region-beginning) (region-end))
" -R " project-root)))
(global-set-key (kbd "C-c C-g") 'grep-in)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment