You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
547 lines
24 KiB
547 lines
24 KiB
The following patch adjust the RPM .spec syntax highlighting |
|
a little bit to better highlight OpenPKG RPM .spec files. |
|
|
|
Index: vim73/runtime/syntax/spec.vim |
|
--- vim73/runtime/syntax/spec.vim.orig 2005-01-04 10:46:51 +0100 |
|
+++ vim73/runtime/syntax/spec.vim 2007-05-12 20:11:23 +0200 |
|
@@ -83,7 +83,7 @@ |
|
|
|
"One line macros - valid in all ScriptAreas |
|
"tip: remember do include new items on specScriptArea's skip section |
|
-syn region specSectionMacroArea oneline matchgroup=specSectionMacro start='^%\(define\|patch\d*\|setup\|configure\|GNUconfigure\|find_lang\|makeinstall\|include\)\>' end='$' contains=specCommandOpts,specMacroIdentifier |
|
+syn region specSectionMacroArea oneline matchgroup=specSectionMacro start='^%\(option\|define\|undefine\|patch\d*\|setup\|configure\|GNUconfigure\|find_lang\|makeinstall\|include\)\>' end='$' contains=specCommandOpts,specMacroIdentifier |
|
syn region specSectionMacroBracketArea oneline matchgroup=specSectionMacro start='^%{\(configure\|GNUconfigure\|find_lang\|makeinstall\)}' end='$' contains=specCommandOpts,specMacroIdentifier |
|
|
|
"%% Files Section %% |
|
@@ -105,7 +105,7 @@ |
|
"%% PreAmble Section %% |
|
"Copyright and Serial were deprecated by License and Epoch |
|
syn region specPreAmbleDeprecated oneline matchgroup=specError start='^\(Copyright\|Serial\)' end='$' contains=specEmail,specURL,specURLMacro,specLicense,specColon,specVariables,specSpecialChar,specMacroIdentifier |
|
-syn region specPreAmble oneline matchgroup=specCommand start='^\(Prereq\|Summary\|Name\|Version\|Packager\|Requires\|Icon\|URL\|Source\d*\|Patch\d*\|Prefix\|Packager\|Group\|License\|Release\|BuildRoot\|Distribution\|Vendor\|Provides\|ExclusiveArch\|ExcludeArch\|ExclusiveOS\|Obsoletes\|BuildArch\|BuildArchitectures\|BuildRequires\|BuildConflicts\|BuildPreReq\|Conflicts\|AutoRequires\|AutoReq\|AutoReqProv\|AutoProv\|Epoch\)' end='$' contains=specEmail,specURL,specURLMacro,specLicense,specColon,specVariables,specSpecialChar,specMacroIdentifier |
|
+syn region specPreAmble oneline matchgroup=specCommand start='^\(Prereq\|Summary\|Name\|Version\|Packager\|Requires\|Icon\|URL\|Source\d*\|Patch\d*\|Prefix\|Packager\|Group\|License\|Release\|BuildRoot\|Distribution\|Class\|Vendor\|Provides\|ExclusiveArch\|ExcludeArch\|ExclusiveOS\|Obsoletes\|BuildArch\|BuildArchitectures\|BuildRequires\|BuildConflicts\|BuildPreReq\|Conflicts\|AutoRequires\|AutoReq\|AutoReqProv\|AutoProv\|Epoch\)' end='$' contains=specEmail,specURL,specURLMacro,specLicense,specColon,specVariables,specSpecialChar,specMacroIdentifier |
|
|
|
"%% Description Section %% |
|
syn region specDescriptionArea matchgroup=specSection start='^%description' end='^%'me=e-1 contains=specDescriptionOpts,specEmail,specURL,specNumber,specMacroIdentifier,specComment |
|
@@ -114,7 +114,7 @@ |
|
syn region specPackageArea matchgroup=specSection start='^%package' end='^%'me=e-1 contains=specPackageOpts,specPreAmble,specComment |
|
|
|
"%% Scripts Section %% |
|
-syn region specScriptArea matchgroup=specSection start='^%\(prep\|build\|install\|clean\|pre\|postun\|preun\|post\)\>' skip='^%{\|^%\(define\|patch\d*\|configure\|GNUconfigure\|setup\|find_lang\|makeinstall\)\>' end='^%'me=e-1 contains=specSpecialVariables,specVariables,@specCommands,specVariables,shDo,shFor,shCaseEsac,specNoNumberHilite,specCommandOpts,shComment,shIf,specSpecialChar,specMacroIdentifier,specSectionMacroArea,specSectionMacroBracketArea,shOperator,shQuote1,shQuote2 |
|
+syn region specScriptArea matchgroup=specSection start='^%\(track\|prep\|build\|install\|check\|clean\|pre\|postun\|preun\|post\|test\)\>' skip='^%{\|^%\(option\|define\|patch\d*\|configure\|GNUconfigure\|setup\|find_lang\|makeinstall\)\>' end='^%'me=e-1 contains=specSpecialVariables,specVariables,@specCommands,specVariables,shDo,shFor,shCaseEsac,specNoNumberHilite,specCommandOpts,shComment,shIf,specSpecialChar,specMacroIdentifier,specSectionMacroArea,specSectionMacroBracketArea,shOperator,shQuote1,shQuote2 |
|
|
|
"%% Changelog Section %% |
|
syn region specChangelogArea matchgroup=specSection start='^%changelog' end='^%'me=e-1 contains=specEmail,specURL,specWeekday,specMonth,specNumber,specComment,specLicense |
|
@@ -137,7 +137,7 @@ |
|
syn match shOperator contained '[><|!&;]\|[!=]=' |
|
syn region shDo transparent matchgroup=specBlock start="\<do\>" end="\<done\>" contains=ALLBUT,shFunction,shDoError,shCase,specPreAmble,@specListedFiles |
|
|
|
-syn region specIf matchgroup=specBlock start="%ifosf\|%ifos\|%ifnos\|%ifarch\|%ifnarch\|%else" end='%endif' contains=ALLBUT, specIfError, shCase |
|
+syn region specIf matchgroup=specBlock start="%if\|%ifosf\|%ifos\|%ifnos\|%ifarch\|%ifnarch\|%else" end='%endif' contains=ALLBUT, specIfError, shCase |
|
|
|
syn region shIf transparent matchgroup=specBlock start="\<if\>" end="\<fi\>" contains=ALLBUT,shFunction,shIfError,shCase,@specListedFiles |
|
|
|
@@ -151,7 +151,7 @@ |
|
syn sync match shDoSync groupthere shDo "\<done\>" |
|
syn sync match shIfSync grouphere shIf "\<if\>" |
|
syn sync match shIfSync groupthere shIf "\<fi\>" |
|
-syn sync match specIfSync grouphere specIf "%ifarch\|%ifos\|%ifnos" |
|
+syn sync match specIfSync grouphere specIf "%if\|%ifarch\|%ifos\|%ifnos" |
|
syn sync match specIfSync groupthere specIf "%endIf" |
|
syn sync match shForSync grouphere shFor "\<for\>" |
|
syn sync match shForSync groupthere shFor "\<in\>" |
|
|
|
----------------------------------------------------------------------------- |
|
|
|
Activate additional language files. |
|
|
|
Index: vim73/runtime/filetype.vim |
|
--- vim73/runtime/filetype.vim.orig 2008-08-03 21:38:46.000000000 +0200 |
|
+++ vim73/runtime/filetype.vim 2010-08-10 13:44:27.000000000 +0200 |
|
@@ -2258,6 +2258,12 @@ |
|
" Z80 assembler asz80 |
|
au BufNewFile,BufRead *.z8a setf z8a |
|
|
|
+" Scala |
|
+au BufNewFile,BufRead *.scala setf scala |
|
+ |
|
+" Markdown |
|
+au BufNewFile,BufRead *.mkd setf mkd |
|
+ |
|
augroup END |
|
|
|
|
|
----------------------------------------------------------------------------- |
|
|
|
Scala Language Support |
|
https://lampsvn.epfl.ch/trac/scala/browser/scala-tool-support/trunk/src/vim |
|
|
|
Index: vim73/runtime/indent/scala.vim |
|
--- /dev/null 2009-06-12 17:31:09 +0200 |
|
+++ vim73/runtime/indent/scala.vim 2009-06-12 17:31:04 +0200 |
|
@@ -0,0 +1,85 @@ |
|
+" Vim indent file |
|
+" Language : Scala (http://scala-lang.org/) |
|
+" Maintainer : Stefan Matthias Aust |
|
+" Last Change: 2006 Apr 13 |
|
+" Revision : $Id: vim.patch,v 1.10 2009/06/12 15:35:09 rse Exp $ |
|
+" $URL: http://lampsvn.epfl.ch/svn-repos/scala/scala-tool-support/trunk/src/vim/indent/scala.vim $ |
|
+ |
|
+if exists("b:did_indent") |
|
+ finish |
|
+endif |
|
+let b:did_indent = 1 |
|
+ |
|
+setlocal indentexpr=GetScalaIndent() |
|
+ |
|
+setlocal indentkeys=0{,0},0),!^F,<>>,<CR> |
|
+ |
|
+setlocal autoindent sw=2 et |
|
+ |
|
+if exists("*GetScalaIndent") |
|
+ finish |
|
+endif |
|
+ |
|
+function! CountParens(line) |
|
+ let line = substitute(a:line, '"\(.\|\\"\)*"', '', 'g') |
|
+ let open = substitute(line, '[^(]', '', 'g') |
|
+ let close = substitute(line, '[^)]', '', 'g') |
|
+ return strlen(open) - strlen(close) |
|
+endfunction |
|
+ |
|
+function! GetScalaIndent() |
|
+ " Find a non-blank line above the current line. |
|
+ let lnum = prevnonblank(v:lnum - 1) |
|
+ |
|
+ " Hit the start of the file, use zero indent. |
|
+ if lnum == 0 |
|
+ return 0 |
|
+ endif |
|
+ |
|
+ let ind = indent(lnum) |
|
+ let prevline = getline(lnum) |
|
+ |
|
+ "Indent html literals |
|
+ if prevline !~ '/>\s*$' && prevline =~ '^\s*<[a-zA-Z][^>]*>\s*$' |
|
+ return ind + &shiftwidth |
|
+ endif |
|
+ |
|
+ " Add a 'shiftwidth' after lines that start a block |
|
+ " If if, for or while end with ), this is a one-line block |
|
+ " If val, var, def end with =, this is a one-line block |
|
+ if prevline =~ '^\s*\<\(\(else\s\+\)\?if\|for\|while\|va[lr]\|def\)\>.*[)=]\s*$' |
|
+ \ || prevline =~ '^\s*\<else\>\s*$' |
|
+ \ || prevline =~ '{\s*$' |
|
+ let ind = ind + &shiftwidth |
|
+ endif |
|
+ |
|
+ " If parenthesis are unbalanced, indent or dedent |
|
+ let c = CountParens(prevline) |
|
+ echo c |
|
+ if c > 0 |
|
+ let ind = ind + &shiftwidth |
|
+ elseif c < 0 |
|
+ let ind = ind - &shiftwidth |
|
+ endif |
|
+ |
|
+ " Dedent after if, for, while and val, var, def without block |
|
+ let pprevline = getline(prevnonblank(lnum - 1)) |
|
+ if pprevline =~ '^\s*\<\(\(else\s\+\)\?if\|for\|while\|va[lr]\|def\)\>.*[)=]\s*$' |
|
+ \ || pprevline =~ '^\s*\<else\>\s*$' |
|
+ let ind = ind - &shiftwidth |
|
+ endif |
|
+ |
|
+ " Align 'for' clauses nicely |
|
+ if prevline =~ '^\s*\<for\> (.*;\s*$' |
|
+ let ind = ind - &shiftwidth + 5 |
|
+ endif |
|
+ |
|
+ " Subtract a 'shiftwidth' on '}' or html |
|
+ let thisline = getline(v:lnum) |
|
+ if thisline =~ '^\s*[})]' |
|
+ \ || thisline =~ '^\s*</[a-zA-Z][^>]*>' |
|
+ let ind = ind - &shiftwidth |
|
+ endif |
|
+ |
|
+ return ind |
|
+endfunction |
|
Index: vim73/runtime/syntax/scala.vim |
|
--- /dev/null 2009-06-12 17:31:09 +0200 |
|
+++ vim73/runtime/syntax/scala.vim 2009-06-12 17:31:04 +0200 |
|
@@ -0,0 +1,153 @@ |
|
+" Vim syntax file |
|
+" Language : Scala (http://scala-lang.org/) |
|
+" Maintainers: Stefan Matthias Aust, Julien Wetterwald |
|
+" Last Change: 2007 June 13 |
|
+" Revision : $Id: vim.patch,v 1.10 2009/06/12 15:35:09 rse Exp $ |
|
+" $URL: http://lampsvn.epfl.ch/svn-repos/scala/scala-tool-support/trunk/src/vim/syntax/scala.vim $ |
|
+ |
|
+if version < 600 |
|
+ syntax clear |
|
+elseif exists("b:current_syntax") |
|
+ finish |
|
+endif |
|
+ |
|
+syn case match |
|
+syn sync minlines=50 |
|
+ |
|
+" most Scala keywords |
|
+syn keyword scalaKeyword abstract case catch do else extends final finally for forSome if implicit lazy match new null override private protected requires return sealed super this throw try type while with yield |
|
+syn match scalaKeyword "=>" |
|
+syn match scalaKeyword "<-" |
|
+syn match scalaKeyword "\<_\>" |
|
+ |
|
+syn match scalaOperator ":\{2,\}" "this is not a type |
|
+ |
|
+" package and import statements |
|
+syn keyword scalaPackage package nextgroup=scalaFqn skipwhite |
|
+syn keyword scalaImport import nextgroup=scalaFqn skipwhite |
|
+syn match scalaFqn "\<[._$a-zA-Z0-9,]*" contained nextgroup=scalaFqnSet |
|
+syn region scalaFqnSet start="{" end="}" contained |
|
+ |
|
+" boolean literals |
|
+syn keyword scalaBoolean true false |
|
+ |
|
+" definitions |
|
+syn keyword scalaDef def nextgroup=scalaDefName skipwhite |
|
+syn keyword scalaVal val nextgroup=scalaValName skipwhite |
|
+syn keyword scalaVar var nextgroup=scalaVarName skipwhite |
|
+syn keyword scalaClass class nextgroup=scalaClassName skipwhite |
|
+syn keyword scalaObject object nextgroup=scalaClassName skipwhite |
|
+syn keyword scalaTrait trait nextgroup=scalaClassName skipwhite |
|
+syn match scalaDefName "[^ =:;([]\+" contained nextgroup=scalaDefSpecializer skipwhite |
|
+syn match scalaValName "[^ =:;([]\+" contained |
|
+syn match scalaVarName "[^ =:;([]\+" contained |
|
+syn match scalaClassName "[^ =:;(\[]\+" contained nextgroup=scalaClassSpecializer skipwhite |
|
+syn region scalaDefSpecializer start="\[" end="\]" contained contains=scalaDefSpecializer |
|
+syn region scalaClassSpecializer start="\[" end="\]" contained contains=scalaClassSpecializer |
|
+ |
|
+" type constructor (actually anything with an uppercase letter) |
|
+syn match scalaConstructor "\<[A-Z][_$a-zA-Z0-9]*\>" nextgroup=scalaConstructorSpecializer |
|
+syn region scalaConstructorSpecializer start="\[" end="\]" contained contains=scalaConstructorSpecializer |
|
+ |
|
+" method call |
|
+syn match scalaRoot "\<[a-zA-Z][_$a-zA-Z0-9]*\."me=e-1 |
|
+syn match scalaMethodCall "\.[a-z][_$a-zA-Z0-9]*"ms=s+1 |
|
+ |
|
+" type declarations in val/var/def |
|
+syn match scalaType ":\s*\(=>\s*\)\?[._$a-zA-Z0-9]\+\(\[[^]]*\]\+\)\?\(\s*\(<:\|>:\|#\|=>\)\s*[._$a-zA-Z0-9]\+\(\[[^]]*\]\+\)*\)*"ms=s+1 |
|
+ |
|
+" comments |
|
+syn match scalaTodo "[tT][oO][dD][oO]" contained |
|
+syn match scalaLineComment "//.*" contains=scalaTodo |
|
+syn region scalaComment start="/\*" end="\*/" contains=scalaTodo |
|
+syn case ignore |
|
+syn include @scalaHtml syntax/html.vim |
|
+unlet b:current_syntax |
|
+syn case match |
|
+syn region scalaDocComment start="/\*\*" end="\*/" contains=scalaDocTags,scalaTodo,@scalaHtml keepend |
|
+syn region scalaDocTags start="{@\(link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}" contained |
|
+syn match scalaDocTags "@[a-z]\+" contained |
|
+ |
|
+syn match scalaEmptyString "\"\"" |
|
+ |
|
+" multi-line string literals |
|
+syn region scalaMultiLineString start="\"\"\"" end="\"\"\"" contains=scalaUnicode |
|
+syn match scalaUnicode "\\u[0-9a-fA-F]\{4}" contained |
|
+ |
|
+" string literals with escapes |
|
+syn region scalaString start="\"[^"]" skip="\\\"" end="\"" contains=scalaStringEscape " TODO end \n or not? |
|
+syn match scalaStringEscape "\\u[0-9a-fA-F]\{4}" contained |
|
+syn match scalaStringEscape "\\[nrfvb\\\"]" contained |
|
+ |
|
+" symbol and character literals |
|
+syn match scalaSymbol "'[_a-zA-Z0-9][_a-zA-Z0-9]*\>" |
|
+syn match scalaChar "'[^'\\]'\|'\\.'\|'\\u[0-9a-fA-F]\{4}'" |
|
+ |
|
+" number literals |
|
+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]\>" |
|
+ |
|
+" xml literals |
|
+syn match scalaXmlTag "<[a-zA-Z]\_[^>]*/>" contains=scalaXmlQuote,scalaXmlEscape,scalaXmlString |
|
+syn region scalaXmlString start="\"" end="\"" contained |
|
+syn match scalaXmlStart "<[a-zA-Z]\_[^>]*>" contained contains=scalaXmlQuote,scalaXmlEscape,scalaXmlString |
|
+syn region scalaXml start="<\([a-zA-Z]\_[^>]*\_[^/]\|[a-zA-Z]\)>" matchgroup=scalaXmlStart end="</\_[^>]\+>" contains=scalaXmlEscape,scalaXmlQuote,scalaXml,scalaXmlStart,scalaXmlComment |
|
+syn region scalaXmlEscape matchgroup=scalaXmlEscapeSpecial start="{" matchgroup=scalaXmlEscapeSpecial end="}" contained contains=TOP |
|
+syn match scalaXmlQuote "&[^;]\+;" contained |
|
+syn match scalaXmlComment "<!--\_[^>]*-->" contained |
|
+ |
|
+syn sync fromstart |
|
+ |
|
+" map Scala groups to standard groups |
|
+hi link scalaKeyword Keyword |
|
+hi link scalaPackage Include |
|
+hi link scalaImport Include |
|
+hi link scalaBoolean Boolean |
|
+hi link scalaOperator Normal |
|
+hi link scalaNumber Number |
|
+hi link scalaEmptyString String |
|
+hi link scalaString String |
|
+hi link scalaChar String |
|
+hi link scalaMultiLineString String |
|
+hi link scalaStringEscape Special |
|
+hi link scalaSymbol Special |
|
+hi link scalaUnicode Special |
|
+hi link scalaComment Comment |
|
+hi link scalaLineComment Comment |
|
+hi link scalaDocComment Comment |
|
+hi link scalaDocTags Special |
|
+hi link scalaTodo Todo |
|
+hi link scalaType Type |
|
+hi link scalaTypeSpecializer scalaType |
|
+hi link scalaXml String |
|
+hi link scalaXmlTag Include |
|
+hi link scalaXmlString String |
|
+hi link scalaXmlStart Include |
|
+hi link scalaXmlEscape Normal |
|
+hi link scalaXmlEscapeSpecial Special |
|
+hi link scalaXmlQuote Special |
|
+hi link scalaXmlComment Comment |
|
+hi link scalaDef Keyword |
|
+hi link scalaVar Keyword |
|
+hi link scalaVal Keyword |
|
+hi link scalaClass Keyword |
|
+hi link scalaObject Keyword |
|
+hi link scalaTrait Keyword |
|
+hi link scalaDefName Function |
|
+hi link scalaDefSpecializer Function |
|
+hi link scalaClassName Special |
|
+hi link scalaClassSpecializer Special |
|
+hi link scalaConstructor Special |
|
+hi link scalaConstructorSpecializer scalaConstructor |
|
+ |
|
+let b:current_syntax = "scala" |
|
+ |
|
+" you might like to put these lines in your .vimrc |
|
+" |
|
+" customize colors a little bit (should be a different file) |
|
+" hi scalaNew gui=underline |
|
+" hi scalaMethodCall gui=italic |
|
+" hi scalaValName gui=underline |
|
+" hi scalaVarName gui=underline |
|
|
|
----------------------------------------------------------------------------- |
|
|
|
Markdown Language Support |
|
http://plasticboy.com/markdown-vim-mode/ |
|
http://github.com/plasticboy/vim-markdown/ |
|
|
|
Index: vim73/runtime/syntax/mkd.vim |
|
--- vim73/runtime/syntax/mkd.vim.orig 2010-08-10 12:57:36.000000000 +0200 |
|
+++ vim73/runtime/syntax/mkd.vim 2010-08-10 12:57:41.000000000 +0200 |
|
@@ -0,0 +1,104 @@ |
|
+" Vim syntax file |
|
+" Language: Markdown |
|
+" Maintainer: Ben Williams <benw@plasticboy.com> |
|
+" URL: http://plasticboy.com/markdown-vim-mode/ |
|
+" Version: 9 |
|
+" Last Change: 2009 May 18 |
|
+" Remark: Uses HTML syntax file |
|
+" Remark: I don't do anything with angle brackets (<>) because that would too easily |
|
+" easily conflict with HTML syntax |
|
+" TODO: Handle stuff contained within stuff (e.g. headings within blockquotes) |
|
+ |
|
+ |
|
+" Read the HTML syntax to start with |
|
+if version < 600 |
|
+ so <sfile>:p:h/html.vim |
|
+else |
|
+ runtime! syntax/html.vim |
|
+ unlet b:current_syntax |
|
+endif |
|
+ |
|
+if version < 600 |
|
+ syntax clear |
|
+elseif exists("b:current_syntax") |
|
+ finish |
|
+endif |
|
+ |
|
+" don't use standard HiLink, it will not work with included syntax files |
|
+if version < 508 |
|
+ command! -nargs=+ HtmlHiLink hi link <args> |
|
+else |
|
+ command! -nargs=+ HtmlHiLink hi def link <args> |
|
+endif |
|
+ |
|
+syn spell toplevel |
|
+syn case ignore |
|
+syn sync linebreaks=1 |
|
+ |
|
+"additions to HTML groups |
|
+" syn region htmlBold start=/\\\@<!\(^\|\A\)\@=\*\@<!\*\*\*\@!/ end=/\\\@<!\*\@<!\*\*\*\@!\($\|\A\)\@=/ contains=@Spell,htmlItalic |
|
+" syn region htmlItalic start=/\\\@<!\(^\|\A\)\@=\*\@<!\*\*\@!/ end=/\\\@<!\*\@<!\*\*\@!\($\|\A\)\@=/ contains=htmlBold,@Spell |
|
+" syn region htmlBold start=/\\\@<!\(^\|\A\)\@=_\@<!___\@!/ end=/\\\@<!_\@<!___\@!\($\|\A\)\@=/ contains=htmlItalic,@Spell |
|
+" syn region htmlItalic start=/\\\@<!\(^\|\A\)\@=_\@<!__\@!/ end=/\\\@<!_\@<!__\@!\($\|\A\)\@=/ contains=htmlBold,@Spell |
|
+ |
|
+" [link](URL) | [link][id] | [link][] |
|
+syn region mkdLink matchgroup=mkdDelimiter start="\!\?\[" end="\]\ze\s*[[(]" contains=@Spell nextgroup=mkdURL,mkdID skipwhite oneline |
|
+syn region mkdID matchgroup=mkdDelimiter start="\[" end="\]" contained |
|
+syn region mkdURL matchgroup=mkdDelimiter start="(" end=")" contained |
|
+ |
|
+" Link definitions: [id]: URL (Optional Title) |
|
+" TODO handle automatic links without colliding with htmlTag (<URL>) |
|
+syn region mkdLinkDef matchgroup=mkdDelimiter start="^ \{,3}\zs\[" end="]:" oneline nextgroup=mkdLinkDefTarget skipwhite |
|
+syn region mkdLinkDefTarget start="<\?\zs\S" excludenl end="\ze[>[:space:]\n]" contained nextgroup=mkdLinkTitle,mkdLinkDef skipwhite skipnl oneline |
|
+syn region mkdLinkTitle matchgroup=mkdDelimiter start=+"+ end=+"+ contained |
|
+syn region mkdLinkTitle matchgroup=mkdDelimiter start=+'+ end=+'+ contained |
|
+syn region mkdLinkTitle matchgroup=mkdDelimiter start=+(+ end=+)+ contained |
|
+ |
|
+"define Markdown groups |
|
+syn match mkdLineContinue ".$" contained |
|
+syn match mkdRule /^\s*\*\s\{0,1}\*\s\{0,1}\*$/ |
|
+syn match mkdRule /^\s*-\s\{0,1}-\s\{0,1}-$/ |
|
+syn match mkdRule /^\s*_\s\{0,1}_\s\{0,1}_$/ |
|
+syn match mkdRule /^\s*-\{3,}$/ |
|
+syn match mkdRule /^\s*\*\{3,5}$/ |
|
+syn match mkdListItem "^\s*[-*+]\s\+" |
|
+syn match mkdListItem "^\s*\d\+\.\s\+" |
|
+syn match mkdCode /^\s*\n\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/ |
|
+syn match mkdLineBreak / \+$/ |
|
+syn region mkdCode start=/\\\@<!`/ end=/\\\@<!`/ |
|
+syn region mkdCode start=/\s*``[^`]*/ end=/[^`]*``\s*/ |
|
+syn region mkdBlockquote start=/^\s*>/ end=/$/ contains=mkdLineBreak,mkdLineContinue,@Spell |
|
+syn region mkdCode start="<pre[^>]*>" end="</pre>" |
|
+syn region mkdCode start="<code[^>]*>" end="</code>" |
|
+ |
|
+"HTML headings |
|
+syn region htmlH1 start="^\s*#" end="\($\|#\+\)" contains=@Spell |
|
+syn region htmlH2 start="^\s*##" end="\($\|#\+\)" contains=@Spell |
|
+syn region htmlH3 start="^\s*###" end="\($\|#\+\)" contains=@Spell |
|
+syn region htmlH4 start="^\s*####" end="\($\|#\+\)" contains=@Spell |
|
+syn region htmlH5 start="^\s*#####" end="\($\|#\+\)" contains=@Spell |
|
+syn region htmlH6 start="^\s*######" end="\($\|#\+\)" contains=@Spell |
|
+syn match htmlH1 /^.\+\n=\+$/ contains=@Spell |
|
+syn match htmlH2 /^.\+\n-\+$/ contains=@Spell |
|
+ |
|
+"highlighting for Markdown groups |
|
+HtmlHiLink mkdString String |
|
+HtmlHiLink mkdCode String |
|
+HtmlHiLink mkdBlockquote Comment |
|
+HtmlHiLink mkdLineContinue Comment |
|
+HtmlHiLink mkdListItem Identifier |
|
+HtmlHiLink mkdRule Identifier |
|
+HtmlHiLink mkdLineBreak Todo |
|
+HtmlHiLink mkdLink htmlLink |
|
+HtmlHiLink mkdURL htmlString |
|
+HtmlHiLink mkdID Identifier |
|
+HtmlHiLink mkdLinkDef mkdID |
|
+HtmlHiLink mkdLinkDefTarget mkdURL |
|
+HtmlHiLink mkdLinkTitle htmlString |
|
+ |
|
+HtmlHiLink mkdDelimiter Delimiter |
|
+ |
|
+let b:current_syntax = "mkd" |
|
+ |
|
+delcommand HtmlHiLink |
|
+" vim: ts=8 |
|
|
|
----------------------------------------------------------------------------- |
|
|
|
SCSS Language Support |
|
http://scss-lang.com/ |
|
http://github.com/cakebaker/scss-syntax.vim/blob/master/syntax/scss.vim |
|
|
|
Index: vim73/runtime/syntax/scss.vim |
|
--- vim73/runtime/syntax/scss.vim.orig 2010-07-26 01:38:18.000000000 +0200 |
|
+++ vim73/runtime/syntax/scss.vim 2010-08-29 15:44:54.000000000 +0200 |
|
@@ -1,20 +1,87 @@ |
|
" Vim syntax file |
|
-" Language: SCSS |
|
-" Maintainer: Tim Pope <vimNOSPAM@tpope.org> |
|
-" Filenames: *.scss |
|
-" Last Change: 2010 Jul 26 |
|
+" Language: SCSS (Sassy CSS) |
|
+" Author: Daniel Hofstetter (daniel.hofstetter@42dh.com) |
|
+" Inspired by the syntax files for sass and css. Thanks to the authors of |
|
+" those files! |
|
|
|
if exists("b:current_syntax") |
|
finish |
|
endif |
|
|
|
-runtime! syntax/sass.vim |
|
+runtime! syntax/css.vim |
|
|
|
-syn match scssComment "//.*" contains=sassTodo,@Spell |
|
-syn region scssComment start="/\*" end="\*/" contains=sassTodo,@Spell |
|
+syn case ignore |
|
|
|
-hi def link scssComment sassComment |
|
+syn region scssDefinition transparent matchgroup=cssBraces start='{' end='}' contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssUrl,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,scssDefinition,scssComment,scssIdChar,scssClassChar,scssAmpersand,scssVariable,scssInclude,scssExtend,scssDebug,scssWarn,@scssControl,scssInterpolation,scssNestedSelector |
|
|
|
-let b:current_syntax = "scss" |
|
+syn region scssInterpolation start="#{" end="}" contains=scssVariable |
|
+ |
|
+syn match scssVariable "$[[:alnum:]_-]\+" nextgroup=scssVariableAssignment |
|
+syn match scssVariableAssignment ":" contained nextgroup=scssVariableValue |
|
+syn match scssVariableValue ".*;"me=e-1 contained contains=scssVariable,scssOperator,scssDefault "me=e-1 means that the last char of the pattern is not highlighted |
|
+syn match scssMixin "^@mixin" nextgroup=scssMixinName |
|
+syn match scssMixinName " [[:alnum:]_-]\+" contained nextgroup=scssDefinition |
|
+syn match scssInclude "@include" nextgroup=scssMixinName |
|
+syn match scssExtend "@extend .*[;}]"me=e-1 contains=cssTagName,scssIdChar,scssClassChar |
|
+ |
|
+syn match scssColor "#[0-9A-Fa-f]\{3\}\>" contained |
|
+syn match scssColor "#[0-9A-Fa-f]\{6\}\>" contained |
|
+ |
|
+syn match scssIdChar "#[[:alnum:]_-]\@=" nextgroup=scssId contains=scssColor |
|
+syn match scssId "[[:alnum:]_-]\+" contained |
|
+syn match scssClassChar "\.[[:alnum:]_-]\@=" nextgroup=scssClass |
|
+syn match scssClass "[[:alnum:]_-]\+" contained |
|
+syn match scssAmpersand "&" nextgroup=cssPseudoClass |
|
+ |
|
+syn match scssOperator "+" contained |
|
+syn match scssOperator "-" contained |
|
+syn match scssOperator "/" contained |
|
+syn match scssOperator "*" contained |
|
+ |
|
+syn match scssNestedSelector "[^/]* {"me=e-1 contained contains=cssTagName,scssIdChar,scssClassChar,scssAmpersand,scssVariable,scssMixin,@scssControl,scssInterpolation,scssNestedProperty |
|
+syn match scssNestedProperty "[[:alnum:]]\+:"me=e-1 contained |
|
+ |
|
+syn match scssDebug "@debug" |
|
+syn match scssWarn "@warn" |
|
+syn match scssDefault "!default" contained |
|
+ |
|
+syn match scssIf "@if" |
|
+syn match scssElse "@else" |
|
+syn match scssElseIf "@else if" |
|
+syn match scssWhile "@while" |
|
+syn match scssFor "@for" nextgroup=scssVariable |
|
+syn match scssFrom " from " |
|
+syn match scssTo " to " |
|
+syn match scssThrough " through " |
|
+syn cluster scssControl contains=scssIf,scssElse,scssElseIf,scssWhile,scssFor,scssFrom,scssTo,scssThrough |
|
+ |
|
+syn match scssComment "//.*$" contains=@Spell |
|
+ |
|
+hi def link scssVariable Identifier |
|
+hi def link scssVariableValue Constant |
|
+hi def link scssMixin PreProc |
|
+hi def link scssMixinName Function |
|
+hi def link scssInclude PreProc |
|
+hi def link scssExtend PreProc |
|
+hi def link scssComment Comment |
|
+hi def link scssColor Constant |
|
+hi def link scssIdChar Special |
|
+hi def link scssClassChar Special |
|
+hi def link scssId Identifier |
|
+hi def link scssClass Identifier |
|
+hi def link scssAmpersand Character |
|
+hi def link scssNestedProperty Type |
|
+hi def link scssDebug Debug |
|
+hi def link scssWarn Debug |
|
+hi def link scssDefault Special |
|
+hi def link scssIf Conditional |
|
+hi def link scssElse Conditional |
|
+hi def link scssElseIf Conditional |
|
+hi def link scssWhile Repeat |
|
+hi def link scssFor Repeat |
|
+hi def link scssFrom Repeat |
|
+hi def link scssTo Repeat |
|
+hi def link scssThrough Repeat |
|
+hi def link scssInterpolation Delimiter |
|
|
|
-" vim:set sw=2: |
|
+let b:current_syntax = "scss" |
|
|
|
|