dan
dan

Reputation: 45632

How would you syntax-color camelcase words in Vim?

What vimscript command(s) could you use to syntax-color words in CamelCase?

Upvotes: 4

Views: 326

Answers (1)

too much php
too much php

Reputation: 91028

You can just use the :match command if you want to highlight words with camelCase:

:match Error /\C\<[a-z0-9]\+[A-Z]\w*\>/

If you were to use syntax commands you would first need to decide how you want to work in with the existing syntax highlighting for each filetype, but this would give you more control - e.g., only matching camelCase used in names of variables.

Upvotes: 3

Related Questions