Reputation: 53
I'm trying to write a custom syntax highlighting file (.vim) and comments for the language are either a '.', '', or '+' starting in the first column of the line.
.comment
*comment
+comment
not a comment
Is there a way to match these types of comments? I've tried
syn match myComment '(\s)@![.|*|+]*.*'
Basically, I tried testing for no whitespace, because I wanted to start in the first column, but it does not work that way.
Upvotes: 2
Views: 114
Reputation: 172540
The ^
atom matches in the first column:
syn match myComment '^[.*+].*'
Also, your regular expression syntax is off:
\v
, you have to escape the \(...\)
capture group and the \@!
multi.[...]
, you don't separate via \|
.Upvotes: 4