aboutsummaryrefslogtreecommitdiff
path: root/evil-commands.el
diff options
context:
space:
mode:
authorEvgeni Kolev <evgenysw@gmail.com>2017-04-27 23:25:10 -0700
committerEvgeni Kolev <evgenysw@gmail.com>2017-04-29 16:00:02 -0700
commita6ef14e5e938ab7cb934c16740284f7000728810 (patch)
tree2e18854bad9d0c5f5b6b92e8f86ed68304b73a34 /evil-commands.el
parentf0684c1f6644a8c4e0e5fce50a1a04796555eaf1 (diff)
Add support for passing REGISTER and COUNT to :delete
Diffstat (limited to 'evil-commands.el')
-rw-r--r--evil-commands.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/evil-commands.el b/evil-commands.el
index 44ec3aa..a9824c3 100644
--- a/evil-commands.el
+++ b/evil-commands.el
@@ -1449,6 +1449,23 @@ be joined with the previous line if and only if
'exclusive
nil)))
+(evil-define-operator evil-ex-delete (beg end type register count yank-handler)
+ "The Ex delete command.
+\[BEG,END]delete [REGISTER] [COUNT]"
+ (interactive "<R><d/><y>")
+ (when count
+ ;; with COUNT, :delete should go the end of the region and delete
+ ;; COUNT lines from there
+ (setq beg (save-excursion
+ (goto-char end)
+ (forward-line -1)
+ (point))
+ end (save-excursion
+ (goto-char end)
+ (point-at-bol count))
+ type 'line))
+ (evil-delete beg end type register yank-handler))
+
(evil-define-operator evil-change
(beg end type register yank-handler delete-func)
"Change text from BEG to END with TYPE.