Last active
June 15, 2017 03:44
-
-
Save acro5piano/99bc2301d460fb8af76f2e4279eb3842 to your computer and use it in GitHub Desktop.
ido-git-grepを作った(仮) ref: http://qiita.com/acro5piano/items/07f397c83fbe9b153438
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 ido-git-grep() | |
(interactive) | |
(setq user-input-line | |
(split-string | |
(ido-completing-read | |
"git-grep:" | |
(split-string (shell-command-to-string | |
(format "git grep -n %s" (read-string "keyword:"))) | |
"\n")) | |
":")) | |
(find-file (nth 0 user-input-line)) | |
(goto-char (point-min)) | |
(forward-line (1- (string-to-number (nth 1 user-input-line))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment