Mercurial > vim
comparison runtime/syntax/sh.vim @ 482:6f8b578776ab v7.0131
updated for version 7.0131
author | vimboss |
---|---|
date | Tue, 16 Aug 2005 23:01:50 +0000 |
parents | 3b705e71c7b0 |
children | a1059cda45f2 |
comparison
equal
deleted
inserted
replaced
481:66080ac5dab7 | 482:6f8b578776ab |
---|---|
1 " Vim syntax file | 1 " Vim syntax file |
2 " Language: shell (sh) Korn shell (ksh) bash (sh) | 2 " Language: shell (sh) Korn shell (ksh) bash (sh) |
3 " Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz> | 3 " Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz> |
4 " Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int> | 4 " Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int> |
5 " Last Change: Jul 01, 2005 | 5 " Last Change: Aug 16, 2005 |
6 " Version: 75 | 6 " Version: 76 |
7 " URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax | 7 " URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax |
8 " | 8 " |
9 " Using the following VIM variables: {{{1 | 9 " Using the following VIM variables: {{{1 |
10 " b:is_kornshell if defined, enhance with kornshell syntax | 10 " b:is_kornshell if defined, enhance with kornshell syntax |
11 " b:is_bash if defined, enhance with bash syntax | 11 " b:is_bash if defined, enhance with bash syntax |
71 syn cluster shCaseList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shSpecial | 71 syn cluster shCaseList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shSpecial |
72 syn cluster shColonList contains=@shCaseList | 72 syn cluster shColonList contains=@shCaseList |
73 syn cluster shCommandSubList contains=shArithmetic,shDeref,shDerefSimple,shNumber,shOperator,shPosnParm,shSpecial,shExSingleQuote,shSingleQuote,shDoubleQuote,shStatement,shVariable,shSubSh,shAlias,shTest | 73 syn cluster shCommandSubList contains=shArithmetic,shDeref,shDerefSimple,shNumber,shOperator,shPosnParm,shSpecial,shExSingleQuote,shSingleQuote,shDoubleQuote,shStatement,shVariable,shSubSh,shAlias,shTest |
74 syn cluster shCurlyList contains=shNumber,shComma,shDeref,shDerefSimple,shDerefSpecial | 74 syn cluster shCurlyList contains=shNumber,shComma,shDeref,shDerefSimple,shDerefSpecial |
75 syn cluster shDblQuoteList contains=shCommandSub,shDeref,shDerefSimple,shSpecial,shPosnParm | 75 syn cluster shDblQuoteList contains=shCommandSub,shDeref,shDerefSimple,shSpecial,shPosnParm |
76 syn cluster shDerefList contains=shDeref,shDerefSimple,shDerefVar,shDerefSpecial,shDerefWordError | 76 syn cluster shDerefList contains=shDeref,shDerefSimple,shDerefVar,shDerefSpecial,shDerefWordError,shDerefPPS |
77 syn cluster shDerefVarList contains=shDerefOp,shDerefVarArray,shDerefOpError | 77 syn cluster shDerefVarList contains=shDerefOp,shDerefVarArray,shDerefOpError |
78 syn cluster shEchoList contains=shArithmetic,shCommandSub,shDeref,shDerefSimple,shExpr,shExSingleQuote,shSingleQuote,shDoubleQuote,shSpecial | 78 syn cluster shEchoList contains=shArithmetic,shCommandSub,shDeref,shDerefSimple,shExpr,shExSingleQuote,shSingleQuote,shDoubleQuote,shSpecial |
79 syn cluster shExprList1 contains=shCharClass,shNumber,shOperator,shExSingleQuote,shSingleQuote,shDoubleQuote,shSpecial,shExpr,shDblBrace,shDeref,shDerefSimple | 79 syn cluster shExprList1 contains=shCharClass,shNumber,shOperator,shExSingleQuote,shSingleQuote,shDoubleQuote,shSpecial,shExpr,shDblBrace,shDeref,shDerefSimple |
80 syn cluster shExprList2 contains=@shExprList1,@shCaseList,shTest | 80 syn cluster shExprList2 contains=@shExprList1,@shCaseList,shTest |
81 syn cluster shFunctionList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shCommandSub,shComment,shDo,shEcho,shFor,shHereDoc,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shSpecial,shOperator,shFunctionStart | 81 syn cluster shFunctionList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shCommandSub,shComment,shDo,shEcho,shFor,shHereDoc,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shSpecial,shOperator,shFunctionStart |
366 syn match shDerefOp contained ":\=[-=?]" nextgroup=@shDerefPatternList | 366 syn match shDerefOp contained ":\=[-=?]" nextgroup=@shDerefPatternList |
367 syn match shDerefOp contained ":\=+" nextgroup=@shDerefPatternList | 367 syn match shDerefOp contained ":\=+" nextgroup=@shDerefPatternList |
368 if exists("b:is_bash") || exists("b:is_kornshell") | 368 if exists("b:is_bash") || exists("b:is_kornshell") |
369 syn match shDerefOp contained "#\{1,2}" nextgroup=@shDerefPatternList | 369 syn match shDerefOp contained "#\{1,2}" nextgroup=@shDerefPatternList |
370 syn match shDerefOp contained "%\{1,2}" nextgroup=@shDerefPatternList | 370 syn match shDerefOp contained "%\{1,2}" nextgroup=@shDerefPatternList |
371 syn match shDerefPattern contained "[^{}]\+" contains=shDeref,shDerefSimple,shDerefPattern,shDerefString,shCommandSub nextgroup=shDerefPattern | 371 syn match shDerefPattern contained "[^{}]\+" contains=shDeref,shDerefSimple,shDerefPattern,shDerefString,shCommandSub,shDerefEscape nextgroup=shDerefPattern |
372 syn region shDerefPattern contained start="{" end="}" contains=shDeref,shDerefSimple,shDerefString,shCommandSub nextgroup=shDerefPattern | 372 syn region shDerefPattern contained start="{" end="}" contains=shDeref,shDerefSimple,shDerefString,shCommandSub nextgroup=shDerefPattern |
373 syn match shDerefEscape contained '\%(\\\\\)*\\.' | |
373 endif | 374 endif |
374 syn region shDerefString contained matchgroup=shOperator start=+'+ end=+'+ contains=shStringSpecial | 375 syn region shDerefString contained matchgroup=shOperator start=+'+ end=+'+ contains=shStringSpecial |
375 syn region shDerefString contained matchgroup=shOperator start=+"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial | 376 syn region shDerefString contained matchgroup=shOperator start=+"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial |
376 syn match shDerefString contained "\\["']" | 377 syn match shDerefString contained "\\["']" |
377 | 378 |
378 " bash : ${parameter:offset} | 379 if exists("b:is_bash") |
379 " bash : ${parameter:offset:length} | 380 " bash : ${parameter:offset} |
380 " bash : ${parameter//pattern/string} | 381 " bash : ${parameter:offset:length} |
381 " bash : ${parameter//pattern} | |
382 if exists("b:is_bash") | |
383 syn region shDerefOp contained start=":[$[:alnum:]_]"me=e-1 end=":"me=e-1 end="}"me=e-1 contains=@shCommandSubList nextgroup=shDerefPOL | 382 syn region shDerefOp contained start=":[$[:alnum:]_]"me=e-1 end=":"me=e-1 end="}"me=e-1 contains=@shCommandSubList nextgroup=shDerefPOL |
384 syn match shDerefPOL contained ":[^}]\{1,}" contains=@shCommandSubList | 383 syn match shDerefPOL contained ":[^}]\+" contains=@shCommandSubList |
385 syn match shDerefOp contained "/\{1,2}" nextgroup=shDerefPat | 384 |
386 syn match shDerefPat contained "[^/}]\{1,}" nextgroup=shDerefPatStringOp | 385 " bash : ${parameter//pattern/string} |
387 syn match shDerefPatStringOp contained "/" nextgroup=shDerefPatString | 386 " bash : ${parameter//pattern} |
388 syn match shDerefPatString contained "[^}]\{1,}" | 387 syn match shDerefPPS contained '/\{1,2}' nextgroup=shDerefPPSleft |
388 syn region shDerefPPSleft contained start='.' skip=@\%(\\\)\/@ matchgroup=shDerefOp end='/' nextgroup=shDerefPPSright contains=@shCommandSubList | |
389 syn region shDerefPPSright contained start='.' end='\ze}' contains=@shCommandSubList | |
389 endif | 390 endif |
390 | 391 |
391 " Useful sh Keywords: {{{1 | 392 " Useful sh Keywords: {{{1 |
392 " =================== | 393 " =================== |
393 syn keyword shStatement break cd chdir continue eval exec exit kill newgrp pwd read readonly return shift test trap ulimit umask wait | 394 syn keyword shStatement break cd chdir continue eval exec exit kill newgrp pwd read readonly return shift test trap ulimit umask wait |
439 hi def link shCaseSingleQuote shSingleQuote | 440 hi def link shCaseSingleQuote shSingleQuote |
440 hi def link shCaseStart shConditional | 441 hi def link shCaseStart shConditional |
441 hi def link shCmdSubRegion shShellVariables | 442 hi def link shCmdSubRegion shShellVariables |
442 hi def link shColon shStatement | 443 hi def link shColon shStatement |
443 hi def link shDerefOp shOperator | 444 hi def link shDerefOp shOperator |
444 hi def link shDerefPatStringOp shDerefOp | |
445 hi def link shDerefPatString shDerefPattern | |
446 hi def link shDerefPOL shDerefOp | 445 hi def link shDerefPOL shDerefOp |
446 hi def link shDerefPPS shDerefOp | |
447 hi def link shDeref shShellVariables | 447 hi def link shDeref shShellVariables |
448 hi def link shDerefSimple shDeref | 448 hi def link shDerefSimple shDeref |
449 hi def link shDerefSpecial shDeref | 449 hi def link shDerefSpecial shDeref |
450 hi def link shDerefString shDoubleQuote | 450 hi def link shDerefString shDoubleQuote |
451 hi def link shDerefVar shDeref | 451 hi def link shDerefVar shDeref |