定制方向
我刚刚在维基百科上看到了这个 dired 模式屏幕。我正在研究这些定制。
关于颜色,我想只要指定正确的面孔就可以了,但是我如何才能在默认情况下显示以千字节为单位的文件大小呢?可用空间(以 MB 为单位)(顶行)?
I just came across this dired mode screen at Wikipedia. I am looking into those customizations.
Regarding colors, I guess just specifying the correct faces will do, but how do I get dired to show file sized in kbytes by default? And the available space in MBs (top line)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我遇到了同样的问题,并找到了如何动态更改开关。
因此,在 Dired 缓冲区
Cu s
中时,您现在可以更改 ls 使用的开关。添加
h
确实获得人类可读的文件大小您也可以添加其他开关,例如我将其更改为
-alsh
现在它按文件大小排序I came up with the same problem and found how to change swithes on the fly.
So while in a dired buffer
C-u s
you can now change switches used by ls. Add
h
do get a human readable file sizesYou can add other switches too, for example I changed it to
-alsh
and it now sorts by file size要获取以千字节为单位的文件大小,您可以自定义变量
dired-listing-switches
以使用-k
选项:您必须做更多的工作才能获得总数/可用数量(以 MB 为单位)。这在我的 Linux 系统上有效,但可用部分在我的 Windows 机器上无法工作:
To get the file sizes in kbytes, you can customize the variable
dired-listing-switches
to use the-k
option:You have to do a little more work to get the total/available numbers in MB. This worked on my Linux system, but the available portion failed to work on my Windows box:
实际上,该屏幕截图几乎可以肯定是 Dired+,尽管附带的文字给人的印象是它来自普通的 Emacs(XEmacs?),并且屏幕截图的归属是“Emacs 开发团队”。
所以是的,答案是您可以通过使用 Dired+ 并简单地自定义默认面孔:
Mxcustomize-group Dired-Plus
轻松获得该外观。Actually, that screenshot is almost certainly of Dired+, though the accompanying text gives the impression that it is from vanilla Emacs (XEmacs?), and the attribution for the screenshot is "Emacs development team".
So yes, the answer is that you can easily get that appearance, by using Dired+ and simply customizing the default faces:
M-x customize-group Dired-Plus
.你没有问,但我想我应该添加......
我希望能够轻松地按大小和扩展名以及名称和时间对 Dired 输出进行排序。我知道我可以使用 Mx universal-argument dired-sort-toggle-or-edit 来完成此操作,但我希望它可以在
s
键上使用以使其快速。You didn't ask, but I thought I'd add....
I wanted to be able to easily sort the dired output by size and extension, as well as name and time. I know I can do this with
M-x universal-argument dired-sort-toggle-or-edit
, but I wanted it available on thes
key to make it quick.另外,dired 中的显示只允许 9 个空格,因此对于非常大的文件,dired 中的显示会变得混乱。这再次需要重新定义 fn。在本例中,来自 ls-lisp.el 的一个:(
它只是将格式字符串中的 9.0 替换为 11.0,将 8.0 替换为 10.0)
Also, the display in dired allows only 9 spaces, so for very large files, the display in dired will get messed up. Once again that required redefining a fn. In this case, one from ls-lisp.el :
(it just replaces the 9.0 with an 11.0, and the 8.0 with a 10.0, in the format strings)