Mercurial > vim
annotate runtime/syntax/robots.vim @ 18415:52eb1bbf7690
Added tag v8.1.2201 for changeset 6b8508ea90d798b96e29aaa21d6f8021c43128a7
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 23 Oct 2019 21:45:04 +0200 |
parents | 46763b01cd9a |
children | 5b7ea82bc18f |
rev | line source |
---|---|
7 | 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 (dominique@mggen.com) | |
5 " URL: http://www.mggen.com/vim/syntax/robots.zip | |
6 " Last change: 2001 May 09 | |
7 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
8 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
9 if exists("b:current_syntax") |
7 | 10 finish |
11 endif | |
12 | |
13 | |
14 " shut case off | |
15 syn case ignore | |
16 | |
17 " Comment | |
18 syn match robotsComment "#.*$" contains=robotsUrl,robotsMail,robotsString | |
19 | |
20 " Star * (means all spiders) | |
21 syn match robotsStar "\*" | |
22 | |
23 " : | |
24 syn match robotsDelimiter ":" | |
25 | |
26 | |
27 " The keywords | |
28 " User-agent | |
29 syn match robotsAgent "^[Uu][Ss][Ee][Rr]\-[Aa][Gg][Ee][Nn][Tt]" | |
30 " Disallow | |
31 syn 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 | |
34 synt 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 | |
37 syn match robotsUrl "http[s]\=://\S*" | |
38 syn match robotsMail "\S*@\S*" | |
39 syn region robotsString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ | |
40 | |
41 | |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
42 hi def link robotsComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
43 hi def link robotsAgent Type |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
44 hi def link robotsDisallow Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
45 hi def link robotsLine Special |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
46 hi def link robotsStar Operator |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
47 hi def link robotsDelimiter Delimiter |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
48 hi def link robotsUrl String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
49 hi def link robotsMail String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
50 hi def link robotsString String |
7 | 51 |
52 | |
53 | |
54 let b:current_syntax = "robots" | |
55 | |
56 " vim: ts=8 sw=2 | |
57 |