mirror of
https://github.com/abo-abo/avy.git
synced 2025-10-13 13:33:03 +00:00
parent
85a384a151
commit
2e3c2f7c88
18
avy.el
18
avy.el
@ -82,6 +82,7 @@ in the avy overlays."
|
||||
(const avy-copy-line)
|
||||
(const avy-copy-region)
|
||||
(const avy-move-line)
|
||||
(const avy-move-region)
|
||||
(function :tag "Other command"))
|
||||
:value-type (repeat :tag "Keys" character)))
|
||||
|
||||
@ -111,6 +112,7 @@ If the commands isn't on the list, `avy-style' is used."
|
||||
(const avy-copy-line)
|
||||
(const avy-copy-region)
|
||||
(const avy-move-line)
|
||||
(const avy-move-region)
|
||||
(function :tag "Other command"))
|
||||
:value-type (choice
|
||||
(const :tag "Pre" pre)
|
||||
@ -1253,6 +1255,22 @@ The window scope is determined by `avy-all-windows' or
|
||||
(t
|
||||
(user-error "Unexpected `avy-line-insert-style'")))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun avy-move-region ()
|
||||
"Select two lines and move the text between them here."
|
||||
(interactive)
|
||||
(avy-with avy-move-region
|
||||
(let* ((beg (avy--line))
|
||||
(end (save-excursion
|
||||
(goto-char (avy--line))
|
||||
(forward-line)
|
||||
(point)))
|
||||
(text (buffer-substring beg end))
|
||||
(pad (if (bolp) "" "\n")))
|
||||
(move-beginning-of-line nil)
|
||||
(delete-region beg end)
|
||||
(insert text pad))))
|
||||
|
||||
;;;###autoload
|
||||
(defun avy-setup-default ()
|
||||
"Setup the default shortcuts."
|
||||
|
Loading…
x
Reference in New Issue
Block a user