Created
September 12, 2016 21:13
-
-
Save jonEbird/c951f1f889d10de31cc631eb61d93394 to your computer and use it in GitHub Desktop.
Running counsel-ag while automatically ignoring git submoules
This file contains 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 jsm/projectile-counsel-ag () | |
"Run counsel-ag within projectile root while ignoring git submodule paths." | |
(interactive) | |
(let ((default-directory (projectile-project-root)) | |
(agignore-cmd "git config --file .gitmodules --get-regexp path | awk '{ print $2 }' > .agignore")) | |
(shell-command agignore-cmd nil nil) | |
(counsel-ag (thing-at-point 'symbol) (projectile-project-root)))) | |
(define-key projectile-command-map (kbd "s s") 'jsm/projectile-counsel-ag) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment