My dotfiles. Period.

moin.vim 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. " Vim syntax file
  2. " Language: MoinMoin
  3. " Maintainer: Michael Lamertz <mike@perl-ronin.de>
  4. " Contributors: David O'Callaghan <david.ocallaghan@cs.tcd.ie>
  5. " Tony Garland <Tony.Garland@fluke.com>
  6. " Ingo Karkat <ingo@karkat.de>
  7. " Last Change: 27-Jan-2008
  8. " 27-Jan-2008 Incorporated syntax changes of MoinMoin 1.6; the
  9. " syntax version is configurable via g:moin_version (globally) or
  10. " b:moin_version (for the current buffer only).
  11. " Small BFs: 'elsif', 'did_acedb_...'.
  12. " 22-Aug-2007 Added moinEmbedded highlighting.
  13. " 08-May-2007 Added contains=@NoSpell for URLs, Email, pragmas and
  14. " (configurable via g:moin_spell_wikiwords) WikiWords.
  15. " Bugs: Parsing of mixed bold-italic not yet implemented
  16. " Tables not yet implemented
  17. if version < 600
  18. syntax clear
  19. elseif exists("b:current_syntax")
  20. finish
  21. endif
  22. function! s:GetMoinVersion()
  23. if exists('b:moin_version')
  24. return b:moin_version
  25. elseif exists('g:moin_version')
  26. return g:moin_version
  27. else
  28. return 999
  29. endif
  30. endfunction
  31. " headings
  32. syn match moinHeader /^\(=\{1,5}\).*\1$/
  33. " inline markup
  34. syn match moinItalic /\('\{2}\)[^']\+\1/
  35. syn match moinBold /\('\{3}\)[^']\+\1/
  36. syn match moinBoldItalic /\('\{5}\)[^']\+\1/
  37. syn match moinUnderline /\(_\{2}\).\{-}\1/
  38. syn match moinSubscript /\(,\{2}\).\{-}\1/
  39. syn match moinSuperscript /\(\^\).\{-}\1/
  40. syn match moinTypewriter /\(`\).\{-}\1/
  41. if s:GetMoinVersion() < 160
  42. syn match moinMacro /\[\{2}.\{-}\]\{2}/
  43. else
  44. syn match moinMacro /<\{2}.\{-}>\{2}/
  45. endif
  46. " Codeblocks
  47. syn region moinPreformatted start=/{{{/ end=/}}}/
  48. " Links
  49. if exists('g:moin_spell_wikiwords')
  50. syn match moinWikiWord /\(\w\+:\)\?\u[a-z0-9]\+\u[a-z0-9]\+\(\u[a-z0-9]\+\)*/
  51. syn match moinSubLink /\(\w\+\|\.\.\)\?\// nextgroup=moinWikiWord
  52. else
  53. syn match moinWikiWord /\(\w\+:\)\?\u[a-z0-9]\+\u[a-z0-9]\+\(\u[a-z0-9]\+\)*/ contains=@NoSpell
  54. syn match moinSubLink /\(\w\+\|\.\.\)\?\// nextgroup=moinWikiWord contains=@NoSpell
  55. endif
  56. syn match moinNormalURL /\w\+:\/\/\S\+/ contains=@NoSpell
  57. syn match moinEmail /\S\+@\S\+/ contains=@NoSpell
  58. if s:GetMoinVersion() < 160
  59. syn match moinBracketLink /\[[^[\]]\+\]/ contains=@NoSpell
  60. syn match moinEmbedded /attachment:\S\+/ contains=@NoSpell
  61. syn match moinEmbedded /inline:\S\+/ contains=@NoSpell
  62. else
  63. syn match moinBracketLink /\[\{2}.\{-}\]\{2}/ contains=@NoSpell
  64. syn match moinEmbedded /{\{2}[^{].\{-}}\{2}/ contains=@NoSpell
  65. endif
  66. " lists
  67. syn match moinBulletList /^\(\s\+\)\zs\*\ze\s/
  68. syn match moinNumberedList /^\(\s\+\)\zs1\.\ze\s/
  69. syn match moinAlphalist /^\(\s\+\)\zsa\.\ze\s/
  70. syn match moinRomanlist /^\(\s\+\)\zsi\.\ze\s/
  71. syn match moinBigromanlist /^\(\s\+\)\zsI\.\ze\s/
  72. syn match moinDescriptionlist /^\(\s\+\)\zs.\{-}::\ze\s/
  73. " rules
  74. syn match moinRule /^-\{4,}/
  75. " comments/pragmas
  76. syn match moinComment /^##.*$/
  77. syn match moinPragma /^#\w\+.*$/ contains=@NoSpell
  78. " variables
  79. syn match moinVariable /@\w\+@/
  80. " Define the default highlighting.
  81. " For version 5.7 and earlier: only when not done already
  82. " For version 5.8 and later: only when an item doesn't have highlighting yet
  83. if version >= 508 || !exists("did_moin_syn_inits")
  84. if version < 508
  85. let did_moin_syn_inits = 1
  86. command -nargs=+ HiLink hi link <args>
  87. else
  88. command -nargs=+ HiLink hi def link <args>
  89. endif
  90. HiLink moinHeader Function
  91. HiLink moinItalic Identifier
  92. HiLink moinBold Identifier
  93. HiLink moinBoldItalic Identifier
  94. HiLink moinUnderline Identifier
  95. HiLink moinSubscript Identifier
  96. HiLink moinSuperscript Identifier
  97. HiLink moinTypewriter Identifier
  98. HiLink moinMacro Define
  99. HiLink moinPragma Define
  100. HiLink moinEmbedded Include
  101. HiLink moinPreformatted String
  102. HiLink moinWikiWord Statement
  103. HiLink moinBracketLink Statement
  104. HiLink moinNormalURL Statement
  105. HiLink moinSubLink Statement
  106. HiLink moinInterLink Statement
  107. HiLink moinEmail Statement
  108. HiLink moinBulletList Type
  109. HiLink moinNumberedList Type
  110. HiLink moinAlphalist Type
  111. HiLink moinRomanlist Type
  112. HiLink moinBigromanlist Type
  113. HiLink moinDescriptionlist Type
  114. HiLink moinRule Special
  115. HiLink moinComment Comment
  116. HiLink moinVariable Macro
  117. delcommand HiLink
  118. endif
  119. let b:current_syntax = "moin"