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 / bib.vim < prev    next >
Encoding:
Text File  |  1999-09-25  |  2.3 KB  |  56 lines  |  [TEXT/VIM!]

  1. " Vim syntax file
  2. " Language   : BibTeX (bibtex)
  3. " Maintainer : Bernd Feige <Bernd.Feige@gmx.net>
  4. " Last change: Aug 27, 1999
  5.  
  6. " Thanks go to David Squire <squire@cui.unige.ch> for the change to
  7. " discriminate between inside and outside of bib entries :-)
  8.  
  9. " Remove any old syntax stuff hanging around
  10. syn clear
  11.  
  12. " Ignore case
  13. syn case ignore
  14.  
  15. syn keyword bibType contained    article book booklet conference inbook
  16. syn keyword bibType contained    incollection inproceedings manual
  17. syn keyword bibType contained    mastersthesis misc phdthesis
  18. syn keyword bibType contained    proceedings techreport unpublished
  19. syn keyword bibType contained    string
  20.  
  21. syn keyword bibEntryKw contained    address annote author booktitle chapter
  22. syn keyword bibEntryKw contained    crossref edition editor howpublished
  23. syn keyword bibEntryKw contained    institution journal key month note
  24. syn keyword bibEntryKw contained    number organization pages publisher
  25. syn keyword bibEntryKw contained    school series title type volume year
  26. " Non-standard:
  27. syn keyword bibNSEntryKw contained    abstract isbn issn keywords url
  28.  
  29. syn match bibUnescapedSpecial contained /[^\\][%&]/hs=s+1
  30. syn match bibKey contained /\s*[^ \t}="]\+,/hs=s,he=e-1 nextgroup=bibField
  31. syn match bibVariable contained /[^{}," \t=\k]/
  32. syn region bibQuote contained start=/"/ end=/"/ skip=/\(\\"\)/ contains=bibUnescapedSpecial,bibBrace
  33. syn region bibBrace contained start=/{/ end=/}/ contains=bibUnescapedSpecial,bibBrace
  34. syn region bibField contained start=/\k\+\s*=\s*/ end=/[},]/me=e-1 contains=bibEntryKw,bibNSEntryKw,bibBrace,bibQuote,bibVariable
  35. syn region bibEntryData contained start=/[{(]/ms=e+1 end=/[})]/me=e-1 contains=bibKey,bibField
  36. syn region bibEntry start=/\@\k\+[{(]/ end=/[})]/ contains=bibType,bibEntryData nextgroup=bibEntry,bibComment
  37. syn region bibComment start=/^[^\@]/ end=/^\s*\@/me=e-1 nextgroup=bibEntry
  38.  
  39. syn sync match All grouphere bibEntry /^\s*\@/
  40. syn sync maxlines=200
  41. syn sync minlines=50
  42.  
  43. if !exists("did_bib_syntax_inits")
  44.   let did_bib_syntax_inits = 1
  45.   " The default methods for highlighting.  Can be overridden later
  46.   hi link bibType        Identifier
  47.   hi link bibEntryKw        Statement
  48.   hi link bibNSEntryKw        PreProc
  49.   hi link bibKey        Special
  50.   hi link bibVariable        Constant
  51.   hi link bibUnescapedSpecial    Error
  52.   hi link bibComment        Comment
  53. endif
  54.  
  55. let b:current_syntax = "bib"
  56.