emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rename, delete and move current buffer and file


From: Yuri Khan
Subject: Re: Rename, delete and move current buffer and file
Date: Mon, 07 May 2018 15:28:20 +0000

On Mon, May 7, 2018 at 8:59 PM Jarosław Rzeszótko <address@hidden>
wrote:

> It is surprisingly hard to do this in Emacs […]
> You can use dired, but I personally find it to be a distraction for this
use case.

Why?

I think of deleting, renaming and moving as operations on the file as a
whole and not on its content, so saving the file and going “outside” it is
the intuitive first step for me. ‘dired-jump’ takes me to the Dired buffer
of the enclosing directory and puts point on the file. It’s on C-x C-j by
default, but I bind it on <M-S-up> so my fingers think going “outside” is a
single spatial movement.

If I want to delete the file, I press D and confirm. To rename, I press R
and enter the new name; the buffer is renamed automatically.

When copying or moving files, I prefer to see the target directory before I
do it. So, I split the window, switch there, navigate to the target
directory, switch back, R (or C to copy), RET (because with
‘dired-dwim-target’ set to non-nil the target directory is automatically
suggested as the default), then deal with any changes to the window
configuration.

Note here the DWIM behavior: R suggests the directory in the other window,
but if there is no other window, then the current directory.

> A very similar related pain point is that it is hard to get the path and
directory of the current buffers visited file.

Your favorite binding of ‘find-file’, followed by your preferred method to
get the current line to clipboard. (This breaks if you ‘cd’ to a different
directory while editing a file.)

> Finally, while we are discussing functions everyone re-implements in
their .emacs, please lets make transpose-windows happen as an Emacs builtin
:)

You mean the windcycle library?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]