I am trying to create a command which deletes preceding whole lines, just like evil-delete-whole-line, but backwards. So far I have the following
(evil-define-operator delete-previous-line
(beg end type register yank-handler)
"Delete whole line."
:motion evil-line-or-visual-line
(interactive "<R><x>")
(evil-previous-line 1)
(evil-delete-whole-line beg end type register yank-handler))
It does delete the previous line, but unfortunately doesn't respond to the count operator. That is if I press certain number before using the operator the behavior isn't the expected one. How can I have the behavior mentioned in the beginning?
beg
andend
are set when invoking the command). Also, the command must be defined using 'evil' tools? Or would it be fine to just create an Emacs command? Or maybe even a recorded keyboard macro, which would definitely be the fastest and simplest solution (although that counts deleting multiple lines as multiple edits for undo).