Merge pull request #562 from chavezgu/master
Change for, if, else, and struct to K&R style.
This commit is contained in:
commit
4aa9337127
@ -46,15 +46,13 @@ int main(int argc, char *argv[])
|
||||
endsnippet
|
||||
|
||||
snippet for "for loop (for)"
|
||||
for (${2:i} = 0; $2 < ${1:count}; ${3:++$2})
|
||||
{
|
||||
for (${2:i} = 0; $2 < ${1:count}; ${3:++$2}) {
|
||||
${VISUAL}${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet fori "for int loop (fori)"
|
||||
for (${4:int} ${2:i} = 0; $2 < ${1:count}; ${3:++$2})
|
||||
{
|
||||
for (${4:int} ${2:i} = 0; $2 < ${1:count}; ${3:++$2}) {
|
||||
${VISUAL}${0}
|
||||
}
|
||||
endsnippet
|
||||
@ -100,8 +98,7 @@ fprintf(${1:stderr}, "${2:%s}\n"${2/([^%]|%%)*(%.)?.*/(?2:, :\);)/}$3${2/([^%]|%
|
||||
endsnippet
|
||||
|
||||
snippet if "if .. (if)"
|
||||
if (${1:/* condition */})
|
||||
{
|
||||
if (${1:/* condition */}) {
|
||||
${VISUAL}${0}
|
||||
}
|
||||
endsnippet
|
||||
@ -119,12 +116,9 @@ else if (${1:/* condition */}) {
|
||||
endsnippet
|
||||
|
||||
snippet ife "if .. else (ife)"
|
||||
if (${1:/* condition */})
|
||||
{
|
||||
if (${1:/* condition */}) {
|
||||
${2}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
${3:/* else */}
|
||||
}
|
||||
endsnippet
|
||||
@ -134,8 +128,7 @@ printf("${1:%s}\n"${1/([^%]|%%)*(%.)?.*/(?2:, :\);)/}$2${1/([^%]|%%)*(%.)?.*/(?2
|
||||
endsnippet
|
||||
|
||||
snippet st "struct"
|
||||
struct ${1:`!p snip.rv = (snip.basename or "name") + "_t"`}
|
||||
{
|
||||
struct ${1:`!p snip.rv = (snip.basename or "name") + "_t"`} {
|
||||
${0:/* data */}
|
||||
};
|
||||
endsnippet
|
||||
|
Loading…
Reference in New Issue
Block a user