xref: /vim-8.2.3635/runtime/syntax/bst.vim (revision f37506f6)
1" Vim syntax file
2" Language:     BibTeX Bibliography Style
3" Maintainer:   Tim Pope <[email protected]>
4" Filenames:    *.bst
5" $Id: bst.vim,v 1.2 2007/05/05 18:24:42 vimboss Exp $
6
7" quit when a syntax file was already loaded
8if exists("b:current_syntax")
9    finish
10endif
11
12setlocal iskeyword=48-57,#,$,',.,A-Z,a-z
13
14syn case ignore
15
16syn 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
21syn 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.
56" Only when an item doesn't have highlighting yet
57
58hi 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
67
68let b:current_syntax = "bst"
69
70" vim:set ft=vim sts=4 sw=4:
71