I'm loading a deftheme theme using (load-theme). I'm very happy with it most cases, but in yaml-mode I'd like to change attributes for font-lock-variable-name-face.

How can I make the theme use different face attributes for it in a single buffer?


1 Answer 1


As @lawlist suggested I used face-remap-add-relative to achieve the required effect:

(add-hook 'yaml-mode-hook
  (lambda ()
    (face-remap-add-relative 'font-lock-variable-name-face :foreground "#fec66c")))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.