Currently when working with vim's spellcheck a word is highlighted a certain color based on the type of error it is. Instead of highlighting the erroneous word I'd like it to be underlined with the highlighted color. I'm aware it's possible underline a certain highlight group with cterm=underline, and I can change to foreground color with the ctermfg option, but that changes the color of the word and underline whereas I just want the underline to be a different color.

  • I don't think this is currently possible. It looks like one can define the color attribute only for undercurl and strikethrough using the guisp attribute, and that is only possible in the gui – Christian Brabandt May 8 '19 at 5:53

This is not something that can be done in a terminal. Vim doesn't directly "draw" anything, it just sends text interspersed with escape codes for colouring, positioning, etc. From Vim's perspective it's all text-based.

There is an escape code to change the text colour and there is one to set the underline attribute. But there is none to change the colour of just the underline.

It wouldn't be too hard to add a new escape code for this, I suppose. But as far as I know no terminal has done so at this point.

In gvim you can do this with guisp, which is used for both strikethrough and undercurl (but not underline):

:hi SpellBad guisp=blue
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.