Add gy operator for yanking without indentation
Copies (a b c) As (a b c)
This commit is contained in:
parent
9e3974d2f3
commit
07380af819
3 changed files with 19 additions and 0 deletions
|
@ -217,6 +217,19 @@ See `+evil/next-preproc-directive' for details."
|
|||
(interactive "p")
|
||||
(+evil/next-comment (- count)))
|
||||
|
||||
;;;###autoload (autoload '+evil:yank-unindented "editor/evil/autoload/evil" nil t)
|
||||
(evil-define-operator +evil:yank-unindented (beg end type register yank-handler)
|
||||
"Saves the (reindented) characters in motion into the kill-ring."
|
||||
:move-point nil
|
||||
:repeat nil
|
||||
(interactive "<R><x><y>")
|
||||
(let ((indent (save-excursion (goto-char beg) (current-indentation)))
|
||||
(text (buffer-substring beg end)))
|
||||
(with-temp-buffer
|
||||
(insert text)
|
||||
(indent-rigidly (point-min) (point-max) (- indent))
|
||||
(evil-yank (point-min) (point-max)))))
|
||||
|
||||
|
||||
;;
|
||||
;;; wgrep
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue