When I reload my syntax file I receive this error:
E890: trailing char after ']': /v(.)@<=w+[nrs]/
Here's the line it's bugging out on, does anyone see why this doesn't work?
syntax keyword langMethod /\v(\.)\@<=\w+/
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.Sign up to join this community
Ok, I think I've figured it out. It has to do with your "very magic" option. You have a lookbehind:
(\.)\@<=. However, in very magic mode you are not supposed to escape the
@ in a lookaround.
On a slightly unrelated note, You have a
\s in your character class
. You can't use shortcuts in character classes. (@muru pointed out that what you're looking for here with this character class is
\_s which matches whitespace and newlines.) So the final expression I've come up with is the following:
See if that works for you.
It is my personal preference never to use the
\v flag for this very reason. Too many exceptions to remember. I just like to use the default regex and learn one set of rules. :P