I can highlight the current line like this :set cursorline, which underlines the current line.

enter image description here

However I would like to highlight the entire line in a lighter color. How can I achieve this look?

enter image description here

1 Answer 1


According to :help cursorline, the highlight label is CursorLine. So you can try:

:highlight CursorLine ctermbg=LightBlue

See :help highlight-cterm for more options.

Experiment with the colours to see which suits you.

  • The command works and I want to put it in my .vimrc. So I added this set highlight cursorline ctermbg=LightBlue and I get this E518: Unknown option: ctermbg=LightBlue
    – Vader
    Mar 21, 2015 at 20:12
  • 1
    @Vader try without the set. As in set cursorline on one line and the command in my answer on another line.
    – muru
    Mar 21, 2015 at 20:12
  • That removes the Error, but it still not showing up. Anyway you answered my original questions, so thanks.
    – Vader
    Mar 21, 2015 at 20:16
  • @Vader Did you enable the 256 colors option? Your .vimrc should have a line like set t_Co=256.
    – Right leg
    May 21, 2018 at 20:26

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.