I use the excellent ps1.vim script originally written by Peter Provost to provide syntax highlighting for PowerShell scripts in Vim, and I’ve been very happy with it in general. However, PowerShell V2 is coming with a few extra syntax enhancements and there were always a couple minor issues that bugged me with the existing syntax.
So I spent some time adding a few extensions to ps1.vim to improve some of this. The changes include:
- Support for Block Comments (
- Highlighting documentation “tags” in comments (things like
.Parameterand so forth).
- Highlighting variable usage in “” strings, as well as string interpolations
- Highlighting special characters in strings (
`rand so on).
- Highlighting for hex numbers
- Different highlighting for Booleans (
$true), known constants (
$null) and other built-in variables.
It’s not much, but I think it’s going to be useful.