diff --git a/.config/nvim/luasnippets/c_cpp.jsonc b/.config/nvim/luasnippets/c_cpp.jsonc new file mode 100644 index 0000000..1b73789 --- /dev/null +++ b/.config/nvim/luasnippets/c_cpp.jsonc @@ -0,0 +1,38 @@ +{ + // Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and + // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope + // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is + // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: + // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. + // Placeholders with the same ids are connected. + // Example: + // "Print to console": { + // "scope": "javascript,typescript", + // "prefix": "log", + // "body": [ + // "console.log('$1');", + // "$2" + // ], + // "description": "Log output to console" + // } + "header file definition": { + "scope": "c", + "prefix": "h", + "body": [ + "#ifndef ${1:NAME}_H", + "#define ${1:Name}_H", + "$0", + "#endif" + ] + }, + "header file definition c++": { + "scope": "cpp", + "prefix": "h", + "body": [ + "#ifndef ${1:NAME}_H", + "#define ${1:Name}_H", + "$0", + "#endif" + ] + } +}