Added a syntax file by Timo Schmiade. Made sure all shipped files are recognized as snippets, even when ftdetect is not in /Users/sirver

This commit is contained in:
Holger Rapp 2011-02-17 14:07:27 +01:00
parent 3f7bfeec1b
commit c8fe2f4b02
23 changed files with 58 additions and 5 deletions

View File

@ -48,6 +48,4 @@ snippet lorem "Lorem Ipsum - 50 Words" b
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
endsnippet endsnippet
# vim:ft=snippets:

View File

@ -93,3 +93,4 @@ struct ${1:`!p snip.rv = (snip.basename or "name") + "_t"`}
}; };
endsnippet endsnippet
# vim:ft=snippets:

View File

@ -49,4 +49,4 @@ snippet tp "template <typename ..> (template)"
template <typename ${1:_InputIter}> template <typename ${1:_InputIter}>
endsnippet endsnippet
# vim:ft=snippets:

View File

@ -402,3 +402,4 @@ snippet z "z-index: index (z)"
z-index: $1;$0 z-index: $1;$0
endsnippet endsnippet
# vim:ft=snippets:

View File

@ -95,3 +95,4 @@ snippet undef "Undef Directive"
-undef (${1:macro}). -undef (${1:macro}).
endsnippet endsnippet
# vim:ft=snippets:

View File

@ -275,3 +275,5 @@ endsnippet
snippet lf "link_to_function" snippet lf "link_to_function"
`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to_function ${1:"${2:Greeting}"}, "${3:alert('Hello world!')}"$4`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` `!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to_function ${1:"${2:Greeting}"}, "${3:alert('Hello world!')}"$4`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
endsnippet endsnippet
# vim:ft=snippets:

View File

@ -27,3 +27,4 @@ ${1:SubSubsection}:`!p snip.rv = sec_title(snip, t)`
$0 $0
endsnippet endsnippet
# vim:ft=snippets:

View File

@ -247,3 +247,4 @@ snippet movie "Embed QT movie (movie)" b
</object> </object>
endsnippet endsnippet
# vim:ft=snippets:

View File

@ -209,3 +209,4 @@ while ($1)`!p nl(snip)`{
} }
endsnippet endsnippet
# vim:ft=snippets:

View File

@ -62,3 +62,4 @@ snippet timeout "setTimeout function"
setTimeout(function() {$0}${2:}, ${1:10}); setTimeout(function() {$0}${2:}, ${1:10});
endsnippet endsnippet
# vim:ft=snippets:

View File

@ -41,4 +41,4 @@ snippet img "Link to something"
![${1:pic alt}](${2:path}${3/.+/ "/}${3:opt title}${3/.+/"/})$0 ![${1:pic alt}](${2:path}${3/.+/ "/}${3:opt title}${3/.+/"/})$0
endsnippet endsnippet
# vim:ft=snippets:

View File

@ -267,3 +267,4 @@ snippet setprefs "Write to defaults (setprefs)"
[[NSUserDefaults standardUserDefaults] setObject:${1:object} forKey:${2:key}]; [[NSUserDefaults standardUserDefaults] setObject:${1:object} forKey:${2:key}];
endsnippet endsnippet
# vim:ft=snippets:

View File

@ -124,3 +124,4 @@ while ($1) {
endsnippet endsnippet
# vim:ft=snippets:

View File

@ -180,3 +180,4 @@ snippet ar "Assert raises" b
self.assertRaises(${1:exception}, ${2:func}${3/.+/, /}${3:arguments}) self.assertRaises(${1:exception}, ${2:func}${3/.+/, /}${3:arguments})
endsnippet endsnippet
# vim:ft=snippets:

View File

@ -892,3 +892,5 @@ setup do
$0 $0
end end
endsnippet endsnippet
# vim:ft=snippets:

View File

@ -43,3 +43,4 @@ snippet cb "Code Block" b
$0 $0
endsnippet endsnippet
# vim:ft=snippets:

View File

@ -68,3 +68,4 @@ while ${2:[[ ${1:condition} ]]}; do
done done
endsnippet endsnippet
# vim:ft=snippets:

View File

@ -10,3 +10,4 @@ $0
`!p snip.rv = "endsnippet"` `!p snip.rv = "endsnippet"`
endsnippet endsnippet
# vim:ft=snippets:

View File

@ -47,3 +47,4 @@ while {${1:condition}} {
endsnippet endsnippet
# vim:ft=snippets:

View File

@ -165,3 +165,4 @@ ${0}
% subparagraph $2 (end) % subparagraph $2 (end)
endsnippet endsnippet
# vim:ft=snippets:

View File

@ -55,3 +55,4 @@ else
endif endif
endsnippet endsnippet
# vim:ft=snippets:

View File

@ -702,6 +702,7 @@ Contributers are listed in chronological order:
Chris Chambers Chris Chambers
Ryan Wooden Ryan Wooden
rupa - Rupa Deadwyler rupa - Rupa Deadwyler
Timo Schmiade
7.2 Snippets *UltiSnips-contrisnippets* 7.2 Snippets *UltiSnips-contrisnippets*
------------ ------------

34
syntax/snippets.vim Normal file
View File

@ -0,0 +1,34 @@
" Syntax highlighting for snippet files (used for UltiSnips.vim)
" global matches
syn match snipComment "^#.*"
syn match snipString '"[^"]*"'
syn match snipTabsOnly "^\t\+$"
syn match snipKeyword "\<\(end\)\?\(snippet\|global\)\>" contained
" snippet definitions
syn match snipStart "^snippet.*" contained contains=snipKeyword,snipString
syn match snipEnd "^endsnippet" contained contains=snipKeyword
syn region snippet fold keepend start="^snippet" end="^endsnippet" contains=snipStart,snipEnd,snipTabsOnly
" global definitions
syn match snipGlobalStart "^global.*" contained contains=snipKeyword,snipString
syn match snipGlobalEnd "^endglobal" contained contains=snipKeyword
syn region snipGlobal fold keepend start="^global" end="^endglobal" contains=snipGlobalStart,snipGlobalEnd,snipTabsOnly
" highlighting rules
hi link snipComment Comment
hi link snipString String
hi link snipTabsOnly Error
hi link snipKeyword Keyword
hi link snipStart Statement
hi link snipEnd Statement
hi link snippet Normal
hi link snipGlobalStart Statement
hi link snipGlobalEnd Statement
hi link snipGlobal Normal