aboutsummaryrefslogtreecommitdiff
path: root/files/.vim/syntax
diff options
context:
space:
mode:
Diffstat (limited to 'files/.vim/syntax')
-rwxr-xr-xfiles/.vim/syntax/asciidoc.vim166
-rwxr-xr-xfiles/.vim/syntax/python.vim13
-rwxr-xr-xfiles/.vim/syntax/rfc.vim30
-rwxr-xr-xfiles/.vim/syntax/scala.vim87
-rwxr-xr-xfiles/.vim/syntax/snippet.vim17
-rwxr-xr-xfiles/.vim/syntax/worklist.vim19
6 files changed, 332 insertions, 0 deletions
diff --git a/files/.vim/syntax/asciidoc.vim b/files/.vim/syntax/asciidoc.vim
new file mode 100755
index 0000000..a102e5a
--- /dev/null
+++ b/files/.vim/syntax/asciidoc.vim
@@ -0,0 +1,166 @@
+" Vim syntax file
+" Language: AsciiDoc
+" Author: Stuart Rackham <srackham@gmail.com> (inspired by Felix
+" Obenhuber's original asciidoc.vim script).
+" URL: http://www.methods.co.nz/asciidoc/
+" Licence: GPL (http://www.gnu.org)
+" Remarks: Vim 6 or greater
+" Limitations: See 'Appendix E: Vim Syntax Highlighter' in the AsciiDoc 'User
+" Guide'.
+
+if exists("b:current_syntax")
+ finish
+endif
+
+syn clear
+syn sync fromstart
+syn sync linebreaks=1
+
+" Run :help syn-priority to review syntax matching priority.
+syn keyword asciidocToDo TODO FIXME XXX ZZZ
+syn match asciidocBackslash /\\/
+syn region asciidocIdMarker start=/^\$Id:\s/ end=/\s\$$/
+syn match asciidocCallout /\\\@<!<\d\{1,2}>/
+syn match asciidocListBlockDelimiter /^--$/
+syn match asciidocLineBreak /[ \t]+$/
+syn match asciidocRuler /^'\{3,}$/
+syn match asciidocPagebreak /^<\{3,}$/
+syn match asciidocEntityRef /\\\@<!&[#a-zA-Z]\S\{-};/
+" The tricky part is not triggering on indented list items that are also
+" preceeded by blank line, handles only bulleted items (see 'Limitations' above
+" for workarounds).
+syn region asciidocLiteralParagraph start=/^\n[ \t]\+\(\([^-*. \t] \)\|\(\S\S\)\)/ end=/\(^+\?\s*$\)\@=/
+syn match asciidocURL /\\\@<!\<\(http\|https\|ftp\|file\|irc\):\/\/[^| \t]*\(\w\|\/\)/
+syn match asciidocEmail /\\\@<!\(\<\|<\)\w\(\w\|[.-]\)*@\(\w\|[.-]\)*\w>\?[0-9A-Za-z_]\@!/
+syn match asciidocAttributeRef /\\\@<!{\w\(\w\|-\)*\([=!@#$%?:].*\)\?}/
+syn match asciidocAdmonition /^\u\{3,15}:\(\s\+.*\)\@=/
+
+" As a damage control measure quoted patterns always terminate at a blank
+" line (see 'Limitations' above).
+syn match asciidocQuotedSubscript /\\\@<!\~\S\_.\{-}\(\~\|\n\s*\n\)/
+syn match asciidocQuotedSuperscript /\\\@<!\^\S\_.\{-}\(\^\|\n\s*\n\)/
+syn match asciidocQuotedMonospaced /\(^\|[| \t([.,=\]]\)\@<=+\([ )\n]\)\@!\_.\{-}\S\(+\([| \t)[\],.?!;:=]\|$\)\@=\|\n\s*\n\)/
+syn match asciidocQuotedMonospaced2 /\(^\|[| \t([.,=]\)\@<=`\([ )\n]\)\@!\_.\{-}\S\(`\([| \t)[\],.?!;:=]\|$\)\@=\|\n\s*\n\)/
+syn match asciidocQuotedUnconstrainedMonospaced /\\\@<!++\S\_.\{-}\(++\|\n\s*\n\)/
+syn match asciidocQuotedEmphasized /\(^\|[| \t([.,=\]]\)\@<=_\([ )\n]\)\@!\_.\{-}\S\(_\([| \t)[\],.?!;:=]\|$\)\@=\|\n\s*\n\)/
+syn match asciidocQuotedEmphasized2 /\(^\|[| \t([.,=\]]\)\@<='\([ )\n]\)\@!\_.\{-}\S\('\([| \t)[\],.?!;:=]\|$\)\@=\|\n\s*\n\)/
+syn match asciidocQuotedUnconstrainedEmphasized /\\\@<!__\S\_.\{-}\(__\|\n\s*\n\)/
+syn match asciidocQuotedBold /\(^\|[| \t([.,=\]]\)\@<=\*\([ )\n]\)\@!\_.\{-}\S\(\*\([| \t)[\],.?!;:=]\|$\)\@=\|\n\s*\n\)/
+syn match asciidocQuotedUnconstrainedBold /\\\@<!\*\*\S\_.\{-}\(\*\*\|\n\s*\n\)/
+"syn match asciidocQuotedSingleQuoted /\(^\|[| \t([.,=]\)\@<=`\([ )\n]\)\@!\_.\{-}\S\('\([| \t)[\],.?!;:=]\|$\)\@=\|\n\s*\n\)/
+" Don't allow ` in single quoted (a kludge to stop confusion with `monospaced`).
+syn match asciidocQuotedSingleQuoted /\(^\|[| \t([.,=]\)\@<=`\([ )\n]\)\@!\([^`]\|\n\)\{-}[^`\s]\('\([| \t)[\],.?!;:=]\|$\)\@=\|\n\s*\n\)/
+syn match asciidocQuotedDoubleQuoted /\(^\|[| \t([.,=]\)\@<=``\([ )\n]\)\@!\_.\{-}\S\(''\([| \t)[\],.?!;:=]\|$\)\@=\|\n\s*\n\)/
+
+syn match asciidocDoubleDollarPassthrough /\\\@<!\(^\|[^0-9a-zA-Z$]\)\@<=\$\$..\{-}\(\$\$\([^0-9a-zA-Z$]\|$\)\@=\|^$\)/
+syn match asciidocTriplePlusPassthrough /\\\@<!\(^\|[^0-9a-zA-Z$]\)\@<=+++..\{-}\(+++\([^0-9a-zA-Z$]\|$\)\@=\|^$\)/
+
+syn match asciidocListBullet /^\s*\zs\(-\|\*\{1,5}\)\ze\s/
+syn match asciidocListNumber /^\s*\zs\(\(\d\+\.\)\|\.\{1,5}\|\(\a\.\)\|\([ivxIVX]\+)\)\)\ze\s\+/
+
+syn region asciidocTable_OLD start=/^\([`.']\d*[-~_]*\)\+[-~_]\+\d*$/ end=/^$/
+syn match asciidocBlockTitle /^\.[^. \t].*[^-~_]$/ contains=asciidocQuoted.*,asciidocAttributeRef
+syn match asciidocOneLineTitle /^=\{1,5}\s\+\S.*$/ contains=asciidocQuoted.*,asciidocAttributeRef
+
+syn match asciidocTitleUnderline /[-=~^+]\{2,}$/ transparent contained contains=NONE
+syn match asciidocTwoLineTitle /^[^. +/].*[^.:]\n[-=~^+]\{2,}$/ contains=asciidocQuoted.*,asciidocAttributeRef,asciidocTitleUnderline
+
+syn match asciidocAttributeList /^\[[^[ \t].*\]$/
+syn match asciidocQuoteBlockDelimiter /^_\{4,}$/
+syn match asciidocExampleBlockDelimiter /^=\{4,}$/
+syn match asciidocSidebarDelimiter /^*\{4,}$/
+
+"See http://vimdoc.sourceforge.net/htmldoc/usr_44.html for excluding region
+"contents from highlighting.
+syn match asciidocTablePrefix /\(\S\@<!\(\([0-9.]\+\)\([*+]\)\)\?\([<\^>.]\{,3}\)\?\([a-z]\)\?\)\?|/ containedin=asciidocTableBlock contained
+syn region asciidocTableBlock matchgroup=asciidocTableDelimiter start=/^|=\{3,}$/ end=/^|=\{3,}$/ keepend contains=ALL
+syn match asciidocTablePrefix /\(\S\@<!\(\([0-9.]\+\)\([*+]\)\)\?\([<\^>.]\{,3}\)\?\([a-z]\)\?\)\?!/ containedin=asciidocTableBlock contained
+syn region asciidocTableBlock2 matchgroup=asciidocTableDelimiter2 start=/^!=\{3,}$/ end=/^!=\{3,}$/ keepend contains=ALL
+
+syn match asciidocListContinuation /^+$/
+syn region asciidocLiteralBlock start=/^\.\{4,}$/ end=/^\.\{4,}$/ contains=asciidocCallout keepend
+syn region asciidocOpenBlock start=/^-\{4,}$/ end=/^-\{4,}$/ contains=asciidocCallout keepend
+syn region asciidocCommentBlock start="^/\{4,}$" end="^/\{4,}$" contains=asciidocToDo
+syn region asciidocPassthroughBlock start="^+\{4,}$" end="^+\{4,}$"
+" Allowing leading \w characters in the filter delimiter is to accomodate
+" the pre version 8.2.7 syntax and may be removed in future releases.
+syn region asciidocFilterBlock start=/^\w*\~\{4,}$/ end=/^\w*\~\{4,}$/
+
+syn region asciidocMacroAttributes matchgroup=asciidocRefMacro start=/\\\@<!<<"\{-}\w\(\w\|-\)*"\?,\?/ end=/\(>>\)\|^$/ contains=asciidocQuoted.* keepend
+syn region asciidocMacroAttributes matchgroup=asciidocAnchorMacro start=/\\\@<!\[\{2}\(\w\|-\)\+,\?/ end=/\]\{2}/ keepend
+syn region asciidocMacroAttributes matchgroup=asciidocAnchorMacro start=/\\\@<!\[\{3}\(\w\|-\)\+/ end=/\]\{3}/ keepend
+syn region asciidocMacroAttributes matchgroup=asciidocMacro start=/[\\0-9a-zA-Z]\@<!\w\(\w\|-\)*:\S\{-}\[/ skip=/\\\]/ end=/\]\|^$/ contains=asciidocQuoted.* keepend
+syn region asciidocMacroAttributes matchgroup=asciidocIndexTerm start=/\\\@<!(\{2,3}/ end=/)\{2,3}/ contains=asciidocQuoted.* keepend
+syn region asciidocMacroAttributes matchgroup=asciidocAttributeMacro start=/\({\(\w\|-\)\+}\)\@<=\[/ skip=/\\\]/ end=/\]/ keepend
+
+syn match asciidocCommentLine "^//\([^/].*\|\)$" contains=asciidocToDo
+
+syn region asciidocVLabel start=/^\s*/ end=/\(::\|;;\)$/ oneline contains=asciidocQuoted.*,asciidocMacroAttributes keepend
+syn region asciidocHLabel start=/^\s*/ end=/\(::\|;;\)\(\s\+\|\\$\)/ oneline contains=asciidocQuoted.*,asciidocMacroAttributes keepend
+
+syn region asciidocAttributeEntry start=/^:\w/ end=/:\(\s\|$\)/ oneline
+
+highlight link asciidocMacroAttributes Label
+highlight link asciidocIdMarker Special
+highlight link asciidocDoubleDollarPassthrough Special
+highlight link asciidocTriplePlusPassthrough Special
+highlight link asciidocQuotedSubscript Type
+highlight link asciidocQuotedSuperscript Type
+highlight link asciidocOneLineTitle Title
+highlight link asciidocTwoLineTitle Title
+highlight link asciidocBlockTitle Title
+highlight link asciidocRefMacro Macro
+highlight link asciidocIndexTerm Macro
+highlight link asciidocMacro Macro
+highlight link asciidocAttributeMacro Macro
+highlight link asciidocAnchorMacro Macro
+highlight link asciidocEmail Macro
+highlight link asciidocListBullet Label
+highlight link asciidocListNumber Label
+highlight link asciidocVLabel Label
+highlight link asciidocHLabel Label
+highlight link asciidocTable_OLD Type
+highlight link asciidocTableDelimiter Label
+highlight link asciidocTableBlock NONE
+highlight link asciidocTablePrefix Label
+highlight link asciidocTableDelimiter2 Label
+highlight link asciidocTableBlock2 NONE
+highlight link asciidocTablePrefix2 Label
+highlight link asciidocListBlockDelimiter Label
+highlight link asciidocListContinuation Label
+highlight link asciidocLiteralParagraph Identifier
+highlight link asciidocQuoteBlockDelimiter Type
+highlight link asciidocExampleBlockDelimiter Type
+highlight link asciidocSidebarDelimiter Type
+highlight link asciidocLiteralBlock Identifier
+highlight link asciidocOpenBlock Identifier
+highlight link asciidocPassthroughBlock Identifier
+highlight link asciidocCommentBlock Comment
+highlight link asciidocFilterBlock Type
+highlight link asciidocQuotedBold Special
+highlight link asciidocQuotedUnconstrainedBold Special
+highlight link asciidocQuotedEmphasized Type
+highlight link asciidocQuotedEmphasized2 Type
+highlight link asciidocQuotedUnconstrainedEmphasized Type
+highlight link asciidocQuotedMonospaced Identifier
+highlight link asciidocQuotedMonospaced2 Identifier
+highlight link asciidocQuotedUnconstrainedMonospaced Identifier
+highlight link asciidocQuotedSingleQuoted Label
+highlight link asciidocQuotedDoubleQuoted Label
+highlight link asciidocToDo Todo
+highlight link asciidocCommentLine Comment
+highlight link asciidocAdmonition Special
+highlight link asciidocAttributeRef Special
+highlight link asciidocAttributeList Special
+highlight link asciidocAttributeEntry Special
+highlight link asciidocBackslash Special
+highlight link asciidocEntityRef Special
+highlight link asciidocCallout Label
+highlight link asciidocLineBreak Special
+highlight link asciidocRuler Type
+highlight link asciidocPagebreak Type
+highlight link asciidocURL Macro
+
+let b:current_syntax = "asciidoc"
+
+" vim: wrap et sw=2 sts=2:
diff --git a/files/.vim/syntax/python.vim b/files/.vim/syntax/python.vim
new file mode 100755
index 0000000..53da6ae
--- /dev/null
+++ b/files/.vim/syntax/python.vim
@@ -0,0 +1,13 @@
+let python_highlight_all = 1
+syn match pythonError "^\s*def\s\+\w\+(.*)\s*$" display
+syn match pythonError "^\s*class\s\+\w\+(.*)\s*$" display
+syn match pythonError "^\s*for\s.*[^:]$" display
+syn match pythonError "^\s*except\s*$" display
+syn match pythonError "^\s*finally\s*$" display
+syn match pythonError "^\s*try\s*$" display
+syn match pythonError "^\s*else\s*$" display
+syn match pythonError "^\s*else\s*[^:].*" display
+syn match pythonError "^\s*if\s.*[^\:]$" display
+syn match pythonError "^\s*except\s.*[^\:]$" display
+syn match pythonError "[;]$" display
+syn keyword pythonError do
diff --git a/files/.vim/syntax/rfc.vim b/files/.vim/syntax/rfc.vim
new file mode 100755
index 0000000..faa1466
--- /dev/null
+++ b/files/.vim/syntax/rfc.vim
@@ -0,0 +1,30 @@
+" Vim syntax file
+" Filetype: RFC
+" Author: lilydjwg <lilydjwg@gmail.con>
+" Last Change: 2010年1月16日
+
+syntax clear
+syntax case match
+
+syn match rfcTitle /^\v( \n)@<!\S.*$/
+syn match rfcTheTitle /^\v\s{7,40}\S.*$/
+syn match rfcRFCTitle /^\v( \n)@<=RFC.*$/
+syn match rfcRFC /.\@<=RFC\s\+[0-9]\+/
+syn match rfcNumber /\[\d\+\]/
+syn match rfcComment /^\S.*\ze\n /
+syn match rfcDots /\v\.+\ze\d+$/ contained
+" 允许换一次行;如果允许无限换行,会将后面的标题也高亮
+syn match rfcContents /^\v\s*\d.*(\n.*)?(\s|\.)\d+$/ contains=rfcDots
+syn keyword rfcNote NOTE note: Note: NOTE: Notes Notes: MUST NOT
+
+hi link rfcTitle Title
+hi link rfcTheTitle Type
+hi link rfcRFCTitle PreProc
+hi link rfcNote Todo
+hi link rfcRFC Number
+hi link rfcComment Comment
+hi link rfcNumber Number
+hi link rfcDots Comment
+hi link rfcContents Tag
+
+let b:current_syntax = "rfc"
diff --git a/files/.vim/syntax/scala.vim b/files/.vim/syntax/scala.vim
new file mode 100755
index 0000000..7f7d9e2
--- /dev/null
+++ b/files/.vim/syntax/scala.vim
@@ -0,0 +1,87 @@
+" Vim syntax file
+" Language: Scala
+" Version: 0.1
+" Maintainer: Raphael Haberer-Proust <raphael.haberer-proust at epfl.ch>
+" URL: http://diwww.epfl.ch/~haberer/syntax/scala.html
+" Last Change: 2004 April 18
+" Disclaimer: It's an absolut basic, very simple and by far not finished
+" syntax file! It only recognizes basic keywords and constructs like comments
+" any help is welcome
+
+" Remove any old syntax stuff
+syn clear
+
+" syntax highlighting for words that are not identifiers:
+" int unit double String Array byte short char long float
+syn keyword scalaExternal import package
+syn keyword scalaConditional if then else
+syn keyword scalaRepeat while for do
+syn keyword scalaType boolean int double byte short char long float
+syn keyword scalaType unit
+syn keyword scalaType val with type var yield
+
+syn keyword scalaStatement return
+syn keyword scalaBoolean true false
+syn keyword scalaConstant null
+syn keyword scalaTypedef this super
+syn keyword scalaLangClass String Array
+syn keyword scalaScopeDecl private protected override
+syn keyword scalaStorageClass abstract final sealed
+syn keyword scalaExceptions throw try catch finally
+syn keyword scalaClassDecl extends
+" TODO differentiate the keyword class from MyClass.class -> use a match here
+syn keyword scalaTypedef class
+syn keyword scalaTypedef case
+syn keyword scalaTypedef trait
+
+syn match scalaTypedef "\s*\<object\>"
+
+syn keyword scalaOperator new
+
+" same number definition as in java.vim
+syn match scalaNumber "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>"
+syn match scalaNumber "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="
+syn match scalaNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
+syn match scalaNumber "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>"
+
+syn region scalaString start=+"+ end=+"+
+
+" Functions
+" def [name] [(prototype)] {
+"
+syn match scalaFunction "\s*\<def\>"
+
+" Comments
+syn region scalaComment start="/\*" end="\*/"
+syn match scalaLineComment "//.*"
+
+
+if !exists("did_scala_syntax_inits")
+ let did_scala_syntax_inits = 1
+
+ " The default methods for highlighting. Can be overridden later
+ hi link scalaExternal Include
+ hi link scalaStatement Statement
+ hi link scalaConditional Conditional
+ hi link scalaRepeat Repeat
+ hi link scalaType Type
+ hi link scalaTypedef Typedef
+ hi link scalaBoolean Boolean
+ hi link scalaFunction Function
+ hi link scalaLangClass Constant
+ hi link scalaConstant Constant
+ hi link scalaScopeDecl scalaStorageClass
+ hi link scalaClassDecl scalaStorageClass
+ hi link scalaStorageClass StorageClass
+ hi link scalaExceptions Exception
+ hi link scalaOperator Operator
+ hi link scalaNumber Number
+ hi link scalaString String
+ hi link scalaComment Comment
+ hi link scalaLineComment Comment
+endif
+
+let b:current_syntax = "scala"
+
+" if you want to override default methods for highlighting
+"hi Conditional term=bold ctermfg=Cyan guifg=#80a0ff
diff --git a/files/.vim/syntax/snippet.vim b/files/.vim/syntax/snippet.vim
new file mode 100755
index 0000000..ea6042a
--- /dev/null
+++ b/files/.vim/syntax/snippet.vim
@@ -0,0 +1,17 @@
+" Syntax highlighting for snippet files (used for snipMate.vim)
+" Hopefully this should make snippets a bit nicer to write!
+syn match snipComment '^#.*'
+syn match placeHolder '\${\d\+\(:.\{-}\)\=}' contains=snipCommand
+syn match tabStop '\$\d\+'
+syn match snipCommand '`.\{-}`'
+syn match snippet '^snippet.*' transparent contains=multiSnipText,snipKeyword
+syn match multiSnipText '\w\+ \zs.*' contained
+syn match snipKeyword '^snippet'me=s+8 contained
+
+hi link snipComment Comment
+hi link multiSnipText String
+hi link snipKeyword Keyword
+hi link snipComment Comment
+hi link placeHolder Special
+hi link tabStop Special
+hi link snipCommand String
diff --git a/files/.vim/syntax/worklist.vim b/files/.vim/syntax/worklist.vim
new file mode 100755
index 0000000..f9b2017
--- /dev/null
+++ b/files/.vim/syntax/worklist.vim
@@ -0,0 +1,19 @@
+" Vim syntax file
+
+syntax clear
+syntax case match
+
+syn match worklistTag /\v\[\w+\]/
+" Statuses
+syn region worklistDone start=/\v^\-\s*\:DONE\:/ end=/\v^\s*$/
+syn region worklistBug start=/\v^\-\s*\:BUG\:/ end=/\v^\s*$/
+syn region worklistNew start=/\v^\-\s*\:NEW\:/ end=/\v^\s*$/
+syn region worklistLow start=/\v^\-\s*\:LOW\:/ end=/\v^\s*$/
+
+hi link worklistDone Ignore
+hi link worklistBug Error
+hi link worklistNew Todo
+hi link worklistLow Comment
+hi link worklistTag Tag
+
+let b:current_syntax = "worklist"