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