ivy delete file with confirmation

This commit is contained in:
d12frosted 2016-12-22 15:52:25 +02:00
parent 1c8cb4a58c
commit 3e60792136
No known key found for this signature in database
GPG Key ID: 8F60E862D6F5CE8F
2 changed files with 8 additions and 2 deletions

View File

@ -33,8 +33,7 @@ than this amount.")
("v" spacemacs/find-file-vsplit "in vertical split")
("s" spacemacs/find-file-split "in horizontal split")
("l" find-file-literally "literally")
;; this is to invasive, maybe have prompt?
;; ("d" spacemacs/delete-file "delete file")
("d" spacemacs/delete-file-confirm "delete file")
("r" spacemacs/rename-file "rename file"))
"Default ivy actions for files.")

View File

@ -341,6 +341,13 @@ removal."
(projectile-project-p))
(call-interactively #'projectile-invalidate-cache)))))
(defun spacemacs/delete-file-confirm (filename)
"Remove specified file or directory after users approval.
FILENAME is deleted using `spacemacs/delete-file' function.."
(interactive "f")
(funcall-interactively #'spacemacs/delete-file filename t))
;; from magnars
(defun spacemacs/delete-current-buffer-file ()
"Removes file connected to current buffer and kills buffer."