blob: 995f1da4641863d6e0dfb706cca3fc4b3748820d [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
57command -nargs=+ HiLink hi def link <args>
Bram Moolenaar437df8f2006-04-27 21:47:44 +000058
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020059HiLink bstComment Comment
60HiLink bstString String
61HiLink bstCommand PreProc
62HiLink bstBuiltIn Statement
63HiLink bstField Special
64HiLink bstNumber Number
65HiLink bstType Type
66HiLink bstIdentifier Identifier
67HiLink bstError Error
68delcommand HiLink
Bram Moolenaar437df8f2006-04-27 21:47:44 +000069
70let b:current_syntax = "bst"
71
72" vim:set ft=vim sts=4 sw=4: