How to change Hash color in rhtml-mode in Emacs -
i'm using rhtml-mode in emacs.
when write hash in way :key => "value"
:key
colorized.
but key: "value"
style colorizing doesn't work. color of :
changed.
i tried change rhtml-mode bit. mode seems load ruby-mode internally if text if braced in <% %> tag. oddly when write hash in ruby-mode both type of writing colorized.
i'm using default ruby-mode in emacs24.
how can find place (by line number) color of hash key defined?
the short answer: c-h vrhtml-in-erb-keywords
. open buffer showing regexp rhtml keywords. there link straight defined in elisp file. can see definition here.
add following .emacs file:
(add-hook 'rhtml-mode (lambda () (font-lock-add-keywords nil '(("\\([0-9a-za-z_]*:\\)" 1 font-lock-constant-face t)))))
this make emacs apply colouring determined font-lock-constant-face
matches regexp "\\([0-9a-za-z_]*:\\)"
. might match more want, may want fine tune it.
i'm not sure there's particularly easy way find out colour given keyword found. can m-xdescribe-face
point on word want information on. tell how emacs thinks should coloured - font-lock-keyword-face
. c-h vfont-lock-keyword
tell how emacs decided that, not in helpful way.
the simplest way open source code mode you're in , search in defines keywords. can open source code c-h frhtml-mode
, open buffer link source.
Comments
Post a Comment