Fuco1 / dired-hacks

Collection of useful dired additions
GNU General Public License v3.0
849 stars 76 forks source link

Auto increment file name if same name exists #174

Closed azzamsa closed 1 year ago

azzamsa commented 3 years ago

Hi.

The default behavior of regular file manager (Thunar, Dolphin, etc) is to increment file name if the same name exists.

Case:

linode.png
linode (copy 1).png

If I copy linode.png in the same directory, then the resulting copy will have a trailing (copy 1).

I would like to add this functionality to dired-ranger-paste. But now I am thinking:

What your thoughts on this?

If you reject this idea. I would like to implement this on my side only.

Fuco1 commented 3 years ago

I think this is a nice feature.

By default we now ask if you want to overwrite the file. We can instead change this to a multi-option menu, where we can ask:

Additionally, we can add a setting where you can set the default answer to this question. (i.e. overwrite without asking or add the copy X). map-y-or-n-p can be used to ask a question with multiple actions bound to keys.

azzamsa commented 3 years ago

By default we now ask if you want to overwrite the file. We can instead change this to a multi-option menu, where we can ask:

* do nothing

* overwrite

* insert a (copy 1)

affirmative :+1:

azzamsa commented 1 year ago

I use Dired-Ranger nowadays and it has auto-increment out of the box.

Thanks for Dired-hacks.