Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

enter image description here

As you can see in the image, I have an underline under English word after Japanese.

Q1. Why there is no underline under Japanese?

Q2. How to get rid of it.

Q3. Is it because of syntax on?

Thanks in advance.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

This is probably down to syntax highlighting. It looks like you're writing a link in a markdown-formatted text file, and that the syntax highlighter is providing the underlining on the English part for the syntax highlighting.

As you've discovered, vim doesn't provide underlining for Japanese characters (this is probably the case for all ideographic languages). I'm no linguist, but I would guess that the reason the Japanese isn't underlined is that doing so might risk changing the meaning in a way that isn't the case for alphabetic languages, such as English.

See :h highlight and :hi for some information on syntax highlighting in vim.

To see how vim is defining your markdown links, you should use:

:hi markdownLinkText

For me, this gives the response:

markdownLinkText xxx links to htmlLink

...which means that it's inheriting it's definition from the htmlLink definition. Ok, well, let's see:

:hi htmlLink
htmlLink xxx links to Underlined
:hi Underlined
Underlined xxx cterm=underline ctermfg=9 guifg=#6c71c4

Aah, now we're in business! Of course, what you have here may vary from mine. cterm here defines what decorations vim will apply when run in a colour terminal, while ctermfg defines what foreground (text) colour vim should use for that text (and guifg defines what colour should be used when vim is running in a GUI version such as gVim). If you want, you can modify how Underlined is defined:

:hi Underlined cterm=none

This will get rid of all underlining. You can also modify the markdownLinkText like so:

:hi markdownLinkText ctermfg=9

...which will leave the underlying Underlined formatting unchanged. To make any of these permanent, add a line to your .vimrc.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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