VIM Highlight the whole current line

前端 未结 3 622
一向
一向 2020-12-23 19:14

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

相关标签:
3条回答
  • 2020-12-23 19:48

    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.

    0 讨论(0)
  • 2020-12-23 19:53

    Shift + V puts you in visual mode, highlighting the entire line.

    0 讨论(0)
  • 2020-12-23 19:56

    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.

    0 讨论(0)
提交回复
热议问题