home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / unix / vim-6.2.tar.bz2 / vim-6.2.tar / vim62 / runtime / syntax / indent.vim < prev    next >
Encoding:
Text File  |  2002-10-24  |  4.5 KB  |  101 lines

  1. " Vim syntax file
  2. " Language:        indent RC File
  3. " Maintainer:        Nikolai 'pcp' Weibull <da.box@home.se>
  4. " URL:            http://www.pcppopper.org/
  5. " Latest Revision:  2002-10-24
  6. " TODO: is the deny-all (a la lilo.vim nice or no?)...
  7. "    irritating to be wrong to the last char...
  8. "    would be sweet if right until one char fails
  9.  
  10. if version < 600
  11.     syntax clear
  12. elseif exists("b:current_syntax")
  13.     finish
  14. endif
  15.  
  16. " Set iskeyword since we need `-' (and potentially others) in keywords.
  17. " For version 5.x: Set it globally
  18. " For version 6.x: Set it locally
  19. if version >= 600
  20.   command -nargs=1 SetIsk setlocal iskeyword=<args>
  21. else
  22.   command -nargs=1 SetIsk set iskeyword=<args>
  23. endif
  24. SetIsk 48-57,65-90,97-122,-,_
  25. delcommand SetIsk
  26.  
  27. " errors
  28. syn match   indentError "\S\+"
  29.  
  30. " comments
  31. syn region  indentComment matchgroup=indentComment start="/\*" end="\*/" contains=indentTodo
  32.  
  33. " todo
  34. syn keyword indentTodo contained TODO
  35.  
  36. " keywords (command-line switches)
  37. syn match   indentOptions "\<--\(no-\)\=blank-\(before-sizeof\|Bill-Shannon\|lines-\(after-\(commas\|declarations\|procedures\)\|before-block-comments\)\)\>"
  38. syn match   indentOptions "\<--brace-indent\s*\d\+\>"
  39. syn match   indentOptions "\<--braces-\(after\|on\)-\(if\|struct-decl\)-line\>"
  40. syn match   indentOptions "\<--break-\(\(after\|before\)-boolean-operator\|function-decl-args\)\>"
  41. syn match   indentOptions "\<--\(case\(-brace\)\=\|comment\|continuation\|declaration\|line-comments\|parameter\|paren\|struct-brace\)-indentation\s*\d\+\>"
  42. syn match   indentOptions "\<--\(no-\)\=comment-delimiters-on-blank-lines\>"
  43. syn match   indentOptions "\<--\(dont-\)\=cuddle-\(do-while\|else\)\>"
  44. syn match   indentOptions "\<--\(declaration-comment\|else-endif\)-column\s*\d\+\>"
  45. syn match   indentOptions "\<--dont-break-\(function-decl-args\|procedure-type\)\>"
  46. syn match   indentOptions "\<--\(dont-\)\=\(format\(-first-column\)\=\|star\)-comments\>"
  47. syn match   indentOptions "\<--\(honour\|ignore\)-newlines\>"
  48. syn match   indentOptions "\<--\(indent-level\|\(comment-\)\=line-length\)\s*\d\+\>"
  49. syn match   indentOptions "\<--\(leave\|remove\)-preprocessor-space\>"
  50. "not 100%, since casts\= should always be cast if no- isn't given
  51. syn match   indentOptions "\<--\(no-\)\=space-after-\(parentheses\|casts\=\|for\|if\|while\)\>"
  52. syn match   indentOptions "\<--\(dont-\)\=space-special-semicolon\>"
  53. syn match   indentOptions "\<--\(leave\|swallow\)-optional-blank-lines\>"
  54. syn match   indentOptions "\<--tab-size\s*\d\+\>"
  55. syn match   indentOptions "\<--\(no\|use\)-tabs\>"
  56. syn keyword indentOptions --gnu-style --ignore-profile --k-and-r-style --original
  57. syn keyword indentOptions --preserve-mtime --no-verbosity --verbose --output-file
  58. syn keyword indentOptions --no-parameter-indentation --procnames-start-lines
  59. syn keyword indentOptions --standard-output --start-left-side-of-comments
  60. syn keyword indentOptions --space-after-procedure-calls
  61. " this also here since the gnu indent fellas aren't consistent. (ever read
  62. " the code to `indent'? you'll know what i mean if you have)
  63. syn match   indentOptions "\<-\(bli\|cbi\|cd\|ci\|cli\|c\|cp\|di\|d\|i\|ip\|l\|lc\|pi\|sbi\|ts\)\s*\d\+\>"
  64. syn match   indentOptions "\<-T\s\+\w\+\>"
  65. syn keyword indentOptions --format-all-comments --continue-at-parentheses --dont-line-up-parentheses
  66. syn keyword indentOptions --no-space-after-function-call-names
  67. syn keyword indentOptions -bad -bap -bbb -bbo -bc -bfda -bl -br -bs -nbs -cdb -cdw -ce -cs -dce -fc1 -fca
  68. syn keyword indentOptions -gnu -hnl -kr -lp -lps -nbad -nbap -nbbb -nbbo -nbc -nbfda -ncdb -ncdw -nprs
  69. syn keyword indentOptions -nce -ncs -nfc1 -nfca -nhnl -nip -nlp -nlps -npcs -npmt -npro -npsl -nsaf -nsai
  70. syn keyword indentOptions -nsaw -nsc -nsob -nss -nv -o -orig -pcs -pmt -prs -psl -saf -sai -saw -sc
  71. syn keyword indentOptions -sob -ss -st -v -version -bls -brs -ut -nut
  72.  
  73. if exists("indent_minlines")
  74.     let b:indent_minlines = indent_minlines
  75. else
  76.     let b:indent_minlines = 50
  77. endif
  78. exec "syn sync minlines=" . b:indent_minlines
  79.  
  80. " Define the default highlighting.
  81. " For version 5.7 and earlier: only when not done already
  82. " For version 5.8 and later: only when an item doesn't have highlighting yet
  83. if version >= 508 || !exists("did_indent_syn_inits")
  84.     if version < 508
  85.     let did_indent_syn_inits = 1
  86.     command -nargs=+ HiLink hi link <args>
  87.     else
  88.     command -nargs=+ HiLink hi def link <args>
  89.     endif
  90.  
  91.     HiLink indentError        Error
  92.     HiLink indentComment    Comment
  93.     HiLink indentTodo        Todo
  94.     HiLink indentOptions    Keyword
  95.     delcommand HiLink
  96. endif
  97.  
  98. let b:current_syntax = "indent"
  99.  
  100. "  vim: set sw=4 sts=4:
  101.