Created
November 3, 2012 17:48
-
-
Save jaycfields/4008104 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun grep-in-project () | |
(interactive) | |
(er/mark-clj-word) | |
(let* ((project-root (locate-dominating-file | |
(file-name-directory (buffer-file-name)) "project.clj"))) | |
(if project-root | |
(grep (concat "grep -nH -e " | |
(buffer-substring-no-properties (region-beginning) (region-end)) | |
" -R " project-root)) | |
(message (concat "no project.clj found at or below " (buffer-file-name)))))) | |
(global-set-key (kbd "C-c g") 'grep-in-project) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment