自定义内部链接orgmode的颜色 [英] Customize color of internal links orgmode
本文介绍了自定义内部链接orgmode的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这可能是可行的,但是找不到参考.如何通过.emacs文件为内部链接定义与外部链接不同的颜色?
It's probably possible, but couldn't find a reference. How can I define a different color to internal links than external ones through my .emacs file?
推荐答案
以下代码将显示内部链接(以" file:
"开头的链接),而不是蓝色的链接:
The following code will display internal links (those beginning with "file:
") in turquoise, instead of blue :
(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代码的链接显示为红色(下面的屏幕快照中的最后一个链接):
- You'll need
M-x org-mode-restart
to see the changes in your org file ; - A face can only be set once (with
defface
), so if you want to change an already defined face, either change its name or relaunch Emacs ; - Already available faces can be seen with
M-x list-faces-display
; - Available colors for your font can be chosen with
M-x list-colors-display
; - You can set a different face for other links. For instance I chose to have all links executing elisp code, to be displayed in red (the last link in the below screenshot) :
这篇关于自定义内部链接orgmode的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文