Emacs - dired 中目录的颜色
我已经在网上搜索过了。我已经尝试过颜色主题(也许我需要创建自己的颜色主题,但实际上我已经按照我想要的方式设置了 emacs,除了这一件事,而且我找不到我可以接受的颜色主题)。
我只是想在 dired 模式下更改目录的颜色。我在 .emacs 中更改了几种自定义颜色,例如:
(set-face-foreground 'font-lock-comment-face "yellow" )
但我只是不知道在 dired 模式下要更改目录的哪个面。
有人可以帮忙吗?
谢谢!
I have search the web. I have tried color-theme (perhaps I need to create my own, but really I have my emacs set up the way I want it except for this ONE thing, and I could not find a color theme that was acceptable to me).
I just want to change the color of the directories in dired-mode. I have several custom colors changed in my .emacs, like:
(set-face-foreground 'font-lock-comment-face "yellow" )
But I just don't know what face to change for the directories in dired mode.
Can anyone help?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
如果您将点移动到显示要更改的颜色的位置并运行
Mxdescribe-face
,它会告诉您该点的文本的面以及该面的属性。对我来说,它是 dired-directory,而不是 font-lock-comment-face。
If you move point to the place that's displaying the color you want to change and run
M-x describe-face
, it will tell you the face for the text at point and that face's properties.For me, it's
dired-directory
, not font-lock-comment-face.好吧,我设法通过执行 Mx list-faces-display 来列出这些面孔,然后我发现了那些具有我不想要的深蓝色的面孔,并且,尽管没有一个面孔描述说任何类似“目录名称”的内容在“dired”中,我只是改变了所有具有不可读颜色的面孔,我的问题就解决了!
Well, I managed to list the faces by doing M-x list-faces-display, and then I found the faces that had the dark blue that I didn't want, and, although none of the face descriptions said anything remotely like "Directory Name in dired", I just changed all of the faces that had unreadable colors, and my problems were solved!
最简单的方法是运行:
Mxcustomize-face dired-directory
然后您将看到一个可以自定义的属性菜单。选择
保存以供将来使用
,您的.emacs
将自动更新以使更改永久生效。The easiest way is to run:
M-x customize-face dired-directory
You'll then be presented with a menu of attributes you can customize. Select
Save for future sessions
and your.emacs
will automatically be updated to make the change permanent.如果您使用的是旧版本的 emacs(我测试了 emacs 21),请尝试“list-text-properties-at”而不是“describe-face”。对我来说,它将目录面显示为“font-lock-function-name-face”。
if you are using an older version of emacs (i tested emacs 21) try "list-text-properties-at" instead of "describe-face". for me, it shows the directory face as "font-lock-function-name-face".
diredful(可怕的多彩)对我有用。
https://www.emacswiki.org/emacs/Diredful
https://github.com/emacsmirror/diredful
要匹配目录:
diredful (dired colorful) worked for me.
https://www.emacswiki.org/emacs/Diredful
https://github.com/emacsmirror/diredful
To match directories: