1
0
mirror of https://github.com/amix/vimrc synced 2025-06-17 10:55:00 +08:00

Forgot to check in the rest of the updated plugins :/

This commit is contained in:
Amir
2022-09-20 10:08:31 +02:00
parent c6ba5aa440
commit 3978f7b467
77 changed files with 630 additions and 371 deletions

View File

@ -4,23 +4,23 @@ snippet main
int main(int argc, char *argv[])
{
${0}
return 0;
}
# main(void)
snippet mainn
int main(void)
{
${0}
return 0;
}
##
## Preprocessor
# #include <...>
snippet inc
#include <${1:stdio}.h>
$0
# #include "..."
snippet Inc
#include "${1:`vim_snippets#Filename("$1.h")`}"
$0
# ifndef...define...endif
snippet ndef
#ifndef $1
@ -86,8 +86,8 @@ snippet elif
snippet ifi
if (${1:true}) ${0};
# ternary
snippet t
${1:/* condition */} ? ${2:a} : ${3:b}
snippet t Ternary: `condition ? true : false`
$1 ? $2 : $0
# switch
snippet switch
switch (${1:/* variable */}) {
@ -111,6 +111,8 @@ snippet case
${3:break;}
snippet ret
return ${0};
snippet ex
exit($0);
##
## Loops
# for
@ -125,14 +127,18 @@ snippet forr
}
# while
snippet wh
while (${1:/* condition */}) {
while (${1:1}) {
${0:${VISUAL}}
}
snippet wht
while (true) {
${0:${VISUAL}}
}
# do... while
snippet do
do {
${0:${VISUAL}}
} while (${1:/* condition */});
} while ($1);
##
## Functions
# function definition
@ -277,6 +283,14 @@ snippet prf
printf("${1:} = %f\n", $1);
snippet prx
printf("${1:} = %${2}\n", $1);
snippet warn
warn("${1:%s}"$0);
snippet warnx
warnx("${1:%s}"$0);
snippet err
err(${1:1}, "${2:%s}"$0);
snippet errx
errx(${1:1}, "${2:%s}"$0);
# getopt
snippet getopt
int choice;
@ -337,7 +351,7 @@ snippet getopt
## Assertions
snippet asr
assert(${1:condition});
assert($1);
snippet anl
assert(${1:ptr} != NULL);