I want to hide variables with names based on Greek characters and turn them into their equivalent Unicode character, just as vim-cute-python works, So, for example, I have this
syntax match scalaNiceKeyword "alpha" conceal cchar=α
defined in a file to hide in Scala files, which works fine except that it is overly aggressive. If I write alphabet, it will be hidden in order to become αbet, which is noticeably wrong. How can I change / expand this hidden operator so that it only hides keywords that match "[_] alpha [_]", that is, I want the following conversions
alpha_1 => α_1
alpha => α
alphabet => alphabet
Note. This is similar to this question , but it seems a bit more complicated, since the group environment I want to map to is spaces and underscores. A naive definition of a syntax area, like the following, makes things all kinds of wrong:
syn region scalaGreekGroup start="[ _]" end="[ _]"
Thanks in advance!
source
share