xref: /vim-8.2.3635/runtime/syntax/robots.vim (revision 818c9e7e)
1" 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 ([email protected])
5" URL: http://www.mggen.com/vim/syntax/robots.zip
6" Last change:	2001 May 09
7
8" For version 5.x: Clear all syntax items
9" For version 6.x: Quit when a syntax file was already loaded
10if version < 600
11    syntax clear
12elseif exists("b:current_syntax")
13    finish
14endif
15
16
17" shut case off
18syn case ignore
19
20" Comment
21syn match  robotsComment	"#.*$" contains=robotsUrl,robotsMail,robotsString
22
23" Star * (means all spiders)
24syn match  robotsStar		"\*"
25
26" :
27syn match  robotsDelimiter	":"
28
29
30" The keywords
31" User-agent
32syn match  robotsAgent		"^[Uu][Ss][Ee][Rr]\-[Aa][Gg][Ee][Nn][Tt]"
33" Disallow
34syn match  robotsDisallow	"^[Dd][Ii][Ss][Aa][Ll][Ll][Oo][Ww]"
35
36" Disallow: or User-Agent: and the rest of the line before an eventual comment
37synt match robotsLine		"\(^[Uu][Ss][Ee][Rr]\-[Aa][Gg][Ee][Nn][Tt]\|^[Dd][Ii][Ss][Aa][Ll][Ll][Oo][Ww]\):[^#]*"	contains=robotsAgent,robotsDisallow,robotsStar,robotsDelimiter
38
39" Some frequent things in comments
40syn match  robotsUrl		"http[s]\=://\S*"
41syn match  robotsMail		"\S*@\S*"
42syn region robotsString		start=+L\="+ skip=+\\\\\|\\"+ end=+"+
43
44if version >= 508 || !exists("did_robos_syntax_inits")
45  if version < 508
46    let did_robots_syntax_inits = 1
47    command -nargs=+ HiLink hi link <args>
48  else
49    command -nargs=+ HiLink hi def link <args>
50  endif
51
52  HiLink robotsComment		Comment
53  HiLink robotsAgent		Type
54  HiLink robotsDisallow		Statement
55  HiLink robotsLine		Special
56  HiLink robotsStar		Operator
57  HiLink robotsDelimiter	Delimiter
58  HiLink robotsUrl		String
59  HiLink robotsMail		String
60  HiLink robotsString		String
61
62  delcommand HiLink
63endif
64
65
66let b:current_syntax = "robots"
67
68" vim: ts=8 sw=2
69
70