Dynamic tab solve - added if statem'
This commit is contained in:
parent
76327d17c6
commit
eb5f4946ad
@ -38,22 +38,22 @@ endsnippet
|
||||
snippet main "main() (main)"
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
return 0;
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
return 0;
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet for "for loop (for)"
|
||||
for (${2:i} = 0; $2 < ${1:count}; ${3:++$2})
|
||||
{
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet fori "for int loop (fori)"
|
||||
for (${4:int} ${2:i} = 0; $2 < ${1:count}; ${3:++$2})
|
||||
{
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
@ -64,10 +64,10 @@ endsnippet
|
||||
snippet once "Include header once only guard"
|
||||
#ifndef ${1:`!p
|
||||
if not snip.c:
|
||||
import random, string
|
||||
name = re.sub(r'[^A-Za-z0-9]+','_', snip.fn).upper()
|
||||
rand = ''.join(random.sample(string.ascii_letters+string.digits, 8))
|
||||
snip.rv = ('%s_%s' % (name,rand)).upper()
|
||||
import random, string
|
||||
name = re.sub(r'[^A-Za-z0-9]+','_', snip.fn).upper()
|
||||
rand = ''.join(random.sample(string.ascii_letters+string.digits, 8))
|
||||
snip.rv = ('%s_%s' % (name,rand)).upper()
|
||||
else:
|
||||
snip.rv = snip.c`}
|
||||
#define $1
|
||||
@ -84,13 +84,13 @@ endsnippet
|
||||
|
||||
snippet wh "while loop"
|
||||
while(${1:/* condition */}) {
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet do "do...while loop (do)"
|
||||
do {
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
} while(${1:/* condition */});
|
||||
endsnippet
|
||||
|
||||
@ -101,13 +101,13 @@ endsnippet
|
||||
snippet if "if .. (if)"
|
||||
if (${1:/* condition */})
|
||||
{
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet el "else .. (else)"
|
||||
else {
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
@ -132,22 +132,22 @@ endsnippet
|
||||
snippet ife "if .. else (ife)"
|
||||
if (${1:/* condition */})
|
||||
{
|
||||
${2:/* code */}
|
||||
${2:/* code */}
|
||||
}
|
||||
else
|
||||
{
|
||||
${3:/* else */}
|
||||
${3:/* else */}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet ifee "if .. else if .. else (ifee)"
|
||||
if (${1:/* condition */})
|
||||
{
|
||||
${2:/* code */}
|
||||
${2:/* code */}
|
||||
}
|
||||
else if (${3:/* condition */})
|
||||
{
|
||||
${4:/* else.i */}
|
||||
${4:/* else.i */}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -162,14 +162,14 @@ endsnippet
|
||||
snippet st "struct"
|
||||
struct ${1:`!p snip.rv = (snip.basename or "name") + "_t"`}
|
||||
{
|
||||
${0:/* data */}
|
||||
${0:/* data */}
|
||||
};
|
||||
endsnippet
|
||||
|
||||
snippet fun "function" b
|
||||
${1:void} ${2:function_name}(${3})
|
||||
{
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user