对于Indentation of “if”,我必须在Emacs下使用caml-mode。
但是我发现tuareg的字体比caml-font更鲜艳,所以我的问题是,在caml-mode中是否可以使用tuareg的字体。
此外,对于需要caml-font的当前.emacs,当我打开.ml文件时,某些行(尤其是文件开头的行)不会突出显示。如果我转到这些行,修改它们,它们会改变它们的颜色。有人能告诉我如何解决这个问题吗?
另外,除了tuareg和caml-font之外,你有没有更好的字体推荐给ocaml程序
非常感谢!
发布于 2011-07-22 22:01:58
你的意思是你更喜欢这些颜色,还是他们的颜色更多?
如果是后者,可能很难在caml-mode中使用tuareg字体锁定,尽管我只看了一点这两个。
如果是前者,您可以简单地自定义caml-mode使用的faces以使用更好的faces (我指的是字体或“颜色”)。使用足够新的emacs,将光标放在您想要更改的面上,然后键入M-x customize-face RET。它会提示你所在的面孔的名字,所以再次点击return。然后你可以以任何你想要的方式改变脸部。作为第一步,您可能会让tuareg.el保持打开状态,并检查有哪些面,例如
(defface tuareg-font-lock-governing-face
'((((background light)) (:foreground "blue" :bold t))
(t (:foreground "orange" :bold t)))
"Face description for governing/leading keywords."
:group 'tuareg-faces)是用于let的面部的定义,因此您只需将光标放在let,M-x customize-face RET RET上,然后将前景更改为蓝色并启用粗体(假设您的背景较浅)。别忘了保存它。
或者,您可以编辑caml-font.el并更改caml-font-lock-keywords部分以使用您喜欢的字体(可以来自图阿雷格)。如果您想要添加到您的.emacs,那么您应该将其更改为(setq caml-font-lock-keywords ...)。
(defconst caml-font-lock-keywords
(list
...
;definition
(cons (concat
"\\<\\(a\\(nd\\|s\\)\\|c\\(onstraint\\|lass\\)"
"\\|ex\\(ception\\|ternal\\)\\|fun\\(ct\\(ion\\|or\\)\\)?"
"\\|in\\(herit\\|itializer\\)?\\|let"
"\\|m\\(ethod\\|utable\\|odule\\)"
"\\|of\\|p\\(arser\\|rivate\\)\\|rec\\|type"
"\\|v\\(al\\(ue\\)?\\|irtual\\)\\)\\>")
;; 'font-lock-type-face)
'tuareg-font-lock-governing-face)
...
))https://stackoverflow.com/questions/6763001
复制相似问题