summaryrefslogtreecommitdiffstats
path: root/lua/snippets/c.lua
diff options
context:
space:
mode:
authorSquibid <me@zacharyscheiman.com>2024-08-09 02:45:31 -0400
committerSquibid <me@zacharyscheiman.com>2024-08-09 02:45:31 -0400
commitc489d393695e90d424f9ae51e35c4d42358e6a71 (patch)
tree12ea97ec4684fd82cd6b73dd127d0137b115837b /lua/snippets/c.lua
parentad76983d969c318e6e234bc82384b4b025d70447 (diff)
downloadnvim-c489d393695e90d424f9ae51e35c4d42358e6a71.tar.gz
nvim-c489d393695e90d424f9ae51e35c4d42358e6a71.tar.bz2
nvim-c489d393695e90d424f9ae51e35c4d42358e6a71.zip
yes there's a bit of java in my nvim config why do you ask?
Diffstat (limited to '')
-rw-r--r--lua/snippets/c.lua48
1 files changed, 48 insertions, 0 deletions
diff --git a/lua/snippets/c.lua b/lua/snippets/c.lua
new file mode 100644
index 0000000..b1ca713
--- /dev/null
+++ b/lua/snippets/c.lua
@@ -0,0 +1,48 @@
+require('core.snippets.shorthands')
+
+return {
+ -- method snippet
+ s("main", {
+ c(1, {
+ t(""),
+ t("static "),
+ }),
+ t("int "),
+ t("main"),
+ t("("),
+ c(2, {
+ t("int argc, char *argv[]"),
+ i(1, "void"),
+ }),
+ t(")"),
+ t({ " {", "\t" }),
+ i(0),
+ t({ "", "}" }),
+ }),
+
+ -- function snippet
+ s("fn", {
+ c(1, {
+ t("void"),
+ t("char"),
+ t("int"),
+ t("short"),
+ t("long"),
+ t("double"),
+ t("float"),
+ i(nil, "myType"),
+ }),
+ t({ "", "" }),
+ c(2, {
+ t(""),
+ t("*")
+ }),
+ i(3, "myFunc");
+ t("("),
+ i(4),
+ t(")"),
+ t({ "", "{", "\t" }),
+ i(0),
+ t({ "", "}" }),
+})
+}