diff options
author | Kyle Meyer <kyle@kyleam.com> | 2014-11-29 22:41:55 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2014-11-29 22:41:55 -0500 |
commit | 8fe6981c8bf8571983420202be1275c5388fa34d (patch) | |
tree | ab232a581a3a0a8070948fbbe2b3805bae33e3c6 /lisp | |
parent | dc1fb5b94cf89f6cc3fc903e2caa1a42a83aa216 (diff) | |
download | emacs.d-8fe6981c8bf8571983420202be1275c5388fa34d.tar.gz |
Move grep-related stuff to init-buffile.el
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/init-buffile.el | 23 | ||||
-rw-r--r-- | lisp/init-grep.el | 24 |
2 files changed, 23 insertions, 24 deletions
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) |