summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.el1
-rw-r--r--lisp/init-buffile.el23
-rw-r--r--lisp/init-grep.el24
3 files changed, 23 insertions, 25 deletions
diff --git a/init.el b/init.el
index 3eb1f9e..c6934d3 100644
--- a/init.el
+++ b/init.el
@@ -47,7 +47,6 @@
(require 'init-dired)
(require 'init-git)
(require 'init-projectile)
-(require 'init-grep)
(require 'init-snakemake)
(require 'init-ido)
diff --git a/lisp/init-buffile.el b/lisp/init-buffile.el
index 8c3f6df..28540f9 100644
--- a/lisp/init-buffile.el
+++ b/lisp/init-buffile.el
@@ -67,6 +67,29 @@ user."
(define-key km/file-map "v" 'view-file)
+(autoload 'vc-git-grep "vc-git"
+ "Run git grep, searching for REGEXP in FILES in directory DIR.
+The search is limited to file names matching shell pattern FILES.
+FILES may use abbreviations defined in `grep-files-aliases', e.g.
+entering `ch' is equivalent to `*.[ch]'.")
+
+;; http://stackoverflow.com/questions/16122801/
+;; remove-header-information-from-rgrep-grep-output-in-emacs
+(defun hide-grep-header ()
+ (save-excursion
+ (with-current-buffer grep-last-buffer
+ (goto-line 5)
+ (narrow-to-region (point) (point-max)))))
+
+(defadvice grep (after hide-grep-header activate) (hide-grep-header))
+(defadvice rgrep (after hide-grep-header activate) (hide-grep-header))
+(defadvice lgrep (after hide-grep-hxoeader activate) (hide-grep-header))
+(defadvice grep-find (after hide-grep-header activate) (hide-grep-header))
+(after 'vc-git
+ (defadvice vc-git-grep (after hide-grep-header activate) (hide-grep-header)))
+
+(key-chord-define-global ",z" 'rgrep)
+
;;; Ibuffer
;; Replace buffer-menu with ibuffer.
diff --git a/lisp/init-grep.el b/lisp/init-grep.el
deleted file mode 100644
index ca1b8df..0000000
--- a/lisp/init-grep.el
+++ /dev/null
@@ -1,24 +0,0 @@
-(autoload 'vc-git-grep "vc-git"
- "Run git grep, searching for REGEXP in FILES in directory DIR.
-The search is limited to file names matching shell pattern FILES.
-FILES may use abbreviations defined in `grep-files-aliases', e.g.
-entering `ch' is equivalent to `*.[ch]'.")
-
-;; http://stackoverflow.com/questions/16122801/
-;; remove-header-information-from-rgrep-grep-output-in-emacs
-(defun hide-grep-header ()
- (save-excursion
- (with-current-buffer grep-last-buffer
- (goto-line 5)
- (narrow-to-region (point) (point-max)))))
-
-(defadvice grep (after hide-grep-header activate) (hide-grep-header))
-(defadvice rgrep (after hide-grep-header activate) (hide-grep-header))
-(defadvice lgrep (after hide-grep-hxoeader activate) (hide-grep-header))
-(defadvice grep-find (after hide-grep-header activate) (hide-grep-header))
-(after 'vc-git
- (defadvice vc-git-grep (after hide-grep-header activate) (hide-grep-header)))
-
-(key-chord-define-global ",z" 'rgrep)
-
-(provide 'init-grep)