aboutsummaryrefslogtreecommitdiffstats
path: root/.vim/snippets/c.snippets
diff options
context:
space:
mode:
authorkatherine <ageha@airen-no-jikken.icu>2023-03-01 01:44:48 -0700
committerkatherine <ageha@airen-no-jikken.icu>2023-03-01 01:44:48 -0700
commit47adae6d2e9ea0bc7cdbb43facab071b80be7816 (patch)
tree981cd653205c23b1e32b9e875290eccb2a5a2cb8 /.vim/snippets/c.snippets
parent8d966a90f36511ab827fcc1a55d95a29c787819a (diff)
downloaddotfiles-47adae6d2e9ea0bc7cdbb43facab071b80be7816.tar.gz
custom vim snippets only
Diffstat (limited to '.vim/snippets/c.snippets')
-rw-r--r--.vim/snippets/c.snippets42
1 files changed, 42 insertions, 0 deletions
diff --git a/.vim/snippets/c.snippets b/.vim/snippets/c.snippets
new file mode 100644
index 0000000..ff06931
--- /dev/null
+++ b/.vim/snippets/c.snippets
@@ -0,0 +1,42 @@
+snippet main
+ int main(int argc, char *argv[])
+ {
+ ${0}
+ }
+
+snippet in
+ #include <${1:stdio}.h>
+ $0
+
+snippet ndef
+ #ifndef ${1:`toupper(vim_snippets#Filename('$1_H', 'UNTITLED_H'))`}
+ #define $1
+
+ ${0}
+
+ #endif /* end of include guard: $1 */
+
+snippet if
+ if (${1:true}) {
+ ${0:${VISUAL}}
+ }
+
+snippet elif
+ else if (${1:true}) {
+ ${0:${VISUAL}}
+ }
+
+snippet switch
+ switch (${1:/* variable */}) {
+ ${0:${VISUAL}}
+ }
+
+snippet for
+ for (int ${2:i} = 0; $2 < ${1:count}; $2${3:++}) {
+ ${4}
+ }
+
+snippet while
+ while (${1:1}) {
+ ${0:${VISUAL}}
+ }