I have to put a macro in front of Greek text to get correct hyphenation, such that I have, e.g.: possibly \textgreek{κινούμενον} and possibly not. Could I use conceal to conceal the macro and show the words in green?


You could:

:highlight GreekHyphen guifg=green ctermfg=green
:syn region GreekHyphen matchgroup=GreekHyphenMark start='\\textgreek{' end='}' concealends

You need to use matchgroup for concealends to work. concealends is used to conceal only the boundaries of a match:

concealends                     *:syn-concealends*

When the "concealends" argument is given, the start and end matches of
the region, but not the contents of the region, are marked as concealable.
Whether or not they are actually concealed depends on the setting on the
'conceallevel' option. The ends of a region can only be concealed separately
in this way when they have their own highlighting via "matchgroup"

Beware though: I don't know how well this will work with nested commands.

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.