Experimental arbitrary overlays interface for iedit

`SPC s e` does not select the symbol under point, instead there is no
overlays created and using tab will add overlays 1 character wide

Old `SPC s e` is now on `SPC s E` (to reflect the other bindings like
`SPC s p` and `SPC s P`)
This commit is contained in:
syl20bnr 2015-08-16 00:35:20 -04:00
parent a3aaf8a8f9
commit dc224788c7

View file

@ -939,7 +939,8 @@ Example: (evil-map visual \"<\" \"<gv\")"
(define-key evil-iedit-state-map
(kbd evil-leader/leader) evil-leader--default-map))
(evil-leader/set-key "se" 'evil-iedit-state/iedit-mode)
(evil-leader/set-key "se" 'evil-iedit-state)
(evil-leader/set-key "sE" 'evil-iedit-state/iedit-mode)
(add-to-hooks 'spacemacs/evil-state-lazy-loading '(find-file-hook)))
(defun spacemacs/init-evil-indent-textobject ()
@ -2401,7 +2402,29 @@ Put (global-hungry-delete-mode) in dotspacemacs/config to enable by default."
(use-package iedit
:defer t
:init
(setq iedit-toggle-key-default nil)))
(progn
(setq iedit-current-symbol-default t
iedit-only-at-symbol-boundaries t
iedit-toggle-key-default nil))
:config
(defun iedit-toggle-selection ()
"Override default iedit function to be able to add arbitrary overlays.
It will toggle the overlay under point or create an overlay of one character."
(interactive)
(iedit-barf-if-buffering)
(let ((ov (iedit-find-current-occurrence-overlay)))
(if ov
(iedit-restrict-region (overlay-start ov) (overlay-end ov) t)
(save-excursion
(push (iedit-make-occurrence-overlay (point) (1+ (point)))
iedit-occurrences-overlays))
(setq iedit-mode
(propertize
(concat " Iedit:" (number-to-string
(length iedit-occurrences-overlays)))
'face 'font-lock-warning-face))
(force-mode-line-update))))))
(defun spacemacs/init-indent-guide ()
(use-package indent-guide