自定义直接

Art*_*ert 15 emacs dired

我刚刚在维基百科看到了这个直接模式屏幕.我正在研究那些自定义.

关于颜色,我想只是指定正确的面将会做,但是如何默认显示以KB为单位的文件大小?以MB为单位的可用空间(顶线)?

Aur*_*ini 19

我想出了同样的问题,并找到了如何在飞行中改变swithes.

所以在一个直接缓冲区中

C-u s

你现在可以改变ls使用的开关.添加h确实获得人类可读的文件大小

您也可以添加其他开关,例如我将其更改为-alsh,现在按文件大小排序


Tre*_*son 14

要获得以KB为单位的文件大小,您可以自定义变量dired-listing-switches以使用该-k选项:

(setq dired-listing-switches "-alk")
Run Code Online (Sandbox Code Playgroud)

你需要做更多的工作来获得以MB为单位的总数/可用数.这适用于我的Linux系统,但可用部分无法在我的Windows机器上运行:

(setq directory-free-space-args "-Pm")
(defadvice insert-directory (after insert-directory-adjust-total-by-1024 activate)
  "modify the total number by dividing it by 1024"
  (save-excursion
(save-match-data
  (goto-char (point-min))
  (when (re-search-forward "^ *total used in directory \\([0-9]+\\) ")
    (replace-match (number-to-string (/ (string-to-number (match-string 1)) 1024)) nil nil nil 1)))))
Run Code Online (Sandbox Code Playgroud)

  • 在Linux上,尝试"-alh". (11认同)

Dre*_*rew 8

实际上,该截图几乎肯定是Dired +,虽然附带的文字给人的印象是它来自vanilla Emacs(XEmacs?),截图的归属是"Emacs开发团队".

所以是的,答案是你可以通过使用Dired +并简单地自定义默认面孔来轻松获得外观:M-x customize-group Dired-Plus.