summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--init.el1
-rw-r--r--lisp/init-git.el30
-rw-r--r--lisp/init-grep.el31
3 files changed, 32 insertions, 30 deletions
diff --git a/init.el b/init.el
index 67eb89d..8d008fa 100644
--- a/init.el
+++ b/init.el
@@ -19,6 +19,7 @@
(require 'init-ibuffer)
(require 'init-sessions)
(require 'init-git)
+(require 'init-grep)
(require 'init-lisp)
(require 'init-editing)
(require 'init-python-mode)
diff --git a/lisp/init-git.el b/lisp/init-git.el
index 98710d1..faaf338 100644
--- a/lisp/init-git.el
+++ b/lisp/init-git.el
@@ -45,34 +45,4 @@
(add-hook 'git-commit-mode-hook 'flyspell-mode))
-(use-package grep
- :ensure nil ;; package is bundled with emacs
-
- :bind (:map grep-mode-map
- ;; make C-o and o behave as in dired
- ("o" . grep-visit-buffer-other-window)
- ("C-o" . grep-visit-buffer-other-window-noselect)
- ;; n and p changes line as in ag-mode
- ("n" . compilation-next-error)
- ("p" . compilation-previous-error))
-
- :config
- (defun grep-visit-buffer-other-window (&optional event noselect)
- "Visit grep result in another window."
- (interactive)
- (let ((current-window (selected-window)))
- (compile-goto-error event)
- (when noselect
- (select-window current-window))))
-
- (defun grep-visit-buffer-other-window-noselect (&optional event)
- "Visit grep result in another window, but don't select it."
- (interactive)
- (grep-visit-buffer-other-window event t))
-
- (add-hook 'grep-mode-hook
- (lambda ()
- ;; wrap lines
- (setq-local truncate-lines nil))))
-
(provide 'init-git)
diff --git a/lisp/init-grep.el b/lisp/init-grep.el
new file mode 100644
index 0000000..84ea710
--- /dev/null
+++ b/lisp/init-grep.el
@@ -0,0 +1,31 @@
+(use-package grep
+ :ensure nil ;; package is bundled with emacs
+
+ :bind (:map grep-mode-map
+ ;; make C-o and o behave as in dired
+ ("o" . grep-visit-buffer-other-window)
+ ("C-o" . grep-visit-buffer-other-window-noselect)
+ ;; n and p changes line as in ag-mode
+ ("n" . compilation-next-error)
+ ("p" . compilation-previous-error))
+
+ :config
+ (defun grep-visit-buffer-other-window (&optional event noselect)
+ "Visit grep result in another window."
+ (interactive)
+ (let ((current-window (selected-window)))
+ (compile-goto-error event)
+ (when noselect
+ (select-window current-window))))
+
+ (defun grep-visit-buffer-other-window-noselect (&optional event)
+ "Visit grep result in another window, but don't select it."
+ (interactive)
+ (grep-visit-buffer-other-window event t))
+
+ (add-hook 'grep-mode-hook
+ (lambda ()
+ ;; wrap lines
+ (setq-local truncate-lines nil))))
+
+(provide 'init-grep)