mirror of
https://github.com/scopatz/nanorc
synced 2024-11-27 12:25:53 +01:00
ed0360518f
- Commands: - remove not workable regex - change to use *official-approved verbs* instead - add 157 builtin aliases - Comparison operators: - add 47 more operators not been covered - Keywords (statement): - add 28 more keywords not been covered - Types: - add 14 new types highlighting - Comments: - fix a buggy case of block comment - Quoted text: - add a here-string case not been covered
40 lines
2.9 KiB
Plaintext
40 lines
2.9 KiB
Plaintext
## Nano syntax highlighting file for PowerShell
|
|
## Written by Rashil Gandhi (https://github.com/rashil2000)
|
|
## Enhanced by davidhcefx (https://github.com/davidhcefx)
|
|
|
|
syntax "PowerShell" "\.[pP][sS][1]$" "\.[pP][sS][mM][1]$"
|
|
comment "# "
|
|
|
|
## Commands
|
|
# https://docs.microsoft.com/en-us/powershell/scripting/developer/cmdlet/approved-verbs-for-windows-powershell-commands
|
|
icolor brightblue "\<(Add|Clear|Close|Copy|Enter|Exit|Find|Format|Get|Hide|Join|Lock|Move|New|Open|Optimize|Pop|Push|Redo|Remove|Rename|Reset|Resize|Search|Select|Set|Show|Skip|Split|Step|Switch|Undo|Unlock|Watch|Backup|Checkpoint|Compare|Compress|Convert|ConvertFrom|ConvertTo|Dismount|Edit|Expand|Export|Group|Import|Initialize|Limit|Merge|Out|Publish|Restore|Save|Sync|Unpublish|Update|Approve|Assert|Complete|Confirm|Deny|Disable|Enable|Install|Invoke|Register|Request|Restart|Resume|Start|Stop|Submit|Suspend|Uninstall|Unregister|Wait|Debug|Measure|Ping|Repair|Resolve|Test|Trace|Connect|Disconnect|Read|Receive|Send|Write|Block|Grant|Protect|Revoke|Unblock|Unprotect|Use|ForEach|Sort|Tee|Where)+(-)[[:alnum:]_]+"
|
|
# Builtin aliases
|
|
icolor brightblue "\<(ac|asnp|cat|cd|CFS|chdir|clc|clear|clhy|cli|clp|cls|clv|cnsn|compare|copy|cp|cpi|cpp|curl|cvpa|dbp|del|diff|dir|dnsn|ebp|echo|0|epal|epcsv|epsn|erase|etsn|exsn|fc|fhx|fl|ft|fw|gal|gbp|gc|gcb|gci|gcm|gcs|gdr|gerr|ghy|gi|gin|gjb|gl|gm|gmo|gp|gps|gpv|group|gsn|gsnp|gsv|gtz|gu|gv|gwmi|h|history|icm|iex|ihy|ii|ipal|ipcsv|ipmo|ipsn|irm|ise|iwmi|iwr|kill|lp|ls|man|md|measure|mi|mount|move|mp|mv|nal|ndr|ni|nmo|npssc|nsn|nv|ogv|oh|popd|ps|pushd|pwd|r|rbp|rcjb|rcsn|rd|rdr|ren|ri|rjb|rm|rmdir|rmo|rni|rnp|rp|rsn|rsnp|rujb|rv|rvpa|rwmi|sajb|sal|saps|sasv|sbp|sc|scb|select|set|shcm|si|sl|sleep|sls|sort|sp|spjb|spps|spsv|start|stz|sujb|sv|swmi|tee|trcm|type|wget|where|wjb|write)\>"
|
|
|
|
## Operators
|
|
icolor green "-\<(and|as|band|bnot|bor|bxor|casesensitive|ccontains|ceq|cge|cgt|cle|clike|clt|cmatch|cne|cnotcontains|cnotlike|cnotmatch|contains|creplace|csplit|eq|exact|f|file|ge|gt|icontains|ieq|ige|igt|ile|ilike|ilt|imatch|in|ine|inotcontains|inotlike|inotmatch|ireplace|is|isnot|isplit|join|le|like|lt|match|ne|not|notcontains|notin|notlike|notmatch|or|regex|replace|shl|shr|split|wildcard|xor)\>"
|
|
|
|
## Variables
|
|
icolor brightred "\$[[:alnum:]_]+"
|
|
|
|
## Keywords
|
|
icolor brightcyan "\<(if|else|foreach|return|do|while|until|elseif|begin|for|trap|data|dynamicparam|end|break|throw|param|continue|finally|in|switch|exit|filter|try|process|catch|hidden|static|parameter)\>"
|
|
icolor brightcyan "\<(class|enum|function|using|assembly|command|module|namespace|type)\>"
|
|
|
|
## Types
|
|
icolor green "\<(string|char|byte|int|long|bool|decimal|single|double|DateTime|xml|array|hashtable|void)\>"
|
|
|
|
## Comments
|
|
color cyan start="<#" end="#>"
|
|
color cyan "(^|[[:space:]])#[^>].*$"
|
|
|
|
## Quoted text
|
|
color brightyellow "\"[^\"]*\""
|
|
color brightyellow "'[^']*'"
|
|
## Here strings
|
|
icolor brightmagenta start="@\"" end="\"@"
|
|
icolor brightmagenta start="@'" end="'@"
|
|
|
|
## Trailing whitespace
|
|
color ,green "[[:space:]]+$"
|