I'm not from a vim background so I remap a lot of the evil commands and keys to fit my needs. I know you can use evil-repeat
but I like the following better to quickly kill a few lines:
(defun evil-delete-or-repeat-delete-line ()
(interactive)
(if (or (eq last-command this-command)
(eq last-command 'evil-line))
(progn
(setq this-command 'evil-line)
(call-interactively 'evil-repeat)
(kill-new (concat (cadr kill-ring) (car kill-ring))))
(call-interactively 'evil-delete)))
This function repeats deleting lines if I press the evil-delete
key multiple times and also preserves the evil-delete
functionality. It appends every subsequent kills to the kill ring, too. This works with the following binding:
(define-key evil-normal-state-map (kbd "x") 'evil-delete-or-repeat-delete-line)
I would like to have something similar for evil-yank
. For this the cursor should move to the next line after every call. I tried but couldn't get it to work. Can anyone help me?