Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the color of Vim's (straight) underline?

Tags:

vim

I've tried everything changing the color of this:

call s:h("Underlined",    {"fg": s:norm, "gui": "underline", "cterm": "underline"})

As well as all the colors of the link texts.

Does anybody know how to change it?

Here's a picture:

enter image description here

like image 273
alexchenco Avatar asked Jan 09 '15 11:01

alexchenco


People also ask

Can we change color underline?

Change the underline style and color Select the text that you want to underline. Tip: You can also use the keyboard shortcut Ctrl+D. Use the Underline style drop-down list to select an underline style. Use the Underline color drop-down list to change the color of the line.

How do I change the highlight color in VIM?

You can change color schemes at anytime in vi by typing colorscheme followed by a space and the name of the color scheme. For more color schemes, you can browse this library on the vim website. You can enable or disable colors by simply typing "syntax on" or "syntax off" in vi.


2 Answers

For a long time, you couldn't; the underline color always equaled the text color. AFAICT, in terminals this wasn't supported, and for consistency, Vim also didn't offer this in GVIM.

With Vim 8.2.0863, the ctermul attribute allows setting a separate color for underline / undercurl now. Apparently, this still isn't supported in GVIM, though (which I find odd, because Vim usually values consistency in features over fancy stuff (as explained by :help design-not)).

In GVIM, you could switch to the (GUI-only) undercurl attribute (mostly used for spell checking), which supports a separate "special color", set via guisp={color-name}; see :help highlight-guisp.

like image 191
Ingo Karkat Avatar answered Nov 04 '22 13:11

Ingo Karkat


For anyone finding that in 2021, you can use guisp=red in neovim at least.

For example I use

:hi CocErrorHighlight gui=undercurl guisp=red 

to have red curly lines.

I am using NeoVim in the Xfce-Terminal.

like image 7
Roland Fredenhagen Avatar answered Nov 04 '22 15:11

Roland Fredenhagen