gpt4 book ai didi

emacs - 如何在 Emacs 中设置括号/大括号/圆括号的颜色?

转载 作者:行者123 更新时间:2023-12-04 20:23:24 25 4
gpt4 key购买 nike

我想指定 {} 的颜色, ()[]在自定义颜色主题中。这可能吗?

更新:这是来源。请注意此主题的开发状态;在工作场所和家庭周围使用它都是不安全的。

;;; Color theme based on Moria for VIM.
(defun color-theme-moria ()
"A color theme based on Moria for VIM."
(interactive)
(color-theme-install
'(color-theme-moria
((foreground-color . "#000000") ;done
(cursor-color . "#ffffff")
(background-color . "#f0f0f0") ;done
(background-mode . light)) ;done
(default ((t (nil)))) ;done
(underline ((t (:underline t)))) ;done
(modeline ((t (:foreground "black" :background "#000000"))))
(modeline-buffer-id ((t (:foreground "red" :background "#0000ff"))))
(modeline-mousable ((t (:foreground "cyan" :background "#007080"))))
(modeline-mousable-minor-mode ((t (:foreground "cyan" :background "#007080"))))
(highlight ((t (:background "#d0d0d0")))) ;done
(region ((t (:background "#c0c0c0")))) ;done
(font-lock-builtin-face ((t (:foreground "black"))))
(font-lock-constant-face ((t (:foreground "#ff0000")))) ;hmmm
(font-lock-comment-face ((t (:foreground "#786000")))) ;done
(font-lock-function-name-face ((t (:foreground "#000000" )))) ;done
; highlight ma brackets
(font-lock-add-keywords nil '(("\\([\{\}\\[\]\(\)]+\\)" 1 font-lock-keyword-face prepend)))
(font-lock-preprocessor-face ((t (:foreground "#912F11" :bold t))))
(font-lock-keyword-face ((t (:foreground "#1f3f81" :bold t)))) ; done e.g. defun

(font-lock-string-face ((t (:foreground "#077807")))) ;done
(font-lock-variable-name-face ((t (:foreground "#ff0000" )))) ;hmmm
(font-lock-warning-face ((t (:foreground "#ff0000"))))
(highlight-changes-face ((t (:background "#ff0000"))))
(highlight-changes-delete-face ((t (:foreground "red" :background "pink"))))
(show-paren-match ((t (:foreground "#2e3436" :background "#73d216"))))

(widget-field-face ((t (:foreground "pink" :background "red"))))
(widget-inactive-face ((t (:foreground "gray"))))
(custom-button-face ((t (:foreground "yellow" :background "dark blue"))))
(custom-state-face ((t (:foreground "mediumaquamarine"))))
(custom-face-tag-face ((t (:foreground "goldenrod" :underline t))))
(custom-documentation-face ((t (:foreground "#10D010"))))
(custom-set-face ((t (:foreground "#2020D0"))))
)
)
)

最佳答案

您可以使用 Rainbow-delimiters 模式,您可以从 Emacs24 软件包系统中的 MELPA 安装它或从以下位置下载 Rainbow-delimiters.el:

emacswiki-RainbowDelimiters

将 Rainbow-delimiters.el 放在您的 emacs 加载路径上

在 .emacs 文件中写入初始化代码:

(require 'rainbow-delimiters)

(global-rainbow-delimiters-mode)

关于emacs - 如何在 Emacs 中设置括号/大括号/圆括号的颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3802169/

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