blob: 5ebef1646033e684a350a7e9594bb1ab75bc5011 [file] [log] [blame]
Bram Moolenaar437df8f2006-04-27 21:47:44 +00001" Vim syntax file
2" Language: BibTeX Bibliography Style
Bram Moolenaarc81e5e72007-05-05 18:24:42 +00003" Maintainer: Tim Pope <vimNOSPAM@tpope.info>
Bram Moolenaar437df8f2006-04-27 21:47:44 +00004" Filenames: *.bst
Bram Moolenaar5c736222010-01-06 20:54:52 +01005" $Id: bst.vim,v 1.2 2007/05/05 18:24:42 vimboss Exp $
Bram Moolenaar437df8f2006-04-27 21:47:44 +00006
Bram Moolenaar89bcfda2016-08-30 23:26:57 +02007" quit when a syntax file was already loaded
8if exists("b:current_syntax")
Bram Moolenaar437df8f2006-04-27 21:47:44 +00009 finish
10endif
11
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020012setlocal iskeyword=48-57,#,$,',.,A-Z,a-z
Bram Moolenaar437df8f2006-04-27 21:47:44 +000013
14syn case ignore
15
Bram Moolenaarc81e5e72007-05-05 18:24:42 +000016syn match bstString +"[^"]*\%("\|$\)+ contains=bstField,bstType,bstError
17" Highlight the last character of an unclosed string, but only when the cursor
18" is not beyond it (i.e., it is still being edited). Imperfect.
19syn match bstError '[^"]\%#\@!$' contained
20
Bram Moolenaar437df8f2006-04-27 21:47:44 +000021syn match bstNumber "#-\=\d\+\>"
22syn keyword bstNumber entry.max$ global.max$
23syn match bstComment "%.*"
24
25syn keyword bstCommand ENTRY FUNCTION INTEGERS MACRO STRINGS
26syn keyword bstCommand READ EXECUTE ITERATE REVERSE SORT
27syn match bstBuiltIn "\s[-<>=+*]\|\s:="
28syn keyword bstBuiltIn add.period$
29syn keyword bstBuiltIn call.type$ change.case$ chr.to.int$ cite$
30syn keyword bstBuiltIn duplicate$ empty$ format.name$
31syn keyword bstBuiltIn if$ int.to.chr$ int.to.str$
32syn keyword bstBuiltIn missing$
33syn keyword bstBuiltIn newline$ num.names$
34syn keyword bstBuiltIn pop$ preamble$ purify$ quote$
35syn keyword bstBuiltIn skip$ stack$ substring$ swap$
36syn keyword bstBuiltIn text.length$ text.prefix$ top$ type$
37syn keyword bstBuiltIn warning$ while$ width$ write$
38syn match bstIdentifier "'\k*"
39syn keyword bstType article book booklet conference
40syn keyword bstType inbook incollection inproceedings
41syn keyword bstType manual mastersthesis misc
42syn keyword bstType phdthesis proceedings
43syn keyword bstType techreport unpublished
44syn keyword bstField abbr address annote author
45syn keyword bstField booktitle chapter crossref comment
46syn keyword bstField edition editor
47syn keyword bstField howpublished institution journal key month
48syn keyword bstField note number
49syn keyword bstField organization
50syn keyword bstField pages publisher
51syn keyword bstField school series
52syn keyword bstField title type
53syn keyword bstField volume year
54
55" Define the default highlighting.
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020056" Only when an item doesn't have highlighting yet
Bram Moolenaar437df8f2006-04-27 21:47:44 +000057
Bram Moolenaarf37506f2016-08-31 22:22:10 +020058hi def link bstComment Comment
59hi def link bstString String
60hi def link bstCommand PreProc
61hi def link bstBuiltIn Statement
62hi def link bstField Special
63hi def link bstNumber Number
64hi def link bstType Type
65hi def link bstIdentifier Identifier
66hi def link bstError Error
Bram Moolenaar437df8f2006-04-27 21:47:44 +000067
68let b:current_syntax = "bst"
69
70" vim:set ft=vim sts=4 sw=4: