gpt4 book ai didi

emacs - 自定义内部链接的颜色 orgmode

转载 作者:行者123 更新时间:2023-12-04 02:44:43 25 4
gpt4 key购买 nike

这可能是可能的,但找不到引用。如何通过我的 .emacs 文件为内部链接定义不同于外部链接的颜色?

最佳答案

以下代码将以青绿色而不是蓝色显示内部链接(以“file:”开头的链接):

  (defface org-link-internal
'((((class color) (background light)) (:foreground "turquoise1" :underline t))
(((class color) (background dark)) (:foreground "turquoise1" :underline t))
(t (:underline t)))
"Face for internal links."
:group 'org-faces)

(org-link-set-parameters "file"
:face 'org-link-internal)

注意事项:

  • 您需要 M-x org-mode-restart 来查看您的组织文件中的更改;
  • 一个面只能设置一次(用defface),所以如果你想改变一个已经定义的面,要么改变它的名字,要么重新启动 Emacs ;
  • 可以使用 M-x list-faces-display 查看已经可用的面孔;
  • 可以使用 M-x list-colors-display 选择字体的可用颜色;
  • 您可以为其他链接设置不同的外观。例如,我选择让所有链接执行 elisp 代码,以红色显示(下面屏幕截图中的最后一个链接):

Screenshot of hyperlinks with different colors

关于emacs - 自定义内部链接的颜色 orgmode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19057881/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com