The answer depends whether you use the graphical user interface or the terminal user interface.
For either UI, the underdotted attributes may not be available as descibed in :help attr-list
or :help underdotted
(they link to the same :help
item). If a certain setting does not work, it's best to change to a configuration that's known to be working and modify step by step.
Terminal user interface
The exact outcome depends on the capabilities of your terminal emulator.
:highlight CursorLine cterm=underdotted ctermul=white
See :help highlight-ctermul
for the documentation on the color terminal underline highlight argument.
Depending on what's already set, you may have to unset additional arguments like this:
:highlight CursorLine cterm=underdotted ctermfg=NONE ctermbg=NONE ctermul=white
Graphical user interface
For the GUI, the gui*
attributes are used instead of the cterm*
ones. Namely, the guisp
controls the color of strikethrough and underline (apparently also underdotted but that's undocumented). See :help highlight-guisp
.
The command would look like this:
:highlight CursorLine gui=underdotted guifg=NONE guibg=NONE guisp=white
Putting it all together
To get a consistent look across TUI and GUI versions, both commands can be combined into:
:highlight CursorLine cterm=underdotted ctermfg=NONE ctermbg=NONE ctermul=white gui=underdotted guifg=NONE guibg=NONE guisp=white
Note: in my local setup, underdotted lines are not supported, neither in TUI or GUI versions. At the same time, underlines in GUI were always in guifg
color. Parts of this answer are based on OP's observations.