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
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.
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 ...
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.
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.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With