Removed comment blocks from placeholders
This commit is contained in:
parent
dbfcb24f15
commit
4eb88d7993
@ -109,17 +109,17 @@ snippet try
|
|||||||
# For Loop (same as c.snippet)
|
# For Loop (same as c.snippet)
|
||||||
snippet for for (..) {..}
|
snippet for for (..) {..}
|
||||||
for (${2:i} = 0; $2 < ${1:count}; $2${3:++}) {
|
for (${2:i} = 0; $2 < ${1:count}; $2${3:++}) {
|
||||||
${4:/* code */}
|
${4}
|
||||||
}
|
}
|
||||||
# Custom For Loop
|
# Custom For Loop
|
||||||
snippet forr
|
snippet forr
|
||||||
for (${1:i} = ${2:0}; ${3:$1 < 10}; $1${4:++}) {
|
for (${1:i} = ${2:0}; ${3:$1 < 10}; $1${4:++}) {
|
||||||
${5:/* code */}
|
${5}
|
||||||
}
|
}
|
||||||
# If Condition
|
# If Condition
|
||||||
snippet if
|
snippet if
|
||||||
if (${1:/* condition */}) {
|
if (${1:/* condition */}) {
|
||||||
${2:/* code */}
|
${2}
|
||||||
}
|
}
|
||||||
snippet el
|
snippet el
|
||||||
else {
|
else {
|
||||||
@ -131,7 +131,7 @@ snippet t
|
|||||||
snippet fun
|
snippet fun
|
||||||
function ${1:function_name}(${2})${3}
|
function ${1:function_name}(${2})${3}
|
||||||
{
|
{
|
||||||
${4:/* code */}
|
${4}
|
||||||
}
|
}
|
||||||
# FlxSprite (usefull when using the flixel library)
|
# FlxSprite (usefull when using the flixel library)
|
||||||
snippet FlxSprite
|
snippet FlxSprite
|
||||||
@ -144,13 +144,13 @@ snippet FlxSprite
|
|||||||
public function $1(${3: X:Number, Y:Number}):void
|
public function $1(${3: X:Number, Y:Number}):void
|
||||||
{
|
{
|
||||||
super(X,Y);
|
super(X,Y);
|
||||||
${4: //code...}
|
${4}
|
||||||
}
|
}
|
||||||
|
|
||||||
override public function update():void
|
override public function update():void
|
||||||
{
|
{
|
||||||
super.update();
|
super.update();
|
||||||
${5: //code...}
|
${5}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ snippet once
|
|||||||
# if
|
# if
|
||||||
snippet if
|
snippet if
|
||||||
if (${1:/* condition */}) {
|
if (${1:/* condition */}) {
|
||||||
${2:/* code */}
|
${2}
|
||||||
}${3}
|
}${3}
|
||||||
# else
|
# else
|
||||||
snippet el
|
snippet el
|
||||||
@ -63,7 +63,7 @@ snippet el
|
|||||||
# else if
|
# else if
|
||||||
snippet elif
|
snippet elif
|
||||||
else if (${1:/* condition */}) {
|
else if (${1:/* condition */}) {
|
||||||
${2:/* code */}
|
${2}
|
||||||
}${3}
|
}${3}
|
||||||
# ternary
|
# ternary
|
||||||
snippet t
|
snippet t
|
||||||
@ -94,22 +94,22 @@ snippet case
|
|||||||
# for
|
# for
|
||||||
snippet for
|
snippet for
|
||||||
for (${2:i} = 0; $2 < ${1:count}; $2${3:++}) {
|
for (${2:i} = 0; $2 < ${1:count}; $2${3:++}) {
|
||||||
${4:/* code */}
|
${4}
|
||||||
}${5}
|
}${5}
|
||||||
# for (custom)
|
# for (custom)
|
||||||
snippet forr
|
snippet forr
|
||||||
for (${1:i} = ${2:0}; ${3:$1 < 10}; $1${4:++}) {
|
for (${1:i} = ${2:0}; ${3:$1 < 10}; $1${4:++}) {
|
||||||
${5:/* code */}
|
${5}
|
||||||
}${6}
|
}${6}
|
||||||
# while
|
# while
|
||||||
snippet wh
|
snippet wh
|
||||||
while (${1:/* condition */}) {
|
while (${1:/* condition */}) {
|
||||||
${2:/* code */}
|
${2}
|
||||||
}${3}
|
}${3}
|
||||||
# do... while
|
# do... while
|
||||||
snippet do
|
snippet do
|
||||||
do {
|
do {
|
||||||
${2:/* code */}
|
${2}
|
||||||
} while (${1:/* condition */});${3}
|
} while (${1:/* condition */});${3}
|
||||||
##
|
##
|
||||||
## Functions
|
## Functions
|
||||||
@ -117,7 +117,7 @@ snippet do
|
|||||||
snippet fun
|
snippet fun
|
||||||
${1:void} ${2:function_name}(${3})
|
${1:void} ${2:function_name}(${3})
|
||||||
{
|
{
|
||||||
${4:/* code */}
|
${4}
|
||||||
}${5}
|
}${5}
|
||||||
# function declaration
|
# function declaration
|
||||||
snippet fund
|
snippet fund
|
||||||
|
@ -80,7 +80,7 @@ snippet cl
|
|||||||
# member function implementation
|
# member function implementation
|
||||||
snippet mfun
|
snippet mfun
|
||||||
${4:void} ${1:`Filename('$1', 'ClassName')`}::${2:memberFunction}(${3}) {
|
${4:void} ${1:`Filename('$1', 'ClassName')`}::${2:memberFunction}(${3}) {
|
||||||
${5:/* code */}
|
${5}
|
||||||
}
|
}
|
||||||
# namespace
|
# namespace
|
||||||
snippet ns
|
snippet ns
|
||||||
@ -100,13 +100,13 @@ snippet cin
|
|||||||
# for i
|
# for i
|
||||||
snippet fori
|
snippet fori
|
||||||
for (int ${2:i} = 0; $2 < ${1:count}; $2${3:++}) {
|
for (int ${2:i} = 0; $2 < ${1:count}; $2${3:++}) {
|
||||||
${4:/* code */}
|
${4}
|
||||||
}${5}
|
}${5}
|
||||||
|
|
||||||
# foreach
|
# foreach
|
||||||
snippet fore
|
snippet fore
|
||||||
for (${1:auto} ${2:i} : ${3:container}) {
|
for (${1:auto} ${2:i} : ${3:container}) {
|
||||||
${4:/* code */}
|
${4}
|
||||||
}${5}
|
}${5}
|
||||||
# iterator
|
# iterator
|
||||||
snippet iter
|
snippet iter
|
||||||
@ -123,9 +123,9 @@ snippet itera
|
|||||||
## Lambdas
|
## Lambdas
|
||||||
# lamda (one line)
|
# lamda (one line)
|
||||||
snippet ld
|
snippet ld
|
||||||
[${1}](${2}){${3:/* code */}}${4}
|
[${1}](${2}){${3}}${4}
|
||||||
# lambda (multi-line)
|
# lambda (multi-line)
|
||||||
snippet lld
|
snippet lld
|
||||||
[${1}](${2}){
|
[${1}](${2}){
|
||||||
${3:/* code */}
|
${3}
|
||||||
}${4}
|
}${4}
|
||||||
|
@ -9,7 +9,7 @@ snippet so
|
|||||||
${2}
|
${2}
|
||||||
snippet main
|
snippet main
|
||||||
static void main() {
|
static void main() {
|
||||||
${1:/* code */}
|
${1}
|
||||||
}
|
}
|
||||||
snippet st
|
snippet st
|
||||||
static ${1}
|
static ${1}
|
||||||
@ -57,15 +57,15 @@ snippet for
|
|||||||
}
|
}
|
||||||
snippet fore
|
snippet fore
|
||||||
for (final ${2:item} in ${1:itemList}) {
|
for (final ${2:item} in ${1:itemList}) {
|
||||||
${3:/* code */}
|
${3}
|
||||||
}
|
}
|
||||||
snippet wh
|
snippet wh
|
||||||
while (${1:/* condition */}) {
|
while (${1:/* condition */}) {
|
||||||
${2:/* code */}
|
${2}
|
||||||
}
|
}
|
||||||
snippet dowh
|
snippet dowh
|
||||||
do {
|
do {
|
||||||
${2:/* code */}
|
${2}
|
||||||
} while (${1:/* condition */});
|
} while (${1:/* condition */});
|
||||||
snippet as
|
snippet as
|
||||||
assert(${1:/* condition */});
|
assert(${1:/* condition */});
|
||||||
|
@ -8,7 +8,7 @@ snippet imp
|
|||||||
# Function
|
# Function
|
||||||
snippet fun
|
snippet fun
|
||||||
function ${2:function_name}(${3})
|
function ${2:function_name}(${3})
|
||||||
${4:/* code */}
|
${4}
|
||||||
end
|
end
|
||||||
|
|
||||||
# Class
|
# Class
|
||||||
@ -20,13 +20,13 @@ snippet class
|
|||||||
# If
|
# If
|
||||||
snippet if
|
snippet if
|
||||||
if ${1:condition}
|
if ${1:condition}
|
||||||
${2:/* code */}
|
${2}
|
||||||
end
|
end
|
||||||
|
|
||||||
# If else
|
# If else
|
||||||
snippet ife
|
snippet ife
|
||||||
if ${1:condition}
|
if ${1:condition}
|
||||||
${2:/* code */}
|
${2}
|
||||||
else
|
else
|
||||||
${1}
|
${1}
|
||||||
end
|
end
|
||||||
@ -34,7 +34,7 @@ snippet ife
|
|||||||
# If else if
|
# If else if
|
||||||
snippet elif
|
snippet elif
|
||||||
elif ${1:condition}
|
elif ${1:condition}
|
||||||
${2:/* code */}
|
${2}
|
||||||
|
|
||||||
# Switch case
|
# Switch case
|
||||||
snippet switch
|
snippet switch
|
||||||
@ -55,17 +55,17 @@ snippet select
|
|||||||
# For/in Loop
|
# For/in Loop
|
||||||
snippet forin
|
snippet forin
|
||||||
for ${1:element} in ${2:container}
|
for ${1:element} in ${2:container}
|
||||||
${3:/* code */}
|
${3}
|
||||||
end
|
end
|
||||||
|
|
||||||
# For/to Loop
|
# For/to Loop
|
||||||
snippet forto
|
snippet forto
|
||||||
for ${1:lowerbound} to ${2:upperbound}
|
for ${1:lowerbound} to ${2:upperbound}
|
||||||
${3:/* code */}
|
${3}
|
||||||
end
|
end
|
||||||
|
|
||||||
# While Loop
|
# While Loop
|
||||||
snippet while
|
snippet while
|
||||||
while ${1:conidition}
|
while ${1:conidition}
|
||||||
${2:/* code */}
|
${2}
|
||||||
end
|
end
|
||||||
|
@ -16,7 +16,7 @@ snippet ch
|
|||||||
# case
|
# case
|
||||||
snippet cs
|
snippet cs
|
||||||
case ${1:value}:
|
case ${1:value}:
|
||||||
${2:/* code */}
|
${2}
|
||||||
# const
|
# const
|
||||||
snippet c
|
snippet c
|
||||||
const ${1:NAME} = ${2:0}
|
const ${1:NAME} = ${2:0}
|
||||||
@ -36,7 +36,7 @@ snippet df
|
|||||||
snippet dfr
|
snippet dfr
|
||||||
defer func() {
|
defer func() {
|
||||||
if err := recover(); err != nil {
|
if err := recover(); err != nil {
|
||||||
${1:/* code */}
|
${1}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
# gpl
|
# gpl
|
||||||
@ -78,7 +78,7 @@ snippet inf
|
|||||||
# if condition
|
# if condition
|
||||||
snippet if
|
snippet if
|
||||||
if ${1:/* condition */} {
|
if ${1:/* condition */} {
|
||||||
${2:/* code */}
|
${2}
|
||||||
}${2}
|
}${2}
|
||||||
# else snippet
|
# else snippet
|
||||||
snippet el
|
snippet el
|
||||||
@ -109,7 +109,7 @@ snippet f6
|
|||||||
# if else
|
# if else
|
||||||
snippet ie
|
snippet ie
|
||||||
if ${1:/* condition */} {
|
if ${1:/* condition */} {
|
||||||
${2:/* code */}
|
${2}
|
||||||
} else {
|
} else {
|
||||||
${3}
|
${3}
|
||||||
}
|
}
|
||||||
@ -117,25 +117,25 @@ snippet ie
|
|||||||
# for loop
|
# for loop
|
||||||
snippet fo
|
snippet fo
|
||||||
for ${2:i} := 0; $2 < ${1:count}; $2${3:++} {
|
for ${2:i} := 0; $2 < ${1:count}; $2${3:++} {
|
||||||
${4:/* code */}
|
${4}
|
||||||
}
|
}
|
||||||
${5}
|
${5}
|
||||||
# for range loop
|
# for range loop
|
||||||
snippet fr
|
snippet fr
|
||||||
for ${1:k}, ${2:v} := range ${3} {
|
for ${1:k}, ${2:v} := range ${3} {
|
||||||
${4:/* code */}
|
${4}
|
||||||
}
|
}
|
||||||
${5}
|
${5}
|
||||||
# function simple
|
# function simple
|
||||||
snippet fun
|
snippet fun
|
||||||
func ${1:funcName}(${2}) ${3:error} {
|
func ${1:funcName}(${2}) ${3:error} {
|
||||||
${4:/* code */}
|
${4}
|
||||||
}
|
}
|
||||||
${5}
|
${5}
|
||||||
# function on receiver
|
# function on receiver
|
||||||
snippet fum
|
snippet fum
|
||||||
func (self ${1:type}) ${2:funcName}(${3}) ${4:error} {
|
func (self ${1:type}) ${2:funcName}(${3}) ${4:error} {
|
||||||
${5:/* code */}
|
${5}
|
||||||
}
|
}
|
||||||
${6}
|
${6}
|
||||||
# log printf
|
# log printf
|
||||||
@ -153,7 +153,7 @@ snippet mp
|
|||||||
# main()
|
# main()
|
||||||
snippet main
|
snippet main
|
||||||
func main() {
|
func main() {
|
||||||
${1:/* code */}
|
${1}
|
||||||
}
|
}
|
||||||
${2}
|
${2}
|
||||||
# new
|
# new
|
||||||
@ -178,11 +178,11 @@ snippet rs
|
|||||||
snippet sl
|
snippet sl
|
||||||
select {
|
select {
|
||||||
case ${1:v1} := <-${2:chan1}
|
case ${1:v1} := <-${2:chan1}
|
||||||
${3:/* code */}
|
${3}
|
||||||
case ${4:v2} := <-${5:chan2}
|
case ${4:v2} := <-${5:chan2}
|
||||||
${6:/* code */}
|
${6}
|
||||||
default:
|
default:
|
||||||
${7:/* code */}
|
${7}
|
||||||
}
|
}
|
||||||
# string
|
# string
|
||||||
snippet sr
|
snippet sr
|
||||||
@ -197,11 +197,11 @@ snippet st
|
|||||||
snippet sw
|
snippet sw
|
||||||
switch ${1:var} {
|
switch ${1:var} {
|
||||||
case ${2:value1}:
|
case ${2:value1}:
|
||||||
${3:/* code */}
|
${3}
|
||||||
case ${4:value2}:
|
case ${4:value2}:
|
||||||
${5:/* code */}
|
${5}
|
||||||
default:
|
default:
|
||||||
${6:/* code */}
|
${6}
|
||||||
}
|
}
|
||||||
snippet sp
|
snippet sp
|
||||||
fmt.Sprintf("%${1:s}", ${2:var})${3}
|
fmt.Sprintf("%${1:s}", ${2:var})${3}
|
||||||
|
@ -171,7 +171,7 @@ snippet wh
|
|||||||
## Main method
|
## Main method
|
||||||
snippet main
|
snippet main
|
||||||
public static void main (String[] args) {
|
public static void main (String[] args) {
|
||||||
${1:/* code */}
|
${1}
|
||||||
}
|
}
|
||||||
##
|
##
|
||||||
## Print Methods
|
## Print Methods
|
||||||
|
@ -260,7 +260,7 @@ snippet filter
|
|||||||
${1:obj}.filter('${2:selector expression}')${3}
|
${1:obj}.filter('${2:selector expression}')${3}
|
||||||
snippet filtert
|
snippet filtert
|
||||||
${1:obj}.filter(function (${2:index}) {
|
${1:obj}.filter(function (${2:index}) {
|
||||||
${3:// test code}
|
${3}
|
||||||
})${4}
|
})${4}
|
||||||
snippet find
|
snippet find
|
||||||
${1:obj}.find('${2:selector expression}')${3}
|
${1:obj}.find('${2:selector expression}')${3}
|
||||||
@ -291,7 +291,7 @@ snippet getscript
|
|||||||
});
|
});
|
||||||
snippet grep
|
snippet grep
|
||||||
$.grep(${1:array}, function (item, index) {
|
$.grep(${1:array}, function (item, index) {
|
||||||
${2:// test code}
|
${2}
|
||||||
}${3:, true});
|
}${3:, true});
|
||||||
snippet hasc
|
snippet hasc
|
||||||
${1:obj}.hasClass('${2:className}')${3}
|
${1:obj}.hasClass('${2:className}')${3}
|
||||||
|
@ -17,7 +17,7 @@ snippet f
|
|||||||
# Immediate function
|
# Immediate function
|
||||||
snippet (f
|
snippet (f
|
||||||
(function (${1}) {
|
(function (${1}) {
|
||||||
${3:/* code */}
|
${3}
|
||||||
}(${2}));
|
}(${2}));
|
||||||
# if
|
# if
|
||||||
snippet if
|
snippet if
|
||||||
@ -38,16 +38,16 @@ snippet ter
|
|||||||
snippet switch
|
snippet switch
|
||||||
switch (${1:expression}) {
|
switch (${1:expression}) {
|
||||||
case '${3:case}':
|
case '${3:case}':
|
||||||
${4:// code}
|
${4}
|
||||||
break;
|
break;
|
||||||
${5}
|
${5}
|
||||||
default:
|
default:
|
||||||
${2:// code}
|
${2}
|
||||||
}
|
}
|
||||||
# case
|
# case
|
||||||
snippet case
|
snippet case
|
||||||
case '${1:case}':
|
case '${1:case}':
|
||||||
${2:// code}
|
${2}
|
||||||
break;
|
break;
|
||||||
${3}
|
${3}
|
||||||
# for (...) {...}
|
# for (...) {...}
|
||||||
@ -63,19 +63,19 @@ snippet forr
|
|||||||
# while (...) {...}
|
# while (...) {...}
|
||||||
snippet wh
|
snippet wh
|
||||||
while (${1:/* condition */}) {
|
while (${1:/* condition */}) {
|
||||||
${2:/* code */}
|
${2}
|
||||||
}
|
}
|
||||||
# try
|
# try
|
||||||
snippet try
|
snippet try
|
||||||
try {
|
try {
|
||||||
${1:/* code */}
|
${1}
|
||||||
} catch (${2:e}) {
|
} catch (${2:e}) {
|
||||||
${3:/* handle error */}
|
${3:/* handle error */}
|
||||||
}
|
}
|
||||||
# do...while
|
# do...while
|
||||||
snippet do
|
snippet do
|
||||||
do {
|
do {
|
||||||
${2:/* code */}
|
${2}
|
||||||
} while (${1:/* condition */});
|
} while (${1:/* condition */});
|
||||||
# Object Method
|
# Object Method
|
||||||
snippet :f
|
snippet :f
|
||||||
@ -124,10 +124,10 @@ snippet jsons
|
|||||||
# self-defining function
|
# self-defining function
|
||||||
snippet sdf
|
snippet sdf
|
||||||
var ${1:function_name} = function (${2:argument}) {
|
var ${1:function_name} = function (${2:argument}) {
|
||||||
${3:// initial code ...}
|
${3}
|
||||||
|
|
||||||
$1 = function ($2) {
|
$1 = function ($2) {
|
||||||
${4:// main code}
|
${4}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
# singleton
|
# singleton
|
||||||
@ -150,7 +150,7 @@ snippet sing
|
|||||||
// reset the constructor pointer
|
// reset the constructor pointer
|
||||||
instance.constructor = $1;
|
instance.constructor = $1;
|
||||||
|
|
||||||
${3:// code ...}
|
${3}
|
||||||
|
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
snippet ifeq
|
snippet ifeq
|
||||||
ifeq (${1:cond0},${2:cond1})
|
ifeq (${1:cond0},${2:cond1})
|
||||||
${3:code}
|
${3}
|
||||||
endif
|
endif
|
||||||
|
@ -207,7 +207,7 @@ snippet arel
|
|||||||
# autorelease pool
|
# autorelease pool
|
||||||
snippet pool
|
snippet pool
|
||||||
NSAutoreleasePool *${1:pool} = [[NSAutoreleasePool alloc] init];
|
NSAutoreleasePool *${1:pool} = [[NSAutoreleasePool alloc] init];
|
||||||
${2:/* code */}
|
${2}
|
||||||
[$1 drain];
|
[$1 drain];
|
||||||
# Throw an exception
|
# Throw an exception
|
||||||
snippet except
|
snippet except
|
||||||
|
@ -326,7 +326,7 @@ snippet tsub
|
|||||||
snippet trsub
|
snippet trsub
|
||||||
test ${1:test_name} => { description => '${2:Description of test.}'} => sub {
|
test ${1:test_name} => { description => '${2:Description of test.}'} => sub {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
${3:# test code}
|
${3}
|
||||||
};
|
};
|
||||||
|
|
||||||
#prep test method
|
#prep test method
|
||||||
|
@ -231,7 +231,7 @@ snippet class
|
|||||||
*/
|
*/
|
||||||
${5:public} function ${6:__construct}(${7:argument})
|
${5:public} function ${6:__construct}(${7:argument})
|
||||||
{
|
{
|
||||||
${8:// code...}
|
${8}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
snippet nc
|
snippet nc
|
||||||
@ -249,26 +249,26 @@ snippet def?
|
|||||||
${1}defined('${2}')${3}
|
${1}defined('${2}')${3}
|
||||||
snippet wh
|
snippet wh
|
||||||
while (${1:/* condition */}) {
|
while (${1:/* condition */}) {
|
||||||
${2:// code...}
|
${2}
|
||||||
}
|
}
|
||||||
# do ... while
|
# do ... while
|
||||||
snippet do
|
snippet do
|
||||||
do {
|
do {
|
||||||
${2:// code... }
|
${2}
|
||||||
} while (${1:/* condition */});
|
} while (${1:/* condition */});
|
||||||
snippet if
|
snippet if
|
||||||
if (${1:/* condition */}) {
|
if (${1:/* condition */}) {
|
||||||
${2:// code...}
|
${2}
|
||||||
}
|
}
|
||||||
snippet ifil
|
snippet ifil
|
||||||
<?php if (${1:/* condition */}): ?>
|
<?php if (${1:/* condition */}): ?>
|
||||||
${2:<!-- code... -->}
|
${2}
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
snippet ife
|
snippet ife
|
||||||
if (${1:/* condition */}) {
|
if (${1:/* condition */}) {
|
||||||
${2:// code...}
|
${2}
|
||||||
} else {
|
} else {
|
||||||
${3:// code...}
|
${3}
|
||||||
}
|
}
|
||||||
${4}
|
${4}
|
||||||
snippet ifeil
|
snippet ifeil
|
||||||
@ -280,33 +280,33 @@ snippet ifeil
|
|||||||
${4}
|
${4}
|
||||||
snippet else
|
snippet else
|
||||||
else {
|
else {
|
||||||
${1:// code...}
|
${1}
|
||||||
}
|
}
|
||||||
snippet elseif
|
snippet elseif
|
||||||
elseif (${1:/* condition */}) {
|
elseif (${1:/* condition */}) {
|
||||||
${2:// code...}
|
${2}
|
||||||
}
|
}
|
||||||
snippet switch
|
snippet switch
|
||||||
switch ($${1:variable}) {
|
switch ($${1:variable}) {
|
||||||
case '${2:value}':
|
case '${2:value}':
|
||||||
${3:// code...}
|
${3}
|
||||||
break;
|
break;
|
||||||
${5}
|
${5}
|
||||||
default:
|
default:
|
||||||
${4:// code...}
|
${4}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
snippet case
|
snippet case
|
||||||
case '${1:value}':
|
case '${1:value}':
|
||||||
${2:// code...}
|
${2}
|
||||||
break;${3}
|
break;${3}
|
||||||
snippet for
|
snippet for
|
||||||
for ($${2:i} = 0; $$2 < ${1:count}; $$2${3:++}) {
|
for ($${2:i} = 0; $$2 < ${1:count}; $$2${3:++}) {
|
||||||
${4: // code...}
|
${4}
|
||||||
}
|
}
|
||||||
snippet foreach
|
snippet foreach
|
||||||
foreach ($${1:variable} as $${2:value}) {
|
foreach ($${1:variable} as $${2:value}) {
|
||||||
${3:// code...}
|
${3}
|
||||||
}
|
}
|
||||||
snippet foreachil
|
snippet foreachil
|
||||||
<?php foreach ($${1:variable} as $${2:value}): ?>
|
<?php foreach ($${1:variable} as $${2:value}): ?>
|
||||||
@ -314,7 +314,7 @@ snippet foreachil
|
|||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
snippet foreachk
|
snippet foreachk
|
||||||
foreach ($${1:variable} as $${2:key} => $${3:value}) {
|
foreach ($${1:variable} as $${2:key} => $${3:value}) {
|
||||||
${4:// code...}
|
${4}
|
||||||
}
|
}
|
||||||
snippet foreachkil
|
snippet foreachkil
|
||||||
<?php foreach ($${1:variable} as $${2:key} => $${3:value}): ?>
|
<?php foreach ($${1:variable} as $${2:key} => $${3:value}): ?>
|
||||||
|
@ -65,7 +65,7 @@ snippet for
|
|||||||
#loop while
|
#loop while
|
||||||
snippet while
|
snippet while
|
||||||
while (${1:/* condition */}) {
|
while (${1:/* condition */}) {
|
||||||
${2:/* code */}
|
${2}
|
||||||
}
|
}
|
||||||
#break
|
#break
|
||||||
snippet break
|
snippet break
|
||||||
@ -84,11 +84,11 @@ snippet default
|
|||||||
snippet switch
|
snippet switch
|
||||||
switch(${1:expression}) {
|
switch(${1:expression}) {
|
||||||
case '${3:case}':
|
case '${3:case}':
|
||||||
${4:// code}
|
${4}
|
||||||
break;
|
break;
|
||||||
${5}
|
${5}
|
||||||
default:
|
default:
|
||||||
${2:// code}
|
${2}
|
||||||
}
|
}
|
||||||
#try
|
#try
|
||||||
snippet try
|
snippet try
|
||||||
|
@ -15,16 +15,16 @@ snippet docs
|
|||||||
"""
|
"""
|
||||||
snippet wh
|
snippet wh
|
||||||
while ${1:condition}:
|
while ${1:condition}:
|
||||||
${2:# TODO: write code...}
|
${2}
|
||||||
# dowh - does the same as do...while in other languages
|
# dowh - does the same as do...while in other languages
|
||||||
snippet dowh
|
snippet dowh
|
||||||
while True:
|
while True:
|
||||||
${1:# TODO: write code...}
|
${1}
|
||||||
if ${2:condition}:
|
if ${2:condition}:
|
||||||
break
|
break
|
||||||
snippet with
|
snippet with
|
||||||
with ${1:expr} as ${2:var}:
|
with ${1:expr} as ${2:var}:
|
||||||
${3:# TODO: write code...}
|
${3}
|
||||||
# New Class
|
# New Class
|
||||||
snippet cl
|
snippet cl
|
||||||
class ${1:ClassName}(${2:object}):
|
class ${1:ClassName}(${2:object}):
|
||||||
@ -37,14 +37,14 @@ snippet cl
|
|||||||
snippet def
|
snippet def
|
||||||
def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
|
def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
|
||||||
"""${3:docstring for $1}"""
|
"""${3:docstring for $1}"""
|
||||||
${4:# TODO: write code...}
|
${4}
|
||||||
snippet deff
|
snippet deff
|
||||||
def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
|
def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
|
||||||
${3:# TODO: write code...}
|
${3}
|
||||||
# New Method
|
# New Method
|
||||||
snippet defs
|
snippet defs
|
||||||
def ${1:mname}(self, ${2:arg}):
|
def ${1:mname}(self, ${2:arg}):
|
||||||
${3:# TODO: write code...}
|
${3}
|
||||||
# New Property
|
# New Property
|
||||||
snippet property
|
snippet property
|
||||||
def ${1:foo}():
|
def ${1:foo}():
|
||||||
@ -60,17 +60,17 @@ snippet property
|
|||||||
# Ifs
|
# Ifs
|
||||||
snippet if
|
snippet if
|
||||||
if ${1:condition}:
|
if ${1:condition}:
|
||||||
${2:# TODO: write code...}
|
${2}
|
||||||
snippet el
|
snippet el
|
||||||
else:
|
else:
|
||||||
${1:# TODO: write code...}
|
${1}
|
||||||
snippet ei
|
snippet ei
|
||||||
elif ${1:condition}:
|
elif ${1:condition}:
|
||||||
${2:# TODO: write code...}
|
${2}
|
||||||
# For
|
# For
|
||||||
snippet for
|
snippet for
|
||||||
for ${1:item} in ${2:items}:
|
for ${1:item} in ${2:items}:
|
||||||
${3:# TODO: write code...}
|
${3}
|
||||||
# Encodes
|
# Encodes
|
||||||
snippet cutf8
|
snippet cutf8
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
@ -85,32 +85,32 @@ snippet .
|
|||||||
self.
|
self.
|
||||||
snippet try Try/Except
|
snippet try Try/Except
|
||||||
try:
|
try:
|
||||||
${1:# TODO: write code...}
|
${1}
|
||||||
except ${2:Exception}, ${3:e}:
|
except ${2:Exception}, ${3:e}:
|
||||||
${4:raise $3}
|
${4:raise $3}
|
||||||
snippet try Try/Except/Else
|
snippet try Try/Except/Else
|
||||||
try:
|
try:
|
||||||
${1:# TODO: write code...}
|
${1}
|
||||||
except ${2:Exception}, ${3:e}:
|
except ${2:Exception}, ${3:e}:
|
||||||
${4:raise $3}
|
${4:raise $3}
|
||||||
else:
|
else:
|
||||||
${5:# TODO: write code...}
|
${5}
|
||||||
snippet try Try/Except/Finally
|
snippet try Try/Except/Finally
|
||||||
try:
|
try:
|
||||||
${1:# TODO: write code...}
|
${1}
|
||||||
except ${2:Exception}, ${3:e}:
|
except ${2:Exception}, ${3:e}:
|
||||||
${4:raise $3}
|
${4:raise $3}
|
||||||
finally:
|
finally:
|
||||||
${5:# TODO: write code...}
|
${5}
|
||||||
snippet try Try/Except/Else/Finally
|
snippet try Try/Except/Else/Finally
|
||||||
try:
|
try:
|
||||||
${1:# TODO: write code...}
|
${1}
|
||||||
except ${2:Exception}, ${3:e}:
|
except ${2:Exception}, ${3:e}:
|
||||||
${4:raise $3}
|
${4:raise $3}
|
||||||
else:
|
else:
|
||||||
${5:# TODO: write code...}
|
${5}
|
||||||
finally:
|
finally:
|
||||||
${6:# TODO: write code...}
|
${6}
|
||||||
# if __name__ == '__main__':
|
# if __name__ == '__main__':
|
||||||
snippet ifmain
|
snippet ifmain
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
@ -136,13 +136,13 @@ snippet "
|
|||||||
# test function/method
|
# test function/method
|
||||||
snippet test
|
snippet test
|
||||||
def test_${1:description}(${2:`indent('.') ? 'self' : ''`}):
|
def test_${1:description}(${2:`indent('.') ? 'self' : ''`}):
|
||||||
${3:# TODO: write code...}
|
${3}
|
||||||
# test case
|
# test case
|
||||||
snippet testcase
|
snippet testcase
|
||||||
class ${1:ExampleCase}(unittest.TestCase):
|
class ${1:ExampleCase}(unittest.TestCase):
|
||||||
|
|
||||||
def test_${2:description}(self):
|
def test_${2:description}(self):
|
||||||
${3:# TODO: write code...}
|
${3}
|
||||||
snippet fut
|
snippet fut
|
||||||
from __future__ import ${1}
|
from __future__ import ${1}
|
||||||
#getopt
|
#getopt
|
||||||
|
@ -12,24 +12,24 @@ snippet source
|
|||||||
# conditionals
|
# conditionals
|
||||||
snippet if
|
snippet if
|
||||||
if (${1:condition}) {
|
if (${1:condition}) {
|
||||||
${2:code}
|
${2}
|
||||||
}
|
}
|
||||||
snippet el
|
snippet el
|
||||||
else {
|
else {
|
||||||
${1:code}
|
${1}
|
||||||
}
|
}
|
||||||
snippet ei
|
snippet ei
|
||||||
else if (${1:condition}) {
|
else if (${1:condition}) {
|
||||||
${2:code}
|
${2}
|
||||||
}
|
}
|
||||||
|
|
||||||
# functions
|
# functions
|
||||||
snippet fun
|
snippet fun
|
||||||
${1:name} = function (${2:variables}) {
|
${1:name} = function (${2:variables}) {
|
||||||
${3:code}
|
${3}
|
||||||
}
|
}
|
||||||
snippet ret
|
snippet ret
|
||||||
return(${1:code})
|
return(${1})
|
||||||
|
|
||||||
# dataframes, lists, etc
|
# dataframes, lists, etc
|
||||||
snippet df
|
snippet df
|
||||||
|
@ -7,61 +7,61 @@
|
|||||||
#if
|
#if
|
||||||
snippet if
|
snippet if
|
||||||
if(${1:obj}) {
|
if(${1:obj}) {
|
||||||
${2:/* code */}
|
${2}
|
||||||
}
|
}
|
||||||
#if not
|
#if not
|
||||||
snippet ifn
|
snippet ifn
|
||||||
if(!${1:obj}) {
|
if(!${1:obj}) {
|
||||||
${2:/* code */}
|
${2}
|
||||||
}
|
}
|
||||||
#if-else
|
#if-else
|
||||||
snippet ifel
|
snippet ifel
|
||||||
if(${1:obj}) {
|
if(${1:obj}) {
|
||||||
${2:/* code */}
|
${2}
|
||||||
} else {
|
} else {
|
||||||
${3:/* code */}
|
${3}
|
||||||
}
|
}
|
||||||
#if-else-if
|
#if-else-if
|
||||||
snippet ifelif
|
snippet ifelif
|
||||||
if(${1:obj}) {
|
if(${1:obj}) {
|
||||||
${2:/* code */}
|
${2}
|
||||||
} else if(${3:obj}) {
|
} else if(${3:obj}) {
|
||||||
${4:/* code */}
|
${4}
|
||||||
}
|
}
|
||||||
#while loop
|
#while loop
|
||||||
snippet while
|
snippet while
|
||||||
while (${1:obj}) {
|
while (${1:obj}) {
|
||||||
${2:/* code */}
|
${2}
|
||||||
}
|
}
|
||||||
#for loop(classic)
|
#for loop(classic)
|
||||||
snippet for
|
snippet for
|
||||||
for (${1:item} <- ${2:obj}) {
|
for (${1:item} <- ${2:obj}) {
|
||||||
${3:/* code */}
|
${3}
|
||||||
}
|
}
|
||||||
#for loop(indexed)
|
#for loop(indexed)
|
||||||
snippet fori
|
snippet fori
|
||||||
for (${1:i} <- ${2:0} to ${3:obj}.length) {
|
for (${1:i} <- ${2:0} to ${3:obj}.length) {
|
||||||
${4:/* code */}
|
${4}
|
||||||
}
|
}
|
||||||
#exceptions
|
#exceptions
|
||||||
snippet try
|
snippet try
|
||||||
try {
|
try {
|
||||||
${1:/* code */}
|
${1}
|
||||||
} catch {
|
} catch {
|
||||||
case e: FileNotFoundException => ${2:/* code */}
|
case e: FileNotFoundException => ${2}
|
||||||
case e: IOException => ${3:/* code */}
|
case e: IOException => ${3}
|
||||||
} finally {
|
} finally {
|
||||||
${4:/* code */}
|
${4}
|
||||||
}
|
}
|
||||||
#match
|
#match
|
||||||
snippet match
|
snippet match
|
||||||
${1: obj} match {
|
${1: obj} match {
|
||||||
case ${2:e} => ${3:/* code */}
|
case ${2:e} => ${3}
|
||||||
case _ => ${4:/* code */}
|
case _ => ${4}
|
||||||
}
|
}
|
||||||
#case
|
#case
|
||||||
snippet case
|
snippet case
|
||||||
case ${1:value} => ${2:/* code */}
|
case ${1:value} => ${2}
|
||||||
############################
|
############################
|
||||||
# methods and arguments
|
# methods and arguments
|
||||||
#
|
#
|
||||||
@ -82,9 +82,9 @@ snippet ovdef
|
|||||||
override def ${1:name}(${2:arg}) = ${3:}
|
override def ${1:name}(${2:arg}) = ${3:}
|
||||||
#first class function(see scalabook p 188)
|
#first class function(see scalabook p 188)
|
||||||
snippet fcf
|
snippet fcf
|
||||||
(${1:a}: ${2:T}) => $1 ${3:/* code */}
|
(${1:a}: ${2:T}) => $1 ${3}
|
||||||
snippet =>
|
snippet =>
|
||||||
${1:name} => ${2:/* code */}
|
${1:name} => ${2}
|
||||||
#recursion
|
#recursion
|
||||||
snippet rec
|
snippet rec
|
||||||
def ${1:name}(${2:arg}) =
|
def ${1:name}(${2:arg}) =
|
||||||
@ -196,11 +196,11 @@ snippet as
|
|||||||
|
|
||||||
#scope() with one arg
|
#scope() with one arg
|
||||||
snippet (a
|
snippet (a
|
||||||
(${1:a} => ${2:/* code */})
|
(${1:a} => ${2})
|
||||||
#scope() with two args
|
#scope() with two args
|
||||||
snippet {(
|
snippet {(
|
||||||
{(${1:a},${2:b}) =>
|
{(${1:a},${2:b}) =>
|
||||||
${3:/* code */}
|
${3}
|
||||||
}
|
}
|
||||||
#filter
|
#filter
|
||||||
snippet filter
|
snippet filter
|
||||||
@ -220,10 +220,10 @@ snippet fldr
|
|||||||
#fold left operator(if u wanna reduce readability of ur code)
|
#fold left operator(if u wanna reduce readability of ur code)
|
||||||
#use wildcard symbols
|
#use wildcard symbols
|
||||||
snippet /:
|
snippet /:
|
||||||
(${1:first}/:${2:name})(${3:/* code */})
|
(${1:first}/:${2:name})(${3})
|
||||||
#fold right operator
|
#fold right operator
|
||||||
snippet :\
|
snippet :\
|
||||||
(${1:first}:\${2:name})(${3:/* code */})
|
(${1:first}:\${2:name})(${3})
|
||||||
#reduce left
|
#reduce left
|
||||||
snippet redl
|
snippet redl
|
||||||
${1:name}.reduceLeft[${2:T}] {(
|
${1:name}.reduceLeft[${2:T}] {(
|
||||||
@ -258,13 +258,13 @@ snippet athis
|
|||||||
snippet abstract
|
snippet abstract
|
||||||
abstract class ${1:name}${2:(arg)}${3: extends }${4: with} {
|
abstract class ${1:name}${2:(arg)}${3: extends }${4: with} {
|
||||||
${5:override def toString = "$1"}
|
${5:override def toString = "$1"}
|
||||||
${6:/* code */}
|
${6}
|
||||||
}
|
}
|
||||||
#class
|
#class
|
||||||
snippet class
|
snippet class
|
||||||
class ${1:name}${2:(arg)}${3: extends }${4: with} {
|
class ${1:name}${2:(arg)}${3: extends }${4: with} {
|
||||||
${5:override def toString = "$1"}
|
${5:override def toString = "$1"}
|
||||||
${6:/* code */}
|
${6}
|
||||||
}
|
}
|
||||||
#object
|
#object
|
||||||
snippet object
|
snippet object
|
||||||
@ -279,7 +279,7 @@ snippet ordered
|
|||||||
class ${1:name}${2:(arg)} extends Ordered[$1] ${3: with} {
|
class ${1:name}${2:(arg)} extends Ordered[$1] ${3: with} {
|
||||||
${4:override def toString = "$1"}
|
${4:override def toString = "$1"}
|
||||||
def compare(that: $1) = ${5:this - that}
|
def compare(that: $1) = ${5:this - that}
|
||||||
${6:/* code */}
|
${6}
|
||||||
}
|
}
|
||||||
#case class
|
#case class
|
||||||
snippet casecl
|
snippet casecl
|
||||||
|
@ -10,7 +10,7 @@ snippet guard
|
|||||||
let $1 = 1${3}
|
let $1 = 1${3}
|
||||||
snippet f
|
snippet f
|
||||||
fun! ${1:`expand('%') =~ 'autoload' ? substitute(matchstr(expand('%:p'),'autoload/\zs.*\ze.vim'),'[/\\]','#','g').'#' : ''`}${2:function_name}(${3})
|
fun! ${1:`expand('%') =~ 'autoload' ? substitute(matchstr(expand('%:p'),'autoload/\zs.*\ze.vim'),'[/\\]','#','g').'#' : ''`}${2:function_name}(${3})
|
||||||
${4:" code}
|
${4}
|
||||||
endf
|
endf
|
||||||
snippet t
|
snippet t
|
||||||
try
|
try
|
||||||
@ -20,15 +20,15 @@ snippet t
|
|||||||
endtry
|
endtry
|
||||||
snippet for
|
snippet for
|
||||||
for ${1:needle} in ${2:haystack}
|
for ${1:needle} in ${2:haystack}
|
||||||
${3:" code}
|
${3}
|
||||||
endfor
|
endfor
|
||||||
snippet wh
|
snippet wh
|
||||||
while ${1:condition}
|
while ${1:condition}
|
||||||
${2:" code}
|
${2}
|
||||||
endw
|
endw
|
||||||
snippet if
|
snippet if
|
||||||
if ${1:condition}
|
if ${1:condition}
|
||||||
${2:" code}
|
${2}
|
||||||
endif
|
endif
|
||||||
snippet ife
|
snippet ife
|
||||||
if ${1:condition}
|
if ${1:condition}
|
||||||
|
Loading…
Reference in New Issue
Block a user