Emacs - dired 中目录的颜色

发布于 2024-10-03 04:17:04 字数 299 浏览 7 评论 0原文

我已经在网上搜索过了。我已经尝试过颜色主题(也许我需要创建自己的颜色主题,但实际上我已经按照我想要的方式设置了 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

你对谁都笑 2024-10-10 04:17:04

如果您将点移动到显示要更改的颜色的位置并运行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.

极致的悲 2024-10-10 04:17:04

好吧,我设法通过执行 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!

榕城若虚 2024-10-10 04:17:04
(set-face-foreground 'dired-directory "yellow" )
(set-face-foreground 'dired-directory "yellow" )
叹梦 2024-10-10 04:17:04

最简单的方法是运行:

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.

纵情客 2024-10-10 04:17:04

如果您使用的是旧版本的 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".

清欢 2024-10-10 04:17:04

diredful(可怕的多彩)对我有用。

https://www.emacswiki.org/emacs/Diredful

https://github.com/emacsmirror/diredful

要匹配目录:

  1. 模式:d.*
  2. 在整行上选择正则表达式(因此它匹配包含“d”的权限)
  3. 检查适用于目录
  4. 样式的颜色。

diredful (dired colorful) worked for me.

https://www.emacswiki.org/emacs/Diredful

https://github.com/emacsmirror/diredful

To match directories:

  1. Pattern: d.*
  2. Select regexp on whole line (so it matches the permissions containing the 'd')
  3. Check apply to Dirctories
  4. Style the colors.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文