Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In a vim syntax file, how can I have "syn match" act case-insensitively?

Tags:

vim

I'm starting to edit Spider procedure files (i.e. the electron microscopy image processing program). I started creating my own syntax and ftplugin files for it, but wondered how I can make syn match act case-insensitively?

Currently I use two statements to achieve this affect (in .vim/syntax/spider.vim):

syn match spiderCommand /\<AC\>/$
syn match spiderCommand /\<ac\>/$
like image 462
Christopher Bottoms Avatar asked Jan 14 '23 00:01

Christopher Bottoms


1 Answers

I found the following in the docs:

syntax case ignore

Maybe that helps. However, I think it applies to all the matching.

Also, since /\<AC\>/$ is just a vim pattern, you should be able to use the standard "ignore case" directives \c. The following should work:

/\c\<AC\>/$
like image 168
January Avatar answered Feb 11 '23 06:02

January