c.snippets 514 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Switch statement
  2. snippet switch "switch statement" b
  3. switch(${1:var}){
  4. case ${2:condition}:
  5. ${3}
  6. ${4:break;}
  7. ${5}
  8. default:
  9. ${6}
  10. }$0
  11. endsnippet
  12. snippet case "add a case to a switch statment"
  13. case ${1:condition}:
  14. ${2}
  15. ${3:break;}
  16. ${0}
  17. endsnippet
  18. snippet if "if (cond){ ... }"
  19. if (${1:cond}){
  20. ${2}
  21. } ${0}
  22. endsnippet
  23. snippet ife "if (cond){ ... } else { ... }"
  24. if (${1:cond}){
  25. ${2}
  26. } else {
  27. ${3}
  28. } ${0}
  29. endsnippet
  30. snippet el "else { ... }"
  31. else {
  32. ${3}
  33. } ${0}
  34. endsnippet
  35. # vim: set ft=snippets: