21

I'm trying to use Emacs and everything is fine, but the information about every file in my directory is too comprehensive. How can I tell it to show only file name (and maybe filesize in human readable format)? I tried options like dired-listing-switches but without any luck.

Luke Girvin
  • 13,221
  • 9
  • 64
  • 84
Valentin Golev
  • 9,965
  • 10
  • 60
  • 84
  • `dired-listing-switches` doesn't work because it's the list of parameters you want emacs to pass to `ls`, and it [MUST CONTAIN](http://www.gnu.org/software/emacs/manual/html_node/emacs/Dired-Enter.html) `-l`, which, as you know, is the long format switch for `ls`. – William Linton Nov 06 '10 at 22:30

4 Answers4

28

As of Emacs 24.4, hit key (.

Repeated, this will hide/unhide details. This is part of Dired Details.

vfclists
  • 19,193
  • 21
  • 73
  • 92
thdox
  • 1,555
  • 2
  • 17
  • 18
  • 1
    Thanks to @thdox and [Xah Lee](http://ergoemacs.org/emacs/emacs_dired_tips.html), finally I got it. `(defun my-dired-mode-setup () "show less information in dired buffers" (dired-hide-details-mode 1)) (add-hook 'dired-mode-hook 'my-dired-mode-setup)` – simno Feb 16 '17 at 13:40
  • This should be listed in the accepted result as it is the new standard. – Hydrocat Jun 27 '19 at 19:39
12

You can reduce the amount of information displayed by using Emacs' ls emulation instead of allowing it to use ls directly.

To enable ls emulation, add the following code to your startup file (probably .emacs or .emacs.d/init.el):

(require 'ls-lisp)
(setq ls-lisp-use-insert-directory-program nil)

You can then customise the display with M-x customize-group RET ls-lisp RET. Specifically, the "Ls Lisp Verbosity" setting can be used to disable a number of columns. There's no obvious way to get it down to just the filename and size, but you can certainly get rid of the owner/group/link-count columns.

Porculus
  • 1,189
  • 8
  • 8
  • @valya - long time ago now, I know but maybe you never found http://www.emacswiki.org/emacs/LsLispToggleVerbosity ... even get rid of drwxrwxrwx ... – ocodo Apr 10 '12 at 01:56
  • This can now be customized with `M-x customize-variable RET ls-lisp-use-insert-directory-program RET`. – Nick McCurdy Jan 25 '17 at 13:28
4

Great news, a more efficient version of DiredDetails is in the master branch of Emacs now; it uses text properties instead of overlays..

I looked for it because DiredDetails' reliance on overlays made it too slow for one find-dired result set.

I'm not sure if it'll be in 24.3 or 24.4. Get the raw file here: http://git.savannah.gnu.org/cgit/emacs.git/plain/lisp/dired.el

vfclists
  • 19,193
  • 21
  • 73
  • 92
event_jr
  • 17,467
  • 4
  • 47
  • 62
0

also, to show file sizes in human-readable format (kB/MB), add this to your .emacs:

(setq-default dired-listing-switches "-alh")
Kirill Yunussov
  • 1,955
  • 1
  • 21
  • 24