Emacs: Is there an easy way to copy files with ido navigation?

55 Views Asked by At

I'd like to be able to do something like this:

  1. Navigate to a buffer associated with a file
  2. ^X^W (enter file ido file writing mode)
  3. navigate via ido to another directory
  4. Do something at this point to write a copy of the file in the navigated directory with the file name already associated with the buffer so I don't have to retype it.

I can't use ^F at this point because it writes to the original directory.

Bonus points if a similar method can be used to move files as well as copy them.

1

There are 1 best solutions below

0
On

A simple variation of what you're after is of course this:

  1. Navigate to a buffer
  2. C-x h M-w to save the buffer contents in the kill ring
  3. C-x C-f visit a new file in another directory via ido
  4. C-y to insert the contents of the original buffer
  5. C-x C-s save the buffer contents to file
  6. C-x k RET kill the now obsolete buffer

This way a copy of the original buffer will be written to a different file without affecting the original buffer.