From 7be834ccfd3f779cebfccc9702a3191e70958330 Mon Sep 17 00:00:00 2001 From: tastytea Date: Tue, 6 Sep 2022 05:57:40 +0200 Subject: [PATCH] nvim: add cpp-snippet for main() --- .config/nvim/snippets/cpp.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.config/nvim/snippets/cpp.lua b/.config/nvim/snippets/cpp.lua index 8055ce9..f5909ea 100644 --- a/.config/nvim/snippets/cpp.lua +++ b/.config/nvim/snippets/cpp.lua @@ -3,6 +3,7 @@ local s = require("luasnip.nodes.snippet").S local f = require("luasnip.nodes.functionNode").F local i = require("luasnip.nodes.insertNode").I local fmt = require("luasnip.extras.fmt").fmt +local t = require("luasnip.nodes.textNode").T local agpl = [[/* This file is part of {project}. @@ -88,5 +89,13 @@ return { or 'INSERT_EMAIL' end), cursor = i(0) - })) + })), + s({ trig = 'main', + name = 'main', + dscr = 'main function' + }, { + t({ 'int main(int argc, char *argv[]) {' }), + i(0), + t({ '', '}' }) + }) }