What is the best way to highlight the whole current line in Vim? In some IDEs I am able to set some sort of 20% opacity of the line I am editing, this is great to find where I am rather quickly.
Asked
Active
Viewed 2.4k times
3 Answers
109
To highlight the current line use
:set cursorline
To highlight the current column use
:set cursorcolumn
The visual appearance of this can be modified. Have a look around :help hl-CursorLine
or hl-CursorColumn
.

Benjamin Bannier
- 55,163
- 11
- 60
- 80
16
See the Vim wiki on this subject for the complete story.
I especially found the following bit handy (when working with more than one window).
autocmd WinEnter * setlocal cursorline
autocmd WinLeave * setlocal nocursorline
Only highlight the current line in the active window.

Niels Bom
- 8,728
- 11
- 46
- 62
9
Shift + V puts you in visual mode, highlighting the entire line.

Cristian Ciupitu
- 20,270
- 7
- 50
- 76

Andrew Cowenhoven
- 2,778
- 22
- 27
-
It makes sense. Sorry for the confusion. – Helmut Granda Jan 06 '12 at 19:40
-
2This enters Vim in Visual Mode though. When you are going to move to another line, the lines in between will be highlighted as well. – Vladislavs Dovgalecs Jun 29 '15 at 23:56