7

First off, a picture of what I see, editing a handlebars file:

tag highlighting

My colour theme is base16-grayscale, so that blue is probably hard coded somewhere.

I asked on the web-mode mailing list, but was told to ask here instead.

Can I disable and/or change the colour of this highlighting?

1 Answer 1

8

To disable the behavior..

Programmatically:

(setq web-mode-enable-current-element-highlight nil)

web-mode-enable-current-element-highlight is a variable defined in ‘web-mode.el’. Its value is nil

Documentation: Disable element highlight.

Interactively:

M-x web-mode-toggle-current-element-highlight return

web-mode-toggle-current-element-highlight is an interactive compiled Lisp function in ‘web-mode.el’.

(web-mode-toggle-current-element-highlight)

Toggle highlighting of the current html element.

To continue to use the highlighting and just use a better color:

(eval-after-load "web-mode"
  '(set-face-background 'web-mode-current-element-highlight-face "your-color"))

You can find what face is applied to text a number of ways. If you can get your cursor on the text. You can use M-x describe-face which will give you a default option of the current face. Or you can use M-x describe-char which will tell you what face is applied. You can customize faces through the customize feature or with elisp. If you can't get your cursor on the face, try finding the face using customize-group, list-faces-display or by reading the packages code.

1
  • 2
    The user might also be interested in how to figure out which face to modify: (1) Navigate to the text with face you want to modify (2) M-x describe-char (helpful if the point has multiple faces) (3) Navigate to "There are text properties here:" section (4) Click on the face you want to modify (5) Click on "Customize this face" link in the buffer that pops up (6) Modify as needed and save (7) the customized face will be auto saved in your init.el or your custom-file. Jun 16, 2015 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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