File: bib.vim

package info (click to toggle)
vim-rt 5.3-12
  • links: PTS
  • area: main
  • in suites: slink
  • size: 3,172 kB
  • ctags: 815
  • sloc: makefile: 857; awk: 778; ansic: 379; perl: 192; sh: 167
file content (61 lines) | stat: -rw-r--r-- 2,331 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
" Vim syntax file
" Language   : BibTeX (bibtex)
" Maintainer : Bernd Feige <feige@ukl.uni-freiburg.de>
" Last change: Aug 13, 1998

" Remove any old syntax stuff hanging around
syn clear

" Read the TeX syntax to start with
"source <sfile>:p:h/tex.vim

" Ignore case
syn case ignore

syn keyword bibEntryKw contained	crossref author title pages journal
syn keyword bibEntryKw contained	year month volume number month publisher 
syn keyword bibEntryKw contained	series edition editor key note
syn keyword bibEntryKw contained	booktitle chapter type howpublished
syn keyword bibEntryKw contained	organization institution school address
" Non-standard:
syn keyword bibEntryKw contained	abstract keywords annote isbn issn
syn match bibVariable contained	/[^= \t"{},]\+/
syn match bibVarSide oneline transparent contained	/=\s*[^= \t"{},]\+,\=\s*$/ contains=bibVariable
syn match bibVarLine oneline transparent "^\s*\S\+\s*=" contains=bibEntryKw,bibVarSide
syn match bibEntryLine oneline transparent /^\s*\S\+\s*=\s*[{"]/ contains=bibEntryKw

syn match bibCite	oneline	"\k\+:\d\{2,}\k*" 

syn match bibKey contained	"[{(]\s*[^ \t}]\+,"hs=s+1,he=e-1
syn keyword bibType contained	article book inbook booklet collection incollection
syn keyword bibType contained	proceedings inproceedings conference 
syn keyword bibType contained	manual mastersthesis phdthesis techreport 
syn keyword bibType contained	misc unpublished
syn region bibDataSetStart oneline start="^\s*@" end="$" contains=bibType,bibKey

syn keyword bibDefineKw contained	string
syn match bibVarDef contained	/{\s*[^= \t"{}]\+\s*=/hs=s+1,he=e-1
syn match bibDefineEntry oneline transparent	"^\s*@string\s*{[^=]\+=" contains=bibDefineKw,bibVarDef

syn match	bibUnescapedSpecial	"[^\\][%&]"hs=s+1
" A comment line starts with a % at the start of the line
syn match	bibComment	+^\s*%.*$+

if !exists("did_bibfile_syntax_inits")
  let did_bibfile_syntax_inits = 1
  " The default methods for highlighting.  Can be overridden later
  hi link bibString	String
  hi link bibEntryKw	Statement
  hi link bibType		Function
  hi link bibDefineKw	Function
  hi link bibCite		Number
  hi link bibKey		Number
  hi link bibVariable	Special
  hi link bibVarDef	Special
  hi link bibUnescapedSpecial	Error
  hi link bibComment	Comment
endif

let b:current_syntax = "bibfile"

" vim: ts=18