Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .