home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 February / OpenLinux 2.3 CD.iso / live / usr / share / vim / syntax / objc.vim < prev    next >
Encoding:
Text File  |  1999-08-10  |  1.7 KB  |  57 lines

  1. " Vim syntax file
  2. " Language:    Objective C
  3. " Maintainer:    Valentino Kyriakides <1kyriaki@informatik.uni-hamburg.de>
  4. " Last change:    1997 May 2
  5.  
  6. " Read the C syntax to start with
  7. source <sfile>:p:h/c.vim
  8.  
  9. " Objective C extentions follow below
  10. "
  11. " NOTE: Objective C is abbreviated to ObjC/objc
  12. " and uses *.h, *.m as file extensions!
  13.  
  14.  
  15. " ObjC keywords, types, type qualifiers etc.
  16. syn keyword objcStatement    self super _cmd
  17. syn keyword objcType            id Class SEL IMP BOOL nil Nil
  18. syn keyword objcTypeModifier bycopy in out inout oneway
  19.  
  20. " Match the ObjC #import directive (like C's #include)
  21. syn region objcImported contained start=+"+  skip=+\\\\\|\\"+  end=+"+
  22. syn match  objcImported contained "<[^>]*>"
  23. syn match  objcImport  "^#[  ]*import\>[     ]*["<]" contains=objcImported
  24.  
  25. " Match the important ObjC directives
  26. syn match  objcScopeDecl "@public\|@private\|@protected"
  27. syn match  objcDirective    "@interface\|@implementation"
  28. syn match  objcDirective    "@class\|@end\|@defs"
  29. syn match  objcDirective    "@encode\|@protocol\|@selector"
  30.  
  31. " Match the ObjC method types
  32. "
  33. " NOTE: here I match only the indicators, this looks
  34. " much nicer and reduces cluttering color highlightings.
  35. " However, if you prefer full method declaration matching
  36. " append .* at the end of the next two patterns!
  37. "
  38. syn match objcInstMethod  "^[\t\s]*-[\s]*"
  39. syn match objcFactMethod  "^[\t\s]*+[\s]*"
  40.  
  41.  
  42. if !exists("did_objc_syntax_inits")
  43.   let did_objc_syntax_inits = 1
  44.   hi link objcImport    Include
  45.   hi link objcImported    cString
  46.   hi link objcType    Type
  47.   hi link objcScopeDecl    Statement
  48.   hi link objcInstMethod    Function
  49.   hi link objcFactMethod    Function
  50.   hi link objcStatement    Statement
  51.   hi link objcDirective    Statement
  52. endif
  53.  
  54. let b:current_syntax = "objc"
  55.  
  56. " vim: ts=8
  57.