Qin
Qin

Reputation: 63

Highlight all upper case words in VIM

In my .vimrc file, I added

match Title /EXAMPLE/

so when I type EXAMPLE, this word is highlighted, it works fine, and my question is, how do I highlight all upper case letter? not just EXAMPLE, but everything else too.

--> THIS IS AN EXAMPLE
--> SECOND EXAMPLE
--> ETC

I want to highlight something like the sentences above.

Upvotes: 4

Views: 1660

Answers (2)

alvin
alvin

Reputation: 1196

this should work for words in all uppercase

:syn match Error "\v<[A-Z]+>"

Upvotes: 5

Pavan Manjunath
Pavan Manjunath

Reputation: 28535

Do something like this

match Title /[A-Z]/

This will highlight all uppercase letters

Upvotes: 7

Related Questions