Rewrite move/copy/delete file commands

To use rename-file, copy-file and delete-file, so these commands can
enjoy the benefits of any plugins that have advised these, like org-roam
does for rename-file.
This commit is contained in:
Henrik Lissner 2020-04-27 01:42:31 -04:00
parent 64f15bfe3c
commit c1127a5bde
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 71 additions and 102 deletions

View file

@ -6,8 +6,7 @@
kills the buffer. If FORCE-P, force the deletion (don't ask for confirmation)."
:repeat nil
(interactive "<f><!>")
(doom/delete-this-file (or filename (file-truename buffer-file-name))
force-p))
(doom/delete-this-file filename force-p))
;;;###autoload (autoload '+evil:move-this-file "editor/evil/autoload/files" nil t)
(evil-define-command +evil:move-this-file (new-path &optional force-p)
@ -30,4 +29,3 @@ overwrite the destination file if it exists, without confirmation."
(when (or (not new-path) (string-empty-p new-path))
(user-error "No new path was specified"))
(doom/copy-this-file new-path force-p))