I got a great tip today from the ErgoEmacs G+ Page: dired-jump
. It’s bound to 【Ctrl+x Ctrl+j】 so it’s easy to call. What it does is jump to the dired buffer corresponding to the current buffer and move the point to the line for the file associated with the buffer.
If the buffer is a file, then it just goes to that file’s line in the dired buffer. If the current buffer is already a dired buffer then it pops up a level and puts the point on the line for the old dired buffer.
It’s a really handy shortcut. Previously, I’d type 【Ctrl+x d】 and then 【Ctrl+s】 file-name
to do the same thing. This is much easier and faster.
Update: Phil writes to remind me you must have dired+ loaded to use dired-jump and points to an info entry (see comments) that tells you how to ensure that dired-jump is always available.