4

I wonder if it is possible to change the following functions:

  • dired-do-rename
  • dired-do-copy

such that when I operate on a single file, it prompts the selected file's name as the default target name.

Most of my files have long names, when I copy/rename a file, I usually copy/rename it to a similar name. It's painful to type the entire name or copy it from the original file.

Thanks a lot for any suggestions!

Greenonline
  • 161
  • 1
  • 3
  • 11
DataHungry
  • 247
  • 1
  • 7

1 Answers1

9

The ability to set the "copy to" or "rename/move to" name same as the original name is already built in.

  1. Initiate the copy or move (rename) in dired
  2. (only for ido users) C-f or C-x C-f - kick out of ido mode
  3. M-n - That will give you the current file/dir name

General tip that applies everywhere in emacs: Whenever you are hunting for a default that you think should be present, try out M-n or M-p.

Kaushal Modi
  • 25,651
  • 4
  • 80
  • 183