From 28ce3bb6f4ac2048366a88746000e91e2388942b Mon Sep 17 00:00:00 2001 From: Jack Stalnaker Date: Thu, 18 Oct 2012 16:27:02 -0500 Subject: [PATCH] added switch, switch with no default, and case snippets to c snippets --- snippets/c.snippets | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/snippets/c.snippets b/snippets/c.snippets index 35c87be..72ce3d0 100644 --- a/snippets/c.snippets +++ b/snippets/c.snippets @@ -68,6 +68,27 @@ snippet elif # ternary snippet t ${1:/* condition */} ? ${2:a} : ${3:b} +# switch +snippet switch + switch (${1:/* variable */}) { + case ${2:/* variable case */}: + ${3} + ${4:break;}${5} + default: + ${6} + }${7} +# switch without default +snippet switchndef + switch (${1:/* variable */}) { + case ${2:/* variable case */}: + ${3} + ${4:break;}${5} + }${6} +# case +snippet case + case ${1:/* variable case */}: + ${2} + ${3:break;}${4} ## ## Loops # for