Fix ivy+wgrep integration

This commit is contained in:
Henrik Lissner 2016-09-16 00:00:22 +02:00
parent 52c599788a
commit 8ea00421b0
3 changed files with 9 additions and 2 deletions

View file

@ -271,7 +271,7 @@
(use-package wgrep
:commands (wgrep-setup wgrep-change-to-wgrep-mode)
:config
(def-popup! "^\\*ivy-occur.+" :align below :size 25 :select t :regexp t)
(def-popup! "^\\*ivy-occur counsel-ag" :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))

View file

@ -32,7 +32,7 @@
(ivy-wgrep-change-to-wgrep-mode)))
(advice-add 'counsel-ag-function :override 'doom*counsel-ag-function)
(define-key counsel-ag-map [backtab] 'ivy-occur)
(define-key counsel-ag-map [backtab] 'doom/counsel-ag-occur)
(setq counsel-find-file-ignore-regexp "\\(?:^[#.]\\)\\|\\(?:[#~]$\\)\\|\\(?:^Icon?\\)"))

View file

@ -125,5 +125,12 @@ interferes with my custom :ag ex command `doom:ivy-ag-search'."
(counsel--async-command ag-cmd))
nil)))
;;;###autoload
(defun doom/counsel-ag-occur ()
"Invoke the search+replace wgrep buffer on the current ag search results."
(interactive)
(require 'wgrep)
(call-interactively 'ivy-occur))
(provide 'defuns-ivy)
;;; defuns-ivy.el ends here