Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim remove underline from line number

Tags:

vim

I upgraded vim (macOS) using brew:

$ brew info vim
vim: stable 8.1.2100 (bottled), HEAD

After the upgrade, the line numbers at the right are underlined, for example, from the attached picture line number 1 appears like 1_____, any idea how to remove the underline?

Happens only when having :set relativenumber

vim underli

like image 565
nbari Avatar asked Sep 30 '19 19:09

nbari


People also ask

How do I get rid of line numbers in Vim?

Make the vi/vim text editor display or hide line numbers. Press ESC key. At the : prompt type the following command to run on line numbers. set number. To turn off line numbering, type the following command at the : prompt. set nonumber.

How to display line numbers in the left margin in Vim?

Vim can display line numbers in the left margin: 1 Press ESC key 2 At the : prompt type the following command to run on line numbers: set number 3 To turn off line numbering, type the following command at the : prompt set nonumber More ...

How do I get line numbers in Vivi?

Vi or Vim show line number command. To display line numbers along the left side of a window, type any one of the following command while using text editor. First press the Esc key. Press : and type any one of the following command at a : prompt: set number. or.

How to set minimum number of columns to use for Vim line?

Minimal number of columns to use for the vim line number. Set following option: :set numberwidth=N :set numberwidth=1 :set numberwidth=4 :set numberwidth=10 The minimum value of N is 1, the maximum value N is 10. See this page for more info.


2 Answers

Latest versions defaults to underline: https://github.com/vim/vim/blob/017ba07fa2cdc578245618717229444fd50c470d/src/highlight.c#L256

CursorLineNr term=bold cterm=underline ctermfg=Yellow gui=bold guifg=Yellow

My templates was using only:

hi CursorLineNr    term=bold ctermfg=012 gui=bold

The fix was to define cterm:

hi CursorLineNr    term=bold cterm=bold ctermfg=012 gui=bold
like image 127
nbari Avatar answered Oct 23 '22 19:10

nbari


I found the fix for this in the .minttyrc as this was driving me crazy as well.

There is a setting in there for Term=vt100 Edit the .minttyrc in your home dir and comment out or remove the line Term=vt100. Save the file and close the CLI and reopen a new one. The underline should now be gone from vi from then on. I hope this helps.

like image 39
Daniel Hudsky Avatar answered Oct 23 '22 19:10

Daniel Hudsky