Permalink
Browse files

Move language specific snippets from global to filetype entries

Having C language snippets as global is wrong, moved them to several
language positions.  This files low rate of change and lack of ML
interest in putting language specific snippets in it suggests that
it isn't worth fixing the repitition or moving snippets to filetype
files.
  • Loading branch information...
1 parent d090e7d commit e64628745e0f08d10827f696b093515d0af9d299 @elextr elextr committed Dec 11, 2011
Showing with 62 additions and 9 deletions.
  1. +62 −9 data/snippets.conf
View
@@ -19,13 +19,6 @@
# Default is used for all filetypes and keys can be overwritten by [filetype] sections
[Default]
-if=if (%cursor%)%block_cursor%
-else=else%block_cursor%
-for=for (i = 0; i < %cursor%; i++)%block_cursor%
-while=while (%cursor%)%block_cursor%
-do=do\n{\n\t%cursor%\n} while (%cursor%)\n%cursor%
-switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%%cursor%
-try=try%block%\ncatch (%cursor%)%block_cursor%
# special keys to be used in other snippets, cannot be used "standalone"
# can be used by %key%, e.g. %brace_open%
@@ -44,14 +37,76 @@ block_cursor=\n{\n\t%cursor%\n}\n%cursor%
[Keybindings]
#for=<Ctrl>7
+[C]
+if=if (%cursor%)%block_cursor%
+else=else%block_cursor%
+for=for (i = 0; i < %cursor%; i++)%block_cursor%
+while=while (%cursor%)%block_cursor%
+do=do\n{\n\t%cursor%\n} while (%cursor%)\n%cursor%
+switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%%cursor%
+
[C++]
+if=if (%cursor%)%block_cursor%
+else=else%block_cursor%
for=for (int i = 0; i < %cursor%; i++)%brace_open%\n%brace_close%
+while=while (%cursor%)%block_cursor%
+do=do\n{\n\t%cursor%\n} while (%cursor%)\n%cursor%
+switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%%cursor%
+try=try%block%\ncatch (%cursor%)%block_cursor%
[Java]
+if=if (%cursor%)%block_cursor%
+else=else%block_cursor%
for=for (int i = 0; i < %cursor%; i++)%brace_open%\n%brace_close%
+while=while (%cursor%)%block_cursor%
+do=do\n{\n\t%cursor%\n} while (%cursor%)\n%cursor%
+switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%%cursor%
+try=try%block%\ncatch (%cursor%)%block_cursor%
[PHP]
+if=if (%cursor%)%block_cursor%
+else=else%block_cursor%
for=for ($i = 0; $i < %cursor%; $i++)%brace_open%\n%brace_close%
+while=while (%cursor%)%block_cursor%
+do=do\n{\n\t%cursor%\n} while (%cursor%)\n%cursor%
+switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%%cursor%
+try=try%block%\ncatch (%cursor%)%block_cursor%
+
+[Javascript]
+if=if (%cursor%)%block_cursor%
+else=else%block_cursor%
+for=for (i = 0; i < %cursor%; i++)%block_cursor%
+while=while (%cursor%)%block_cursor%
+do=do\n{\n\t%cursor%\n} while (%cursor%)\n%cursor%
+switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%%cursor%
+try=try%block%\ncatch (%cursor%)%block_cursor%
+
+[C#]
+if=if (%cursor%)%block_cursor%
+else=else%block_cursor%
+for=for (i = 0; i < %cursor%; i++)%block_cursor%
+while=while (%cursor%)%block_cursor%
+do=do\n{\n\t%cursor%\n} while (%cursor%)\n%cursor%
+switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%%cursor%
+try=try%block%\ncatch (%cursor%)%block_cursor%
+
+[Vala]
+if=if (%cursor%)%block_cursor%
+else=else%block_cursor%
+for=for (i = 0; i < %cursor%; i++)%block_cursor%
+while=while (%cursor%)%block_cursor%
+do=do\n{\n\t%cursor%\n} while (%cursor%)\n%cursor%
+switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%%cursor%
+try=try%block%\ncatch (%cursor%)%block_cursor%
+
+[ActionScript]
+if=if (%cursor%)%block_cursor%
+else=else%block_cursor%
+for=for (i = 0; i < %cursor%; i++)%block_cursor%
+while=while (%cursor%)%block_cursor%
+do=do\n{\n\t%cursor%\n} while (%cursor%)\n%cursor%
+switch=switch (%cursor%)%brace_open%case %cursor%:\n\t\t%cursor%\n\t\tbreak;\n\tdefault:\n\t\t%cursor%\n%brace_close%%cursor%
+try=try%block%\ncatch (%cursor%)%block_cursor%
[Python]
for=for i in xrange(%cursor%):\n\t
@@ -69,8 +124,6 @@ iferr=iferr%block_cursor%fix%block%
monitor=monitor%block_cursor%handle%block%
[Haskell]
-# prevent completion of "do"-while-loops in Haskell
-do=
[HTML]
table=<table>\n\t<tr>\n\t\t<td>%cursor%</td>\n\t</tr>\n</table>

0 comments on commit e646287

Please sign in to comment.