robots.vim 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. " quit when a syntax file was already loaded
  8. if exists("b:current_syntax")
  9. finish
  10. endif
  11. " shut case off
  12. syn case ignore
  13. " Comment
  14. syn match robotsComment "#.*$" contains=robotsUrl,robotsMail,robotsString
  15. " Star * (means all spiders)
  16. syn match robotsStar "\*"
  17. " :
  18. syn match robotsDelimiter ":"
  19. " The keywords
  20. " User-agent
  21. syn match robotsAgent "^[Uu][Ss][Ee][Rr]\-[Aa][Gg][Ee][Nn][Tt]"
  22. " Disallow
  23. syn match robotsDisallow "^[Dd][Ii][Ss][Aa][Ll][Ll][Oo][Ww]"
  24. " Disallow: or User-Agent: and the rest of the line before an eventual comment
  25. 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
  26. " Some frequent things in comments
  27. syn match robotsUrl "http[s]\=://\S*"
  28. syn match robotsMail "\S*@\S*"
  29. syn region robotsString start=+L\="+ skip=+\\\\\|\\"+ end=+"+
  30. hi def link robotsComment Comment
  31. hi def link robotsAgent Type
  32. hi def link robotsDisallow Statement
  33. hi def link robotsLine Special
  34. hi def link robotsStar Operator
  35. hi def link robotsDelimiter Delimiter
  36. hi def link robotsUrl String
  37. hi def link robotsMail String
  38. hi def link robotsString String
  39. let b:current_syntax = "robots"
  40. " vim: ts=8 sw=2