re-design snippets hierarchy

This commit is contained in:
Zhang Chiyuan
2008-03-10 12:26:15 +00:00
parent b376b1f00b
commit 61210bf5fd
78 changed files with 94 additions and 36 deletions

View File

@@ -0,0 +1,3 @@
#name : v.begin(), v.end()
# --
${1:v}.begin(), $1.end

View File

@@ -0,0 +1,8 @@
#name : class ... { ... }
# --
class ${1:Name}
{
public:
$1($2);
virtual ~$1();
};

View File

@@ -0,0 +1,4 @@
#name : using namespace ...
# --
using namespace ${std};
$0

View File

@@ -0,0 +1,3 @@
#name : FILE *fp = fopen(..., ...);
# --
FILE *${fp} = fopen(${"file"}, "${r}");

6
text-mode/cc-mode/do Normal file
View File

@@ -0,0 +1,6 @@
#name : do { ... } while (...)
# --
do
{
$0
} while (${1:condition});

6
text-mode/cc-mode/for Normal file
View File

@@ -0,0 +1,6 @@
#name : for (...; ...; ...) { ... }
# --
for (${1:int i = 0}; ${2:i < N}; ${3:++i})
{
$0
}

6
text-mode/cc-mode/if Normal file
View File

@@ -0,0 +1,6 @@
#name : if (...) { ... }
# --
if (${1:condition})
{
$0
}

3
text-mode/cc-mode/inc Normal file
View File

@@ -0,0 +1,3 @@
#name : #include "..."
# --
#include "$1"

3
text-mode/cc-mode/inc.1 Normal file
View File

@@ -0,0 +1,3 @@
#name : #include <...>
# --
#include <$1>

7
text-mode/cc-mode/main Normal file
View File

@@ -0,0 +1,7 @@
#name: int main(argc, argv) { ... }
# --
int main(int argc, char const *argv)
{
$0
return 0;
}

8
text-mode/cc-mode/once Normal file
View File

@@ -0,0 +1,8 @@
#name : #ifndef XXX; #define XXX; #endif
# --
#ifndef ${1:_`(upcase (file-name-nondirectory (file-name-sans-extension (buffer-file-name))))`_H_}
#define $1
$0
#endif /* $1 */

6
text-mode/cc-mode/struct Normal file
View File

@@ -0,0 +1,6 @@
#name : struct ... { ... }
# --
struct ${1:name}
{
$0
};