Skip to content

Commit 6964753

Browse files
committed
Import snippets.
These snippets are taken from garbas/vim-snipmate. The SHA is: 307880b0809fdb0bd70226e3fedd4acdf58a7e0b
0 parents  commit 6964753

33 files changed

+4357
-0
lines changed

Diff for: _.snippets

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Global snippets
2+
3+
# (c) holds no legal value ;)
4+
snippet c)
5+
Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${1:`g:snips_author`}. All Rights Reserved.${2}
6+
snippet date
7+
`strftime("%Y-%m-%d")`
8+
snippet ddate
9+
`strftime("%B %d, %Y")`
10+
snippet lorem
11+
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Diff for: actionscript.snippets

+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
snippet main
2+
package {
3+
import flash.display.*;
4+
import flash.Events.*;
5+
6+
public class Main extends Sprite {
7+
public function Main ( ) {
8+
trace("start");
9+
stage.scaleMode = StageScaleMode.NO_SCALE;
10+
stage.addEventListener(Event.RESIZE, resizeListener);
11+
}
12+
13+
private function resizeListener (e:Event):void {
14+
trace("The application window changed size!");
15+
trace("New width: " + stage.stageWidth);
16+
trace("New height: " + stage.stageHeight);
17+
}
18+
19+
}
20+
21+
}
22+
snippet class
23+
${1:public|internal} class ${2:name} ${3:extends } {
24+
public function $2 ( ) {
25+
("start");
26+
}
27+
}
28+
snippet all
29+
package name {
30+
31+
${1:public|internal|final} class ${2:name} ${3:extends } {
32+
private|public| static const FOO = "abc";
33+
private|public| static var BAR = "abc";
34+
35+
// class initializer - no JIT !! one time setup
36+
if Cababilities.os == "Linux|MacOS" {
37+
FOO = "other";
38+
}
39+
40+
// constructor:
41+
public function $2 ( ){
42+
super2();
43+
trace("start");
44+
}
45+
public function name (a, b...){
46+
super.name(..);
47+
lable:break
48+
}
49+
}
50+
}
51+
52+
function A(){
53+
// A can only be accessed within this file
54+
}
55+
snippet switch
56+
switch(${1}){
57+
case ${2}:
58+
${3}
59+
break;
60+
default:
61+
}
62+
snippet case
63+
case ${1}:
64+
${2}
65+
break;
66+
snippet package
67+
package ${1:package}{
68+
${2}
69+
}
70+
snippet wh
71+
while ${1:cond}{
72+
${2}
73+
}
74+
snippet do
75+
do {
76+
${2}
77+
} while (${1:cond})
78+
snippet while
79+
while ${1:cond}{
80+
${2}
81+
}
82+
snippet for enumerate names
83+
for (${1:var} in ${2:object}){
84+
${3}
85+
}
86+
snippet for enumerate values
87+
for each (${1:var} in ${2:object}){
88+
${3}
89+
}
90+
snippet get_set
91+
function get ${1:name} {
92+
return ${2}
93+
}
94+
function set $1 (newValue) {
95+
${3}
96+
}
97+
snippet interface
98+
interface name {
99+
function method(${1}):${2:returntype};
100+
}
101+
snippet try
102+
try {
103+
${1}
104+
} catch (error:ErrorType) {
105+
${2}
106+
} finally {
107+
${3}
108+
}
109+
# For Loop (same as c.snippet)
110+
snippet for
111+
for (${2:i} = 0; $2 < ${1:count}; $2${3:++}) {
112+
${4:/* code */}
113+
}
114+
# Custom For Loop
115+
snippet forr
116+
for (${1:i} = ${2:0}; ${3:$1 < 10}; $1${4:++}) {
117+
${5:/* code */}
118+
}
119+
# If Condition
120+
snippet if
121+
if (${1:/* condition */}) {
122+
${2:/* code */}
123+
}
124+
snippet el
125+
else {
126+
${1}
127+
}
128+
# Ternary conditional
129+
snippet t
130+
${1:/* condition */} ? ${2:a} : ${3:b}
131+
snippet fun
132+
function ${1:function_name}(${2})${3}
133+
{
134+
${4:/* code */}
135+
}

Diff for: autoit.snippets

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
snippet if
2+
If ${1:condition} Then
3+
${2:; True code}
4+
EndIf
5+
snippet el
6+
Else
7+
${1}
8+
snippet elif
9+
ElseIf ${1:condition} Then
10+
${2:; True code}
11+
# If/Else block
12+
snippet ifel
13+
If ${1:condition} Then
14+
${2:; True code}
15+
Else
16+
${3:; Else code}
17+
EndIf
18+
# If/ElseIf/Else block
19+
snippet ifelif
20+
If ${1:condition 1} Then
21+
${2:; True code}
22+
ElseIf ${3:condition 2} Then
23+
${4:; True code}
24+
Else
25+
${5:; Else code}
26+
EndIf
27+
# Switch block
28+
snippet switch
29+
Switch (${1:condition})
30+
Case {$2:case1}:
31+
{$3:; Case 1 code}
32+
Case Else:
33+
{$4:; Else code}
34+
EndSwitch
35+
# Select block
36+
snippet select
37+
Select (${1:condition})
38+
Case {$2:case1}:
39+
{$3:; Case 1 code}
40+
Case Else:
41+
{$4:; Else code}
42+
EndSelect
43+
# While loop
44+
snippet while
45+
While (${1:condition})
46+
${2:; code...}
47+
WEnd
48+
# For loop
49+
snippet for
50+
For ${1:n} = ${3:1} to ${2:count}
51+
${4:; code...}
52+
Next
53+
# New Function
54+
snippet func
55+
Func ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
56+
${4:Return}
57+
EndFunc
58+
# Message box
59+
snippet msg
60+
MsgBox(${3:MsgType}, ${1:"Title"}, ${2:"Message Text"})
61+
# Debug Message
62+
snippet debug
63+
MsgBox(0, "Debug", ${1:"Debug Message"})
64+
# Show Variable Debug Message
65+
snippet showvar
66+
MsgBox(0, "${1:VarName}", $1)

