mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated vimrc
This commit is contained in:
@ -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
|
||||
@ -99,43 +97,18 @@ snippet fprintf "fprintf ..."
|
||||
fprintf(${1:stderr}, "${2:%s}\n"${2/([^%]|%%)*(%.)?.*/(?2:, :\);)/}$3${2/([^%]|%%)*(%.)?.*/(?2:\);)/}
|
||||
endsnippet
|
||||
|
||||
snippet if "if .. (if)"
|
||||
if (${1:/* condition */})
|
||||
{
|
||||
${VISUAL}${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet el "else .. (else)"
|
||||
else {
|
||||
${VISUAL}${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet eli "else if .. (eli)"
|
||||
else if (${1:/* condition */}) {
|
||||
${VISUAL}${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet ife "if .. else (ife)"
|
||||
if (${1:/* condition */})
|
||||
{
|
||||
${2}
|
||||
}
|
||||
else
|
||||
{
|
||||
${3:/* else */}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet printf "printf .. (printf)"
|
||||
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
|
||||
|
Reference in New Issue
Block a user