Search code examples
vimhighlighting

Highlighting lines in vim excluding the row number


I have set number in my vimrc, and I want to highlight rows using my mouse cursor without selecting the row numbers, kinda like how MacVim does it. I understand that MacVim is a native application and vim is bound by the conditions of the shell/terminal that it is in.

Is there a way to make this happen?

I want this:

MacVim cursor highlight

Not this:

vim cursor highlight


Solution

  • If your terminal supports the mouse (some don't). Adding the following to your vimrc will enable the mouse to be used for visual selections.

    set mouse=a