Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VIM Highlight the whole current line

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.

like image 610
Helmut Granda Avatar asked Jan 05 '12 22:01

Helmut Granda


People also ask

How do you highlight an entire line in vim?

If you want to select the entire line in a file, press V. Now when you press k or j to go up and down, vim will select the entire line above and below your cursor.

How do I highlight a column in vim?

Use ctrl+v to select a column of text consisting of the first character of the place you want your new column to go in front of. Use I to go into insert mode, and type one space. Press Esc, and you'll see you have inserted a column of single spaces. Now use ctrl+v again to highlight the column of spaces.


1 Answers

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.

like image 91
Benjamin Bannier Avatar answered Oct 14 '22 21:10

Benjamin Bannier