2019-04-21 19:59:44 -04:00
|
|
|
;;; editor/evil/autoload/files.el -*- lexical-binding: t; -*-
|
2017-02-09 05:09:21 -05:00
|
|
|
|
2019-04-21 19:59:44 -04:00
|
|
|
;;;###autoload (autoload '+evil:delete-this-file "editor/evil/autoload/files" nil t)
|
2017-05-12 12:06:56 +02:00
|
|
|
(evil-define-command +evil:delete-this-file (&optional filename force-p)
|
|
|
|
"Delete FILENAME (defaults to the file associated with current buffer) and
|
|
|
|
kills the buffer. If FORCE-P, force the deletion (don't ask for confirmation)."
|
2017-02-09 05:09:21 -05:00
|
|
|
:repeat nil
|
2017-05-12 12:06:56 +02:00
|
|
|
(interactive "<f><!>")
|
2020-04-27 01:42:31 -04:00
|
|
|
(doom/delete-this-file filename force-p))
|
2017-05-12 12:06:56 +02:00
|
|
|
|
2019-04-21 19:59:44 -04:00
|
|
|
;;;###autoload (autoload '+evil:move-this-file "editor/evil/autoload/files" nil t)
|
2017-05-27 13:25:40 +02:00
|
|
|
(evil-define-command +evil:move-this-file (new-path &optional force-p)
|
|
|
|
"Move current buffer's file to NEW-PATH. Replaces %, # and other vim-esque
|
|
|
|
filename modifiers (see `+evil*ex-replace-special-filenames'). If FORCE-P,
|
|
|
|
overwrite the destination file if it exists, without confirmation."
|
|
|
|
:repeat nil
|
|
|
|
(interactive "<f><!>")
|
2018-02-14 02:26:16 -05:00
|
|
|
(when (or (not new-path) (string-empty-p new-path))
|
|
|
|
(user-error "No new path was specified"))
|
|
|
|
(doom/move-this-file new-path force-p))
|
2017-05-27 13:25:40 +02:00
|
|
|
|
2020-03-03 20:00:22 +02:00
|
|
|
;;;###autoload (autoload '+evil:copy-this-file "editor/evil/autoload/files" nil t)
|
2017-05-27 13:25:40 +02:00
|
|
|
(evil-define-command +evil:copy-this-file (new-path &optional force-p)
|
|
|
|
"Copy current buffer's file to NEW-PATH. Replaces %, # and other vim-esque
|
|
|
|
filename modifiers (see `+evil*ex-replace-special-filenames'). If FORCE-P,
|
|
|
|
overwrite the destination file if it exists, without confirmation."
|
|
|
|
:repeat nil
|
|
|
|
(interactive "<f><!>")
|
2018-02-14 02:26:16 -05:00
|
|
|
(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))
|