mirror of
https://github.com/abo-abo/avy.git
synced 2025-10-13 21:33:05 +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-line)
|
||||||
(const avy-copy-region)
|
(const avy-copy-region)
|
||||||
(const avy-move-line)
|
(const avy-move-line)
|
||||||
|
(const avy-move-region)
|
||||||
(function :tag "Other command"))
|
(function :tag "Other command"))
|
||||||
:value-type (repeat :tag "Keys" character)))
|
: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-line)
|
||||||
(const avy-copy-region)
|
(const avy-copy-region)
|
||||||
(const avy-move-line)
|
(const avy-move-line)
|
||||||
|
(const avy-move-region)
|
||||||
(function :tag "Other command"))
|
(function :tag "Other command"))
|
||||||
:value-type (choice
|
:value-type (choice
|
||||||
(const :tag "Pre" pre)
|
(const :tag "Pre" pre)
|
||||||
@ -1253,6 +1255,22 @@ The window scope is determined by `avy-all-windows' or
|
|||||||
(t
|
(t
|
||||||
(user-error "Unexpected `avy-line-insert-style'")))))))
|
(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
|
;;;###autoload
|
||||||
(defun avy-setup-default ()
|
(defun avy-setup-default ()
|
||||||
"Setup the default shortcuts."
|
"Setup the default shortcuts."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user