how do I change the background of current line when in (evil) normal mode?

I used it in Vim to be able to tell when I am in normal mode or not.

(I am using the terminal app and I prefer to keep the cursor a rectangle so I need a different visual aid.)

  • Are you asking about the mode line, or about the line the cursor is on?
    – Dan
    Jul 18, 2017 at 14:46

1 Answer 1


If I understand right, this should help get you started

(setq original-background (face-attribute 'mode-line :background))
(setq normal-state-background "#ff0000")
(add-hook 'evil-normal-state-entry-hook
          (lambda ()
            (set-face-attribute 'mode-line nil :background normal-state-background)))
(add-hook 'evil-normal-state-exit-hook
          (lambda ()
            (set-face-attribute 'mode-line nil :background original-background)))

Your Answer

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

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