Friday, March 4, 2011

limit syntax match to not match strings starting with dashes

Hello vimmers,

I'm using the PS1.vim syntax file while writing Powershell scripts.

It has a line like this:
syn match ps1Cmdlet /\w\+-\w\+/

which should (and does) match command names like Write-Debug, Get-Date, etc.

However, it also incorrectly matches command line arguments like
mysqldump --single-transaction

where "single-transaction" is highlighted with the ps1Cmdlet colors.

How can I change this so that it matches the verb-noun syntax that Powershell uses but doesn't match the dashed arguments?

Thanks,
Dan

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment