~ubuntu-branches/ubuntu/vivid/vim/vivid

« back to all changes in this revision

Viewing changes to runtime/syntax/sh.vim

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2008-11-05 11:37:43 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20081105113743-9i4urcsm3n44mhqe
Tags: 2:7.2.025-2ubuntu1
* Merge from debian unstable, remaining changes:
  - runtime/syntax/debcontrol.vim:
    + Add "metapackages" to the list of valid sections.
  - runtime/syntax/debchangelog.vim:
    + Add "jaunty" to the list of valid suites.
  - Drop vim-lesstif package and lesstif2-dev build-dependency.
  - Enable Python interpreter on basic builds.
  - Create a .pot file for translations.
  - Disable autoindent, line-wrapping, and backup files by default.
  - runtime/syntax/debsources.vim:
    + Add "jaunty" to debsourcesDistrKeyword
  - runtime/syntax/grub.vim:
    + Add Ubuntu-specific 'quiet' keyword.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
" Language:             shell (sh) Korn shell (ksh) bash (sh)
3
3
" Maintainer:           Dr. Charles E. Campbell, Jr.  <NdrOchipS@PcampbellAfamily.Mbiz>
4
4
" Previous Maintainer:  Lennart Schultz <Lennart.Schultz@ecmwf.int>
5
 
" Last Change:          Mar 06, 2008
6
 
" Version:              97
 
5
" Last Change:          Jul 11, 2008
 
6
" Version:              102
7
7
" URL:          http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
8
8
" For options and settings, please use:      :help ft-sh-syntax
9
9
" This file includes many ideas from �ric Brunet (eric.brunet@ens.fr)
179
179
" ======
180
180
if (g:sh_fold_enabled % (s:sh_fold_ifdofor * 2))/s:sh_fold_ifdofor
181
181
 syn region shDo        fold transparent matchgroup=shConditional start="\<do\>" matchgroup=shConditional end="\<done\>" contains=@shLoopList
182
 
 syn region shIf        fold transparent matchgroup=shConditional start="\<if\>" matchgroup=shConditional end="\<;\_s*then\>" end="\<fi\>"   contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey
183
 
 syn region shFor       fold matchgroup=shLoop start="\<for\>" end="\<in\>" end="\<do\>"me=e-2  contains=@shLoopList,shDblParen skipwhite nextgroup=shCurlyIn
 
182
 syn region shIf        fold transparent matchgroup=shConditional start="\<if\_s" matchgroup=shConditional end="\<;\_s*then\>" end="\<fi\>"   contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey
 
183
 syn region shFor       fold matchgroup=shLoop start="\<for\_s" end="\<in\_s" end="\<do\>"me=e-2        contains=@shLoopList,shDblParen skipwhite nextgroup=shCurlyIn
184
184
else
185
185
 syn region shDo        transparent matchgroup=shConditional start="\<do\>" matchgroup=shConditional end="\<done\>" contains=@shLoopList
186
 
 syn region shIf        transparent matchgroup=shConditional start="\<if\>" matchgroup=shConditional end="\<;\_s*then\>" end="\<fi\>"   contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey
187
 
 syn region shFor       matchgroup=shLoop start="\<for\>" end="\<in\>" end="\<do\>"me=e-2       contains=@shLoopList,shDblParen skipwhite nextgroup=shCurlyIn
 
186
 syn region shIf        transparent matchgroup=shConditional start="\<if\_s" matchgroup=shConditional end="\<;\_s*then\>" end="\<fi\>"   contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey
 
187
 syn region shFor       matchgroup=shLoop start="\<for\_s" end="\<in\>" end="\<do\>"me=e-2      contains=@shLoopList,shDblParen skipwhite nextgroup=shCurlyIn
188
188
endif
189
189
if exists("b:is_kornshell") || exists("b:is_bash")
190
190
 syn cluster shCaseList add=shRepeat
191
191
 syn cluster shFunctionList     add=shRepeat
192
 
 syn region shRepeat   matchgroup=shLoop   start="\<while\>" end="\<in\>" end="\<do\>"me=e-2    contains=@shLoopList,shDblParen,shDblBrace
193
 
 syn region shRepeat   matchgroup=shLoop   start="\<until\>" end="\<in\>" end="\<do\>"me=e-2    contains=@shLoopList,shDblParen,shDblBrace
194
 
 syn region shCaseEsac matchgroup=shConditional start="\<select\>" matchgroup=shConditional end="\<in\>" end="\<do\>" contains=@shLoopList
 
192
 syn region shRepeat   matchgroup=shLoop   start="\<while\_s" end="\<in\_s" end="\<do\>"me=e-2  contains=@shLoopList,shDblParen,shDblBrace
 
193
 syn region shRepeat   matchgroup=shLoop   start="\<until\_s" end="\<in\_s" end="\<do\>"me=e-2  contains=@shLoopList,shDblParen,shDblBrace
 
194
 syn region shCaseEsac matchgroup=shConditional start="\<select\s" matchgroup=shConditional end="\<in\>" end="\<do\>" contains=@shLoopList
195
195
else
196
 
 syn region shRepeat   matchgroup=shLoop   start="\<while\>" end="\<do\>"me=e-2         contains=@shLoopList
197
 
 syn region shRepeat   matchgroup=shLoop   start="\<until\>" end="\<do\>"me=e-2         contains=@shLoopList
 
196
 syn region shRepeat   matchgroup=shLoop   start="\<while\_s" end="\<do\>"me=e-2                contains=@shLoopList
 
197
 syn region shRepeat   matchgroup=shLoop   start="\<until\_s" end="\<do\>"me=e-2                contains=@shLoopList
198
198
endif
199
199
syn region shCurlyIn   contained        matchgroup=Delimiter start="{" end="}" contains=@shCurlyList
200
200
syn match  shComma     contained        ","
272
272
endif
273
273
syn region  shSingleQuote       matchgroup=shOperator start=+'+ end=+'+         contains=shStringSpecial,@Spell
274
274
syn region  shDoubleQuote       matchgroup=shOperator start=+"+ skip=+\\"+ end=+"+      contains=@shDblQuoteList,shStringSpecial,@Spell
275
 
syn match   shStringSpecial     "[^[:print:]]"  contained
 
275
syn match   shStringSpecial     "[^[:print:] \t]"       contained
276
276
syn match   shStringSpecial     "\%(\\\\\)*\\[\\"'`$()#]"
277
277
syn match   shSpecial   "[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]"
278
278
syn match   shSpecial   "^\%(\\\\\)*\\[\\"'`$()#]"
348
348
endif
349
349
 
350
350
" Functions: {{{1
351
 
syn keyword shFunctionKey function      skipwhite skipnl nextgroup=shFunctionTwo
 
351
if !exists("g:is_posix")
 
352
 syn keyword shFunctionKey function     skipwhite skipnl nextgroup=shFunctionTwo
 
353
endif
352
354
 
353
355
if exists("b:is_bash")
354
356
 if (g:sh_fold_enabled % (s:sh_fold_functions * 2))/s:sh_fold_functions
443
445
" Useful ksh Keywords: {{{1
444
446
" ====================
445
447
if exists("b:is_kornshell") || exists("b:is_bash")
446
 
 syn keyword shStatement autoload bg false fc fg functions getopts hash history integer jobs let nohup print printf r stop suspend time times true type unalias whence
 
448
 syn keyword shStatement autoload bg false fc fg functions getopts hash history integer jobs let nohup print printf r stop suspend times true type unalias whence
 
449
 if exists("g:is_posix")
 
450
  syn keyword shStatement command
 
451
 else
 
452
  syn keyword shStatement time
 
453
 endif
447
454
 
448
455
" Useful bash Keywords: {{{1
449
456
" =====================