Skip to content

Commit

Permalink
Add helm-swoop to swiper
Browse files Browse the repository at this point in the history
  • Loading branch information
pkryger committed Dec 29, 2024
1 parent 0092741 commit 15cf9e1
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions after-init.el
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,7 @@ Defer it so that commands launched immediately after will enjoy the benefits."
(use-package swiper
:init
(use-package ivy
:defer t
:autoload (ivy-previous-history-element
ivy-previous-line
ivy-exit-with-action)
Expand All @@ -932,7 +933,18 @@ If the input is empty, select the previous history element instead."
(ivy-previous-history-element 1)
(ivy-previous-line arg))))

(use-package helm-swoop
:defer t
:init
(defun pk/helm-swoop-from-swiper ()
(interactive)
(unless (string= ivy-text "")
(ivy-exit-with-action
(lambda (_)
(helm-swoop :query ivy-text))))))

(use-package iedit
:defer t
:autoload (iedit-lib-cleanup
iedit-start
iedit-done)
Expand All @@ -957,12 +969,17 @@ If the input is empty, select the previous history element instead."
(message "Matches are not the same length.")
(iedit-done)))))))))

:functions (pk/swiper-C-r
pk/swiper-iedit
pk/helm-swoop-from-swiper)
:bind
(("C-s" . swiper-isearch)
("C-r" . swiper-isearch-backward)
(("C-s" . #'swiper-isearch)
("C-r" . #'swiper-isearch-backward)
:map swiper-map
("C-r" . pk/swiper-C-r)
("C-c ;" . pk/swiper-iedit)))
("C-r" . #'pk/swiper-C-r)
("C-c ;" . #'pk/swiper-iedit)
("C-S-s" . #'pk/helm-swoop-from-swiper)))



;; Disable some ido hooks for helm mode
Expand Down

0 comments on commit 15cf9e1

Please sign in to comment.