ivy: Add wgrep package
Can be used with counsel-git-grep to edit results in an occur buffer. Handy! Add wgrep bindings ",w" to enter wgrep mode ",," to commit changes ",a" to abort counsel: Fix command output for wgrep wgrep doesn't work with the column number in the command output
This commit is contained in:
parent
19c262ea0c
commit
3ac7efeb90
|
@ -18,13 +18,14 @@
|
||||||
(ivy :location built-in)
|
(ivy :location built-in)
|
||||||
(ivy-spacemacs-help :location local)
|
(ivy-spacemacs-help :location local)
|
||||||
smex
|
smex
|
||||||
swiper))
|
swiper
|
||||||
|
wgrep))
|
||||||
|
|
||||||
(defun spacemacs-ivy/init-counsel ()
|
(defun spacemacs-ivy/init-counsel ()
|
||||||
(defvar spacemacs--counsel-commands
|
(defvar spacemacs--counsel-commands
|
||||||
'(("ag" . "ag --vimgrep %s %S .")
|
'(("ag" . "ag --nocolor --nogroup %s %S .")
|
||||||
("pt" . "pt -e --nocolor --nogroup --column %s %S .")
|
("pt" . "pt -e --nocolor --nogroup %s %S .")
|
||||||
("ack" . "ack --nocolor --nogroup --column %s %S .")
|
("ack" . "ack --nocolor --nogroup %s %S .")
|
||||||
("grep" . "grep -nrP %s %S ."))
|
("grep" . "grep -nrP %s %S ."))
|
||||||
"Alist of search commands and their corresponding commands
|
"Alist of search commands and their corresponding commands
|
||||||
with options to run in the shell.")
|
with options to run in the shell.")
|
||||||
|
@ -332,6 +333,13 @@ Helm hack."
|
||||||
(with-eval-after-load 'evil
|
(with-eval-after-load 'evil
|
||||||
(evil-make-overriding-map ivy-occur-mode-map 'normal))
|
(evil-make-overriding-map ivy-occur-mode-map 'normal))
|
||||||
|
|
||||||
|
(spacemacs/set-leader-keys-for-major-mode 'ivy-occur-grep-mode
|
||||||
|
"w" 'ivy-wgrep-change-to-wgrep-mode)
|
||||||
|
(evil-define-key 'normal wgrep-mode-map ",," 'wgrep-finish-edit)
|
||||||
|
(evil-define-key 'normal wgrep-mode-map ",c" 'wgrep-finish-edit)
|
||||||
|
(evil-define-key 'normal wgrep-mode-map ",a" 'wgrep-abort-changes)
|
||||||
|
(evil-define-key 'normal wgrep-mode-map ",k" 'wgrep-abort-changes)
|
||||||
|
|
||||||
(defun spacemacs/ivy-available-repls ()
|
(defun spacemacs/ivy-available-repls ()
|
||||||
"Show available repls."
|
"Show available repls."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
@ -540,3 +548,5 @@ around point as the initial input."
|
||||||
"sb" 'swiper-all
|
"sb" 'swiper-all
|
||||||
"sB" 'spacemacs/swiper-all-region-or-symbol)
|
"sB" 'spacemacs/swiper-all-region-or-symbol)
|
||||||
(global-set-key "\C-s" 'swiper))))
|
(global-set-key "\C-s" 'swiper))))
|
||||||
|
|
||||||
|
(defun spacemacs-ivy/init-wgrep ())
|
||||||
|
|
Loading…
Reference in a new issue