This post is the first part of the series Dired as Default File Manager.

Before reading this, you should have a look at this page Dired - GNU Emacs Manual to know some basic commands to use Dired properly.

Always Recursion

  • Always recursively delete directory
(setq dired-recursive-deletes 'always)
  • Always recursively copy directory
(setq dired-recursive-copies 'always)

Auto guess target

Set this variable to non-nil, Dired will try to guess a default target directory. This means: if there is a dired buffer displayed in the next window, use its current subdir, instead of the current subdir of this dired buffer. The target is used in the prompt for file copy, rename etc.

(setq dired-dwim-target t)

Delete by moving to Trash.

Replace ~/.Trash/emacs with the path to your trash folder.

(setq delete-by-moving-to-trash t
      trash-directory "~/.Trash/emacs")

Dired+

Dired+ is a package that extends functionalities provided by standard GNU Emacs libraries dired.el, dired-aux.el, and dired-x.el. You can install through package.el (see this post Emacs Package Manager). Some of my tips in this series use Dired+.

Next part: Dired as Default File Manager - Show the interesting and Hide the unnecessary information