Emacs dired: too much information

强颜欢笑 提交于 2019-11-27 13:41:13

问题


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.


回答1:


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.




回答2:


As of Emacs 24.4, hit key (.

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




回答3:


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




回答4:


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

(setq-default dired-listing-switches "-alh")


来源:https://stackoverflow.com/questions/4115465/emacs-dired-too-much-information

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!