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 / mac / vim55rt.sit / runtime / syntax / pod.vim < prev    next >
Encoding:
Text File  |  1999-09-25  |  2.1 KB  |  66 lines  |  [TEXT/VIM!]

  1. " Vim syntax file
  2. " Language:    Perl POD format
  3. " Maintainer:    Scott Bigham <dsb@cs.duke.edu>
  4. " Last change:    1999 Jul 03
  5.  
  6. " To add embedded POD documentation highlighting to your syntax file, add
  7. " the commands:
  8. "
  9. "   syn include @Pod <sfile>:p:h/pod.vim
  10. "   syn region myPOD start="^=pod" start="^=head" end="^=cut" keepend contained contains=@Pod
  11. "
  12. " and add myPod to the contains= list of some existing region, probably a
  13. " comment.  The "keepend" flag is needed because "=cut" is matched as a
  14. " pattern in its own right.
  15.  
  16.  
  17. " Remove any old syntax stuff hanging around (this is suppressed
  18. " automatically by ":syn include" if necessary).
  19. syn clear
  20.  
  21. " POD commands
  22. syn match podCommand    "^=head[12]"    nextgroup=podCmdText
  23. syn match podCommand    "^=item"    nextgroup=podCmdText
  24. syn match podCommand    "^=over"    nextgroup=podOverIndent skipwhite
  25. syn match podCommand    "^=back"
  26. syn match podCommand    "^=cut"
  27. syn match podCommand    "^=pod"
  28. syn match podCommand    "^=for"        nextgroup=podForKeywd skipwhite
  29. syn match podCommand    "^=begin"    nextgroup=podForKeywd skipwhite
  30. syn match podCommand    "^=end"        nextgroup=podForKeywd skipwhite
  31.  
  32. " Text of a =head1, =head2 or =item command
  33. syn match podCmdText    ".*$" contained contains=podFormat
  34.  
  35. " Indent amount of =over command
  36. syn match podOverIndent    "\d\+" contained
  37.  
  38. " Formatter identifier keyword for =for, =begin and =end commands
  39. syn match podForKeywd    "\S\+" contained
  40.  
  41. " An indented line, to be displayed verbatim
  42. syn match podVerbatimLine    "^\s.*$"
  43.  
  44. " Inline textual items handled specially by POD
  45. syn match podSpecial    "\(\<\|&\)\I\i*\(::\I\i*\)*([^)]*)"
  46. syn match podSpecial    "[$@%]\I\i*\(::\I\i*\)*\>"
  47.  
  48. " Special formatting sequences
  49. syn region podFormat    start="[IBSCLFXEZ]<" end=">" oneline contains=podFormat
  50.  
  51. if !exists("did_pod_syntax_inits")
  52.   let did_pod_syntax_inits = 1
  53.   " The default methods for highlighting.  Can be overridden later.
  54.   hi link podCommand        Statement
  55.   hi link podCmdText        String
  56.   hi link podOverIndent        Number
  57.   hi link podForKeywd        Identifier
  58.   hi link podFormat        Identifier
  59.   hi link podVerbatimLine    PreProc
  60.   hi link podSpecial        Identifier
  61. endif
  62.  
  63. let b:current_syntax = "pod"
  64.  
  65. " vim: ts=8
  66.