Add wgrep

This commit is contained in:
Henrik Lissner 2016-06-13 02:11:33 -04:00
parent 4dc06a6e8f
commit 7038a5b66d
4 changed files with 24 additions and 9 deletions

1
Cask
View file

@ -78,6 +78,7 @@
(depends-on "smart-forward")
(depends-on "smartparens")
(depends-on "swiper")
(depends-on "wgrep")
;; Documentation --- core/core-docs.el
(depends-on "dash-at-point")

View file

@ -261,6 +261,14 @@
(use-package swiper :commands (swiper swiper-all))
(use-package wgrep
:commands (wgrep-setup wgrep-change-to-wgrep-mode)
:config
(def-popup! "^\\*ivy-occur.+" :align below :size 25 :select t :regexp t)
(setq wgrep-auto-save-buffer t)
(advice-add 'wgrep-abort-changes :after 'doom/popup-close)
(advice-add 'wgrep-finish-edit :after 'doom/popup-close))
;;
;; Keybinding fixes

View file

@ -31,6 +31,12 @@
(format counsel-ag-base-command (shell-quote-argument regex)))
nil))))
(add-hook! doom-popup-mode
(when (eq major-mode 'ivy-occur-grep-mode)
(ivy-wgrep-change-to-wgrep-mode)))
(define-key counsel-ag-map [backtab] 'ivy-occur))
(use-package counsel-projectile :after projectile)
(provide 'core-ivy)

View file

@ -38,15 +38,15 @@
;; :nokill = Won't be killed when closed
;; :modeline = Show the modeline
(defvar doom-popup-rules
'(("^\\*doom\\*$" :noesc :nokill :modeline)
("^\\*doom.*\\*$" :noesc :nokill)
(compilation-mode :noesc)
(help-mode :noesc)
(comint-mode :noesc :nokill)
(eshell-mode :noesc :nokill)
(messages-buffer-mode :nokill)
(esup-mode :noesc)
(tabulated-list-mode :noesc)))
'(("^\\*doom\\(:scratch\\)?\\*$" :noesc :nokill :modeline)
("^\\*doom.*\\*$" :noesc :nokill)
(ivy-occur-grep-mode :noesc)
(compilation-mode :noesc)
(comint-mode :noesc :nokill)
(eshell-mode :noesc :nokill)
(messages-buffer-mode :nokill)
(esup-mode :noesc)
(tabulated-list-mode :noesc)))
;; There is no shackle-popup hook, so I hacked one in
(advice-add 'shackle-display-buffer :around 'doom*popup-init)