blob: 23be8d22805924137535b1d92b7139720accd76f [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: "Robots.txt" files
3" Robots.txt files indicate to WWW robots which parts of a web site should not be accessed.
4" Maintainer: Dominique Stéphan (dominique@mggen.com)
5" URL: http://www.mggen.com/vim/syntax/robots.zip
6" Last change: 2001 May 09
7
Bram Moolenaar89bcfda2016-08-30 23:26:57 +02008" quit when a syntax file was already loaded
9if exists("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +000010 finish
11endif
12
13
14" shut case off
15syn case ignore
16
17" Comment
18syn match robotsComment "#.*$" contains=robotsUrl,robotsMail,robotsString
19
20" Star * (means all spiders)
21syn match robotsStar "\*"
22
23" :
24syn match robotsDelimiter ":"
25
26
27" The keywords
28" User-agent
29syn match robotsAgent "^[Uu][Ss][Ee][Rr]\-[Aa][Gg][Ee][Nn][Tt]"
30" Disallow
31syn match robotsDisallow "^[Dd][Ii][Ss][Aa][Ll][Ll][Oo][Ww]"
32
33" Disallow: or User-Agent: and the rest of the line before an eventual comment
34synt match robotsLine "\(^[Uu][Ss][Ee][Rr]\-[Aa][Gg][Ee][Nn][Tt]\|^[Dd][Ii][Ss][Aa][Ll][Ll][Oo][Ww]\):[^#]*" contains=robotsAgent,robotsDisallow,robotsStar,robotsDelimiter
35
36" Some frequent things in comments
37syn match robotsUrl "http[s]\=://\S*"
38syn match robotsMail "\S*@\S*"
39syn region robotsString start=+L\="+ skip=+\\\\\|\\"+ end=+"+
40
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020041command -nargs=+ HiLink hi def link <args>
Bram Moolenaar071d4272004-06-13 20:20:40 +000042
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020043HiLink robotsComment Comment
44HiLink robotsAgent Type
45HiLink robotsDisallow Statement
46HiLink robotsLine Special
47HiLink robotsStar Operator
48HiLink robotsDelimiter Delimiter
49HiLink robotsUrl String
50HiLink robotsMail String
51HiLink robotsString String
Bram Moolenaar071d4272004-06-13 20:20:40 +000052
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020053delcommand HiLink
Bram Moolenaar071d4272004-06-13 20:20:40 +000054
55
56let b:current_syntax = "robots"
57
58" vim: ts=8 sw=2
59