Here are some random Dired mode tips:
1 Want to include the names of files in a document?
w copies names of marked files to kill ring. C-0 w copies absolute file name C-u copies names relative to Dired’s current directory
Here’s an example of this in action:
Bob Hall is a leading British boogie-woogie pianist. Here are the tracks off his album What Goes Round
- I Can’t Get My Ass in Gear.mp3
- Road of No Return.mp3
- Running with the Blues.mp3
- Bloodhound Blues.mp3
- What Goes Round Comes Back.mp3
- The All Star Medicine Show.mp3
- Backwater Blues.mp3
- Alone with the Blues.mp3
- One More Road.mp3
- Back on the Valley.mp3
- Same Old Place.mp3
2 Fed up with deleting Dired buffers as you navigate through structures?
Pressing a rather than enter will close the current dired buffer as Emacs opens the next one.
3 Hiding Uninteresting Files
Here’s a partial view of a directory:
-rw-rw-r-- 1 ***** ***** 110537 Mar 24 13:07 planner.org -rw-rw-r-- 1 ***** ***** 60688 Sep 3 2013 planner.org.~1~ -rw-rw-r-- 1 ***** ***** 60688 Sep 3 2013 planner.org.~2~ -rw-rw-r-- 1 ***** ***** 112046 Mar 18 16:37 planner.org.~860~ -rw-rw-r-- 1 ***** ***** 112079 Mar 18 16:40 planner.org.~861~ -rw-rw-r-- 1 ***** ***** 112133 Mar 18 16:55 planner.org.~862~ -rw-rw-r-- 1 ***** ***** 112133 Mar 18 16:55 planner.org.~863~ -rw-rw-r-- 1 ***** ***** 112196 Mar 20 15:16 planner.org.~864~
As I use force backups on all my files, all those ~backups clutter things up. I used to do the following remove them:
% m ~ Mark all backup files k Remove them from view
Then I discovered dired-omit-mode, part of dired-x.
Place the following in your .emacs file
(require 'dired-x) (setq dired-omit-mode t)
Now hit M-o to toggle uninteresting files like backup files on and off.
4 And finally…
Something that I always forget when I need it: to create a new file with non existent parent directories from current directory:
M-x make-directory RET RET