From a6a86fda974ffb19a50f6bc137e87d935ff47ef0 Mon Sep 17 00:00:00 2001 From: EEprotocol Date: Mon, 24 Jun 2024 22:57:19 +0900 Subject: [PATCH] [Add] message --- lua/snips/cpp.lua | 51 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 lua/snips/cpp.lua diff --git a/lua/snips/cpp.lua b/lua/snips/cpp.lua new file mode 100644 index 0000000..9bd011c --- /dev/null +++ b/lua/snips/cpp.lua @@ -0,0 +1,51 @@ +local LuaMS = {} +function LuaMS.loader() + local ls = require("luasnip") + local s = ls.snippet + local sn = ls.snippet_node + local isn = ls.indent_snippet_node + local t = ls.text_node + local i = ls.insert_node + local f = ls.function_node + local c = ls.choice_node + local d = ls.dynamic_node + local r = ls.restore_node + local events = require("luasnip.util.events") + local ai = require("luasnip.nodes.absolute_indexer") + local extras = require("luasnip.extras") + local l = extras.lambda + local rep = extras.rep + local p = extras.partial + local m = extras.match + local n = extras.nonempty + local dl = extras.dynamic_lambda + local fmt = require("luasnip.extras.fmt").fmt + local fmta = require("luasnip.extras.fmt").fmta + local conds = require("luasnip.extras.expand_conditions") + local postfix = require("luasnip.extras.postfix").postfix + local types = require("luasnip.util.types") + local parse = require("luasnip.util.parser").parse_snippet + local ms = ls.multi_snippet + local k = require("luasnip.nodes.key_indexer").new_key + + ls.add_snippets("cpp", { + + s({ trig = "snipcpp_ac", mame = "snippet_Cpp_atcoder", dscr = "snippet for Atcoder" }, { + Nl(), t("#include "), + Nl(), t("#include "), + Nl(), t("#define rep(i, m) for{\\"), + Nl(), t("int i = 0; \\"), + Nl(), t("i < (m); \\"), + Nl(), t("i++ \\"), + Nl(), t("};"), + Nl(), + Nl(), t("using namespace std;"), + Nl(), t("int main() {"), + Nl(), i(0,"start..!"), + Nl(), t("}"), + }), + } + ) +end + +return LuaMS