aboutsummaryrefslogtreecommitdiff
path: root/vim/bundle/vim-snippets/snippets/c.snippets
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2016-06-30 16:11:56 +0200
committerKarel Kočí <cynerd@email.cz>2016-06-30 16:11:56 +0200
commit9931e0888b2419326ae10ebbfae532261c5c125f (patch)
tree7504be5daccbb7b7d1ea396754de47b11ed790e5 /vim/bundle/vim-snippets/snippets/c.snippets
parente573b3020c032400eed60b649a2cbf55266e6bb0 (diff)
downloadmyconfigs-9931e0888b2419326ae10ebbfae532261c5c125f.tar.gz
myconfigs-9931e0888b2419326ae10ebbfae532261c5c125f.tar.bz2
myconfigs-9931e0888b2419326ae10ebbfae532261c5c125f.zip
Fix submodules
Diffstat (limited to 'vim/bundle/vim-snippets/snippets/c.snippets')
m---------vim/bundle/vim-snippets0
-rw-r--r--vim/bundle/vim-snippets/snippets/c.snippets228
2 files changed, 0 insertions, 228 deletions
diff --git a/vim/bundle/vim-snippets b/vim/bundle/vim-snippets
new file mode 160000
+Subproject 15d7e5ec26ec93adee4051b6359be90a943aa38
diff --git a/vim/bundle/vim-snippets/snippets/c.snippets b/vim/bundle/vim-snippets/snippets/c.snippets
deleted file mode 100644
index f4745c2..0000000
--- a/vim/bundle/vim-snippets/snippets/c.snippets
+++ /dev/null
@@ -1,228 +0,0 @@
-## Main
-# main
-snippet main
- int main(int argc, const char *argv[])
- {
- ${0}
- return 0;
- }
-# main(void)
-snippet mainn
- int main(void)
- {
- ${0}
- return 0;
- }
-##
-## Preprocessor
-# #include <...>
-snippet inc
- #include <${1:stdio}.h>
-# #include "..."
-snippet Inc
- #include "${1:`vim_snippets#Filename("$1.h")`}"
-# ifndef...define...endif
-snippet ndef
- #ifndef $1
- #define ${1:SYMBOL} ${2:value}
- #endif /* ifndef $1 */
-# define
-snippet def
- #define
-# ifdef...endif
-snippet ifdef
- #ifdef ${1:FOO}
- ${2:#define }
- #endif
-# if
-snippet #if
- #if ${1:FOO}
- ${0}
- #endif
-# header include guard
-snippet once
- #ifndef ${1:`toupper(vim_snippets#Filename('$1_H', 'UNTITLED_H'))`}
-
- #define $1
-
- ${0}
-
- #endif /* end of include guard: $1 */
-##
-## Control Statements
-# if
-snippet if
- if (${1:true}) {
- ${0}
- }
-snippet ife
- if (${1:true}) {
- ${2}
- } else {
- ${0}
- }
-# else
-snippet el
- else {
- ${0}
- }
-# else if
-snippet elif
- else if (${1:true}) {
- ${0}
- }
-# ifi
-snippet ifi
- if (${1:true}) ${0};
-# ternary
-snippet t
- ${1:/* condition */} ? ${2:a} : ${3:b}
-# switch
-snippet switch
- switch (${1:/* variable */}) {
- case ${2:/* variable case */}:
- ${3}
- ${4:break;}${5}
- default:
- ${6}
- }
-# switch without default
-snippet switchndef
- switch (${1:/* variable */}) {
- case ${2:/* variable case */}:
- ${3}
- ${4:break;}${5}
- }
-# case
-snippet case
- case ${1:/* variable case */}:
- ${2}
- ${3:break;}
-snippet ret
- return ${0};
-##
-## Loops
-# for
-snippet for
- for (${2:i} = 0; $2 < ${1:count}; $2${3:++}) {
- ${4}
- }
-# for (custom)
-snippet forr
- for (${1:i} = ${2:0}; ${3:$1 < 10}; $1${4:++}) {
- ${5}
- }
-# while
-snippet wh
- while (${1:/* condition */}) {
- ${2}
- }
-# do... while
-snippet do
- do {
- ${2}
- } while (${1:/* condition */});
-##
-## Functions
-# function definition
-snippet fun
- ${1:void} ${2:function_name}(${3})
- {
- ${4}
- }
-# function declaration
-snippet fund
- ${1:void} ${2:function_name}(${3});
-##
-## Types
-# typedef
-snippet td
- typedef ${1:int} ${2:MyCustomType};
-# struct
-snippet st
- struct ${1:`vim_snippets#Filename('$1_t', 'name')`} {
- ${2:/* data */}
- }${3: /* optional variable list */};
-# typedef struct
-snippet tds
- typedef struct ${2:_$1 }{
- ${3:/* data */}
- } ${1:`vim_snippets#Filename('$1_t', 'name')`};
-
-snippet enum
- enum ${1:name} { ${0} };
-# typedef enum
-snippet tde
- typedef enum {
- ${1:/* data */}
- } ${2:foo};
-##
-## Input/Output
-# printf
-snippet pr
- printf("${1:%s}\n"${2});
-# fprintf (again, this isn't as nice as TextMate's version, but it works)
-snippet fpr
- fprintf(${1:stderr}, "${2:%s}\n"${3});
-# getopt
-snippet getopt
- int choice;
- while (1)
- {
- static struct option long_options[] =
- {
- /* Use flags like so:
- {"verbose", no_argument, &verbose_flag, 'V'}*/
- /* Argument styles: no_argument, required_argument, optional_argument */
- {"version", no_argument, 0, 'v'},
- {"help", no_argument, 0, 'h'},
- ${1}
- {0,0,0,0}
- };
-
- int option_index = 0;
-
- /* Argument parameters:
- no_argument: " "
- required_argument: ":"
- optional_argument: "::" */
-
- choice = getopt_long( argc, argv, "vh",
- long_options, &option_index);
-
- if (choice == -1)
- break;
-
- switch( choice )
- {
- case 'v':
- ${2}
- break;
-
- case 'h':
- ${3}
- break;
-
- case '?':
- /* getopt_long will have already printed an error */
- break;
-
- default:
- /* Not sure how to get here... */
- return EXIT_FAILURE;
- }
- }
-
- /* Deal with non-option arguments here */
- if ( optind < argc )
- {
- while ( optind < argc )
- {
- ${0}
- }
- }
-##
-## Miscellaneous
-# This is kind of convenient
-snippet .
- [${1}]