From 030e98deda39c36a06065af0958b849c2611e692 Mon Sep 17 00:00:00 2001 From: ujihisa Date: Sat, 13 Oct 2012 18:11:05 -0700 Subject: [PATCH] improving C snip -- abbr has more info --- autoload/neosnippet/snippets/c.snip | 15 ++++++++++++--- doc/neosnippet.txt | 1 + 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/autoload/neosnippet/snippets/c.snip b/autoload/neosnippet/snippets/c.snip index c3890c6..677e61c 100644 --- a/autoload/neosnippet/snippets/c.snip +++ b/autoload/neosnippet/snippets/c.snip @@ -73,7 +73,7 @@ abbr enum {} ${0} }; -# main function. +# hard-tab is necessary; C indent doesn't support this. snippet main int main(int argc, char const* argv[]) { @@ -119,10 +119,12 @@ snippet typedef typedef ${1:base_type} ${2:custom_type}; snippet printf - printf("${1}\n"${2});${0} +abbr printf("...\n", ...); + printf("${1}\n", ${2}); snippet fprintf - fprintf(${1:stderr}, "${2}\n"${3});${0} +abbr fprintf(..., "...\n", ...); + fprintf(${1:stderr}, "${2}\n"${3}); snippet comment alias /* @@ -133,3 +135,10 @@ snippet sizeof alias size sizeof(${0}) +snippet helloworld + #include + int main(int argc, char const* argv[]) + { + puts("hello, world!"); + return 0; + } diff --git a/doc/neosnippet.txt b/doc/neosnippet.txt index b31e8b4..dfd76fb 100644 --- a/doc/neosnippet.txt +++ b/doc/neosnippet.txt @@ -411,6 +411,7 @@ CHANGELOG *neosnippet-changelog* 2012-10-07 - Improved vim snip. +- Improved c snip. 2012-10-06 - Improved indent snippet behavior.