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

  1. " Vim syntax file
  2. " Language   : BibTeX (bibtex)
  3. " Maintainer : Bernd Feige <feige@ukl.uni-freiburg.de>
  4. " Last change: Aug 13, 1998
  5.  
  6. " Remove any old syntax stuff hanging around
  7. syn clear
  8.  
  9. " Read the TeX syntax to start with
  10. "source <sfile>:p:h/tex.vim
  11.  
  12. " Ignore case
  13. syn case ignore
  14.  
  15. syn keyword bibEntryKw contained    crossref author title pages journal
  16. syn keyword bibEntryKw contained    year month volume number month publisher 
  17. syn keyword bibEntryKw contained    series edition editor key note
  18. syn keyword bibEntryKw contained    booktitle chapter type howpublished
  19. syn keyword bibEntryKw contained    organization institution school address
  20. " Non-standard:
  21. syn keyword bibEntryKw contained    abstract keywords annote isbn issn
  22. syn match bibVariable contained    /[^= \t"{},]\+/
  23. syn match bibVarSide oneline transparent contained    /=\s*[^= \t"{},]\+,\=\s*$/ contains=bibVariable
  24. syn match bibVarLine oneline transparent "^\s*\S\+\s*=" contains=bibEntryKw,bibVarSide
  25. syn match bibEntryLine oneline transparent /^\s*\S\+\s*=\s*[{"]/ contains=bibEntryKw
  26.  
  27. syn match bibCite    oneline    "\k\+:\d\{2,}\k*" 
  28.  
  29. syn match bibKey contained    "[{(]\s*[^ \t}]\+,"hs=s+1,he=e-1
  30. syn keyword bibType contained    article book inbook booklet collection incollection
  31. syn keyword bibType contained    proceedings inproceedings conference 
  32. syn keyword bibType contained    manual mastersthesis phdthesis techreport 
  33. syn keyword bibType contained    misc unpublished
  34. syn region bibDataSetStart oneline start="^\s*@" end="$" contains=bibType,bibKey
  35.  
  36. syn keyword bibDefineKw contained    string
  37. syn match bibVarDef contained    /{\s*[^= \t"{}]\+\s*=/hs=s+1,he=e-1
  38. syn match bibDefineEntry oneline transparent    "^\s*@string\s*{[^=]\+=" contains=bibDefineKw,bibVarDef
  39.  
  40. syn match    bibUnescapedSpecial    "[^\\][%&]"hs=s+1
  41. " A comment line starts with a % at the start of the line
  42. syn match    bibComment    +^\s*%.*$+
  43.  
  44. if !exists("did_bibfile_syntax_inits")
  45.   let did_bibfile_syntax_inits = 1
  46.   " The default methods for highlighting.  Can be overridden later
  47.   hi link bibString    String
  48.   hi link bibEntryKw    Statement
  49.   hi link bibType        Function
  50.   hi link bibDefineKw    Function
  51.   hi link bibCite        Number
  52.   hi link bibKey        Number
  53.   hi link bibVariable    Special
  54.   hi link bibVarDef    Special
  55.   hi link bibUnescapedSpecial    Error
  56.   hi link bibComment    Comment
  57. endif
  58.  
  59. let b:current_syntax = "bibfile"
  60.  
  61. " vim: ts=18
  62.