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