yes there's a bit of java in my nvim config why do you ask?
This commit is contained in:
48
lua/snippets/c.lua
Normal file
48
lua/snippets/c.lua
Normal file
@ -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({ "", "}" }),
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user