Diff for: c.snippets

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# main()
2+
snippet main
3+
int main(int argc, const char *argv[])
4+
{
5+
${1}
6+
return 0;
7+
}
8+
snippet mainn
9+
int main(void)
10+
{
11+
${1}
12+
return 0;
13+
}
14+
# #include <...>
15+
snippet inc
16+
#include <${1:stdio}.h>${2}
17+
# #include "..."
18+
snippet Inc
19+
#include "${1:`Filename("$1.h")`}"${2}
20+
# #ifndef ... #define ... #endif
21+
snippet Def
22+
#ifndef $1
23+
#define ${1:SYMBOL} ${2:value}
24+
#endif${3}
25+
snippet def
26+
#define
27+
snippet ifdef
28+
#ifdef ${1:FOO}
29+
${2:#define }
30+
#endif
31+
snippet #if
32+
#if ${1:FOO}
33+
${2}
34+
#endif
35+
# Header Include-Guard
36+
snippet once
37+
#ifndef ${1:`toupper(Filename('$1_H', 'UNTITLED_H'))`}
38+
39+
#define $1
40+
41+
${2}
42+
43+
#endif /* end of include guard: $1 */
44+
# If Condition
45+
snippet if
46+
if (${1:/* condition */}) {
47+
${2:/* code */}
48+
}
49+
snippet el
50+
else {
51+
${1}
52+
}
53+
# Ternary conditional
54+
snippet t
55+
${1:/* condition */} ? ${2:a} : ${3:b}
56+
# Do While Loop
57+
snippet do
58+
do {
59+
${2:/* code */}
60+
} while (${1:/* condition */});
61+
# While Loop
62+
snippet wh
63+
while (${1:/* condition */}) {
64+
${2:/* code */}
65+
}
66+
# For Loop
67+
snippet for
68+
for (${2:i} = 0; $2 < ${1:count}; $2${3:++}) {
69+
${4:/* code */}
70+
}
71+
# Custom For Loop
72+
snippet forr
73+
for (${1:i} = ${2:0}; ${3:$1 < 10}; $1${4:++}) {
74+
${5:/* code */}
75+
}
76+
# Function
77+
snippet fun
78+
${1:void} ${2:function_name}(${3})
79+
{
80+
${4:/* code */}
81+
}
82+
# Function Declaration
83+
snippet fund
84+
${1:void} ${2:function_name}(${3});${4}
85+
# Typedef
86+
snippet td
87+
typedef ${1:int} ${2:MyCustomType};${3}
88+
# Struct
89+
snippet st
90+
struct ${1:`Filename('$1_t', 'name')`} {
91+
${2:/* data */}
92+
}${3: /* optional variable list */};${4}
93+
# Typedef struct
94+
snippet tds
95+
typedef struct ${2:_$1 }{
96+
${3:/* data */}
97+
} ${1:`Filename('$1_t', 'name')`};
98+
# Typdef enum
99+
snippet tde
100+
typedef enum {
101+
${1:/* data */}
102+
} ${2:foo};
103+
# printf
104+
# unfortunately version this isn't as nice as TextMates's, given the lack of a
105+
# dynamic `...`
106+
snippet pr
107+
printf("${1:%s}\n"${2});${3}
108+
# fprintf (again, this isn't as nice as TextMate's version, but it works)
109+
snippet fpr
110+
fprintf(${1:stderr}, "${2:%s}\n"${3});${4}
111+
# This is kind of convenient
112+
snippet .
113+
[${1}]${2}
114+
# GPL
115+
snippet gpl
116+
/*
117+
* This program is free software; you can redistribute it and/or modify
118+
* it under the terms of the GNU General Public License as published by
119+
* the Free Software Foundation; either version 2 of the License, or
120+
* (at your option) any later version.
121+
*
122+
* This program is distributed in the hope that it will be useful,
123+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
124+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
125+
* GNU General Public License for more details.
126+
*
127+
* You should have received a copy of the GNU General Public License
128+
* along with this program; if not, write to the Free Software
129+
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
130+
*
131+
* Copyright (C) ${1:Author}, `strftime("%Y")`
132+
*/
133+
134+
${2}

0 commit comments

Comments
 (0)