I have a file with two columns, separated by a tab, and would like to match any part of the second column that begins with an asterisk. For example:
RAFP rasp ET *ratchet
*ratchet should be highlighted. (There are two spaces before the first column, and there are supposed to be – in some other rows, there are symbols placed in that space.)
Therefore, I wrote the following match line:
syntax match Keyword "\t\*.*"
It does not highlight anything. I have tried removing and adding escape characters, putting elements in square brackets, playing with the magic option (though I see in the help that syntax matches are always in magic mode no matter what) and just about everything else possible. If I take out the
\t, then it works as expected, but this has the potential for false positives, so it's important that the pattern start with the tab.
Most baffling, if I do a simple search for
hlsearch on, it highlights exactly like it's supposed to. What is different about the pattern matching in a syntax highlight command from the normal search matching system?
I'm using Vim 7.4 (I can give more version output if it's relevant).