Skip to content

Instantly share code, notes, and snippets.

@maelvls
Last active December 14, 2015 04:08
Show Gist options
  • Save maelvls/5025582 to your computer and use it in GitHub Desktop.
Save maelvls/5025582 to your computer and use it in GitHub Desktop.
Some snippets I added to my "c.snippets". For snipMate (VIM)
## Brackets
# Because I wanted a convenient way to reproduce the Xcode behaviour when {-returning
snippet {
{
${1}
}
## Comments
# to make it easier to comment my work
snippet /*
/* ${1} */
# Comments 2
# A "flag" comment
snippet /*=
/* ============ ${1} ============ */
## while
# It was bound on the "wh" before, not really helpful when you have
# some identifiers having the same first two letters...
# Really convenient though with Supertab completing
snippet while
while (${1:/* condition */}) {
${2:/* code */}
}${3}
## Printf, scanf
# I renamed them both
snippet printf
printf("${1:%s}\n"${2});${3}
snippet scanf
scanf("${1:%d}",&${2});${3}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment