I want to have a function, which moves a file or optionally multiple marked files from one directory to a different directory in some parent folder. I managed to design a script which does the main things:
(defun multiple-rename (candidate)
(loop for cand in (helm-marked-candidates)
do
(spacemacs/rename-file cand)))
(defun move-from-downloads ()
"helm interface to copy files from downloads"
(interactive)
(helm :sources `(
((name . "My org files")
(candidates . ,(f-entries "~/Dropbox/Documents"))
(action . (("Rename" . multiple-rename))))
)))
The feature which is not present yet, which I would like to have is having some specified parent folder path for a target directory of renaming.
In other words, spacemacs/rename-file takes the file to rename as an argument and if it is not getting an a second argument which is here the case put up the prompt to select a filename where the files should be moved, the path in this prompt is however the path of the current buffer. Instead I would like to have the default path, which pops up in the prompt for renaming to be something different, e.g. home/mydefaultrenamepath
. Would be happy to hear some solution, it doesn't need to use spacemacs/rename file, only the flow of having helm candidates to select and then standard directory to move files into (which should be able to be altered).
dired
: setdired-dwim-target
tot
, open the first directory in one window, open the second directory in a second window, mark all the files you want to rename withm
(or through a more automated procedure:dired
provides various ways) and then pressR
.dired-dwim-target
tot
to avoid the prompt. Having a shortcut to open the first directory only adds one more keystroke - for me, the flexibility of this solution overshadows any advantage a custom-made solution has.