1
0
mirror of https://github.com/gryf/snipmate.vim.git synced 2025-12-19 20:38:05 +01:00

updated some C snippets

This commit is contained in:
Michael Sanders
2009-04-05 10:57:32 -04:00
parent e0bb30b5f0
commit 58c76810be

View File

@@ -1,6 +1,6 @@
# main() # main()
snippet main snippet main
int main (int argc, char const* argv[]) int main(int argc, char const* argv[])
{ {
${1} ${1}
return 0; return 0;
@@ -12,10 +12,12 @@ snippet inc
snippet Inc snippet Inc
#include "${1:`Filename("$1.h")`}"${2} #include "${1:`Filename("$1.h")`}"${2}
# #ifndef ... #define ... #endif # #ifndef ... #define ... #endif
snippet def snippet Def
#ifndef $1 #ifndef $1
#define ${1:SYMBOL} ${2:value} #define ${1:SYMBOL} ${2:value}
#endif${3} #endif${3}
snippet def
#define
# Header Include-Guard # Header Include-Guard
# (the randomizer code is taken directly from TextMate; it could probably be # (the randomizer code is taken directly from TextMate; it could probably be
# cleaner, I don't know how to do it in vim script) # cleaner, I don't know how to do it in vim script)
@@ -56,12 +58,12 @@ snippet for
} }
# Custom For Loop # Custom For Loop
snippet forr snippet forr
for (${1:i} = 0; ${2:$1 < 10}; $1${3:++}) { for (${1:i} = ${2:0}; ${3:$1 < 10}; $1${4:++}) {
${4:/* code */} ${5:/* code */}
} }
# Function # Function
snippet fun snippet fun
${1:void} ${2:function_name} (${3}) ${1:void} ${2:function_name}(${3})
{ {
${4:/* code */} ${4:/* code */}
} }