1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 09:35:01 +08:00

Updated plugins

This commit is contained in:
amix
2016-06-11 15:56:50 +02:00
parent cc0e8a9907
commit 0228ad0e9e
60 changed files with 1341 additions and 784 deletions

View File

@ -1,8 +1,9 @@
# Snippets for phpspec
# Snippets for phpspec, to use add the following to your .vimrc
# `autocmd BufRead,BufNewFile,BufEnter *Spec.php UltiSnipsAddFiletypes php-phpspec`
priority -50
snippet spec "phpspec class" b
snippet spec "class XYZSpec extends ObjectBehaviour"
<?php
namespace `!p
@ -22,17 +23,200 @@ class `!p
snip.rv = re.match(r'.*(?=\.)', fn).group()
` extends ObjectBehavior
{
public function it${1:_does_something}()
function it${1}()
{
$0
}
}
endsnippet
snippet it "phpspec function it..." b
public function it${1:_does_something}()
snippet it "function it_does_something() { ... }"
function it${1}()
{
$0
${0:${VISUAL}}
}
endsnippet
snippet let "function let() { ... }"
function let()
{
${0:${VISUAL}}
}
endsnippet
snippet letgo "function letgo() { ... }"
function letgo()
{
${0:${VISUAL}}
}
endsnippet
# Object construction
snippet cw "$this->beConstructedWith($arg)"
$this->beConstructedWith(${1});
endsnippet
snippet ct "$this->beConstructedThrough($methodName, [$arg])"
$this->beConstructedThrough(${1:'methodName'}, [${2:'$arg'}]);
endsnippet
# Identity and comparison matchers
snippet sreturn "$this->XYZ()->shouldReturn('value')"
$this->${1:method}()->shouldReturn(${2:'value'});
endsnippet
snippet snreturn "$this->XYZ()->shouldNotReturn('value')"
$this->${1:method}()->shouldNotReturn(${2:'value'});
endsnippet
snippet sbe "$this->XYZ()->shouldBe('value')"
$this->${1:method}()->shouldBe(${2:'value'});
endsnippet
snippet snbe "$this->XYZ()->shouldNotBe('value')"
$this->${1:method}()->shouldNotBe(${2:'value'});
endsnippet
snippet sequal "$this->XYZ()->shouldEqual('value')"
$this->${1:method}()->shouldEqual(${2:'value'});
endsnippet
snippet snequal "$this->XYZ()->shouldNotEqual('value')"
$this->${1:method}()->shouldNotEqual(${2:'value'});
endsnippet
snippet sbequalto "$this->XYZ()->shouldBeEqualTo('value')"
$this->${1:method}()->shouldBeEqualTo(${2:'value'});
endsnippet
snippet snbequalto "$this->XYZ()->shouldNotBeEqualTo('value')"
$this->${1:method}()->shouldNotBeEqualTo(${2:'value'});
endsnippet
snippet sblike "$this->XYZ()->shouldBeLike('value')"
$this->${1:method}()->shouldBeLike(${2:'value'});
endsnippet
snippet snblike "$this->XYZ()->shouldNotBeLike('value')"
$this->${1:method}()->shouldNotBeLike(${2:'value'});
endsnippet
# Throw matcher
snippet sthrowm "$this->shouldThrow('\Exception')->duringXYZ($arg)"
$this->shouldThrow(${1:'\Exception'})->during${2:Method}(${3:'$arg'});
endsnippet
snippet sthrowi "$this->shouldThrow('\Exception')->duringInstantiation()"
$this->shouldThrow(${1:'\Exception'})->duringInstantiation();
endsnippet
# Type matchers
snippet stype "$this->shouldHaveType('Type')"
$this->shouldHaveType(${1});
endsnippet
snippet sntype "$this->shouldNotHaveType('Type')"
$this->shouldNotHaveType(${1});
endsnippet
snippet srinstance "$this->shouldReturnAnInstanceOf('Type')"
$this->shouldReturnAnInstanceOf(${1});
endsnippet
snippet snrinstance "$this->shouldNotReturnAnInstanceOf('Type')"
$this->shouldNotReturnAnInstanceOf(${1});
endsnippet
snippet sbinstance "$this->shouldBeAnInstanceOf('Type')"
$this->shouldBeAnInstanceOf(${1});
endsnippet
snippet snbinstance "$this->shouldNotBeAnInstanceOf('Type')"
$this->shouldNotBeAnInstanceOf(${1});
endsnippet
snippet simplement "$this->shouldImplement('Type')"
$this->shouldImplement(${1});
endsnippet
snippet snimplement "$this->shouldNotImplement('Type')"
$this->shouldNotImplement(${1});
endsnippet
# Object state matchers
snippet sbstate "$this->shouldBeXYZ()"
$this->shouldBe${1}();
endsnippet
snippet snbstate "$this->shouldNotBeXYZ()"
$this->shouldNotBe${1}();
endsnippet
# Count matchers
snippet scount "$this->XYZ()->shouldHaveCount(7)"
$this->${1:method}()->shouldHaveCount(${2:7});
endsnippet
snippet sncount "$this->XYZ()->shouldNotHaveCount(7)"
$this->${1:method}()->shouldNotHaveCount(${2:7});
endsnippet
# Scalar type matchers
snippet sbscalar "$this->XYZ()->shouldBeString|Array|Bool()"
$this->${1:method}()->shouldBe(${2:'String|Array|Bool'});
endsnippet
snippet snbscalar "$this->XYZ()->shouldNotBeString|Array|Bool()"
$this->${1:method}()->shouldNotBe(${2:'String|Array|Bool'});
endsnippet
# Contain matcher
snippet scontain "$this->XYZ()->shouldContain('value')"
$this->${1:method}()->shouldContain(${2:'value'});
endsnippet
snippet sncontain "$this->XYZ()->shouldNotContain('value')"
$this->${1:method}()->shouldNotContain(${2:'value'});
endsnippet
# Array matchers
snippet skey "$this->XYZ()->shouldHaveKey('key')"
$this->${1:method}()->shouldHaveKey(${2:'key'});
endsnippet
snippet snkey "$this->XYZ()->shouldNotHaveKey('key')"
$this->${1:method}()->shouldNotHaveKey(${2:'key'});
endsnippet
snippet skeyvalue "$this->XYZ()->shouldHaveKeyWithValue('key', 'value')"
$this->${1:method}()->shouldHaveKeyWithValue(${2:'key'}, ${3:'value'});
endsnippet
snippet snkeyvalue "$this->XYZ()->shouldNotHaveKeyWithValue('key', 'value')"
$this->${1:method}()->shouldNotHaveKeyWithValue(${2:'key'}, ${3:'value'});
endsnippet
# String matchers
snippet sstart "$this->XYZ()->shouldStartWith('string')"
$this->${1:method}()->shouldStartWith(${2:'string'});
endsnippet
snippet snstart "$this->XYZ()->shouldNotStartWith('string')"
$this->${1:method}()->shouldNotStartWith(${2:'string'});
endsnippet
snippet send "$this->XYZ()->shouldEndWith('string')"
$this->${1:method}()->shouldEndWith(${2:'string'});
endsnippet
snippet snend "$this->XYZ()->shouldNotEndWith('string')"
$this->${1:method}()->shouldNotEndWith(${2:'string'});
endsnippet
snippet smatch "$this->XYZ()->shouldMatch('/wizard/i')"
$this->${1:method}()->shouldMatch(${2:'/wizard/i'});
endsnippet
snippet snmatch "$this->XYZ()->shouldNotMatch('/wizard/i')"
$this->${1:method}()->shouldNotMatch(${2:'/wizard/i'});
endsnippet

View File

@ -1,40 +0,0 @@
# suggestion? report bugs?
# please go to https://github.com/chrisyue/vim-snippets/issues
priority -50
snippet test "phpunit test class" b
<?php
namespace `!p
relpath = os.path.relpath(path)
m = re.search(r'[A-Z].+(?=/)', relpath)
if m:
snip.rv = m.group().replace('/', '\\')
`;
/**
* @author `!v g:snips_author`
*/
class `!p
snip.rv = re.match(r'.*(?=\.)', fn).group()
` extends \PHPUnit_Framework_TestCase
{
public function test${1}()
{
${2}
}
}
endsnippet
snippet exp "phpunit expects" i
expects($this->${1:once}())
->method('${2}')
->with($this->equalTo(${3})${4})
->will($this->returnValue(${5}));
endsnippet
snippet testcmt "phpunit comment with group" b
/**
* @group ${1}
*/
endsnippet

View File

@ -3,119 +3,11 @@ priority -50
## Snippets from SnipMate, taken from
## https://github.com/scrooloose/snipmate-snippets.git
snippet array "array"
$${1:arrayName} = array('${2}' => ${3});${4}
endsnippet
snippet def "def"
define('${1:VARIABLE_NAME}', ${2:'definition'});${3}
endsnippet
snippet wh "while"
while (${1}) {
${0:${VISUAL}}
}
endsnippet
snippet do "do"
do {
${2:// code... }
} while (${1:/* condition */});
endsnippet
snippet doc_f "doc_f"
/**
* $2
* @return ${4:void}
* @author ${5:`!v g:snips_author`}
**/
${1:public }function ${2:someFunc}(${3})
{${6}
}
endsnippet
snippet doc_i "doc_i"
/**
* $1
* @package ${2:default}
* @author ${3:`!v g:snips_author`}
**/
interface ${1:someClass}
{${4}
} // END interface $1"
endsnippet
snippet el "else"
else {
${0:${VISUAL}}
}
endsnippet
snippet for "for"
for ($${2:i} = 0; $$2 < ${1:count}; $$2${3:++}) {
${4:// code...}
}
endsnippet
snippet foreachk "foreachk"
foreach ($${1:variable} as $${2:key} => $${3:value}) {
${4:// code...}
}
endsnippet
snippet get "get"
$_GET['${1}']${2}
endsnippet
snippet if "if"
if (${1}) {
${0:${VISUAL}}
}
endsnippet
snippet eif "elseif"
elseif (${1}) {
${0:${VISUAL}}
}
endsnippet
snippet inc "inc"
include '${1:file}';${2}
endsnippet
snippet log "log"
error_log(var_export(${1}, true));${2}
endsnippet
snippet post "post"
$_POST['${1}']${2}
endsnippet
snippet req "req1"
require_once '${1:file}';${2}
endsnippet
snippet req1 "req1"
require_once '${1:file}';${2}
endsnippet
snippet session "session"
$_SESSION['${1}']${2}
endsnippet
snippet t "t"
$${1:retVal} = (${2:condition}) ? ${3:a} : ${4:b};${5}
endsnippet
snippet var "var"
var_export(${1});${2}
endsnippet
snippet getter "PHP Class Getter" b
/**
* Getter for $1
*
* ${2:return string}
* @return ${2:string}
*/
public function get${1/\w+\s*/\u$0/}()
{
@ -127,7 +19,7 @@ snippet setter "PHP Class Setter" b
/**
* Setter for $1
*
* @param ${2:string} $$1
* @param ${2:string} $$1
* @return ${3:`!p snip.rv=snip.basename`}
*/
public function set${1/\w+\s*/\u$0/}(${4:${2/(void|string|int|integer|double|float|object|boolear|null|mixed|number|resource)|(.*)/(?1::$2 )/}}$$1)
@ -143,7 +35,7 @@ snippet gs "PHP Class Getter Setter" b
/**
* Getter for $1
*
* return ${2:string}
* @return ${2:string}
*/
public function get${1/\w+\s*/\u$0/}()
{
@ -251,27 +143,11 @@ function ${1:name}(${2:$param})
$0
endsnippet
snippet fore "Foreach loop"
foreach ($${1:variable} as $${3:value}) {
${VISUAL}${4}
}
$0
endsnippet
snippet new "New class instance" b
$${1:variableName} = new ${2:${1/\w+\s*/\u$0/}}($3);
$0
endsnippet
snippet ife "if else"
if (${1:/* condition */}) {
${2:// code...}
} else {
${3:// code...}
}
$0
endsnippet
snippet ns "namespace declaration" b
namespace ${1:`!p
relpath = os.path.relpath(path)
@ -316,7 +192,7 @@ if m:
*/
interface $1
{
public function ${3:someFunction}();$4
public function ${3:someFunction}();$4
}
endsnippet
@ -349,18 +225,29 @@ public function __construct(${1:$dependencies})
$0
endsnippet
snippet ve "Dumb debug helper in HTML"
echo '<pre>' . var_export($1, 1) . '</pre>';$0
endsnippet
# PHPUnit snippets
snippet testcase "class XYZTest extends \PHPUnit_Framework_TestCase { ... }"
<?php
snippet pc "Dumb debug helper in cli"
var_export($1);$0
endsnippet
namespace `!p
relpath = os.path.relpath(path)
m = re.search(r'[A-Z].+(?=/)', relpath)
if m:
snip.rv = m.group().replace('/', '\\')
`;
snippet inheritdoc "@inheritdoc docblock"
/**
* {@inheritdoc}
* @author `!v g:snips_author`
*/
class `!p
snip.rv = re.match(r'.*(?=\.)', fn).group()
` extends \PHPUnit_Framework_TestCase
{
public function test${1}()
{
${0:${VISUAL}}
}
}
endsnippet
# :vim:ft=snippets:

View File

@ -1,53 +0,0 @@
priority -50
snippet bl "twig block" b
{% block ${1} %}
${2}
{% endblock $1 %}
endsnippet
snippet js "twig javascripts" b
{% javascripts '${1}' %}
<script src="{{ asset_url }}"></script>
{% endjavascripts %}
endsnippet
snippet css "twig stylesheets" b
{% stylesheets '${1}' %}
<link rel="stylesheet" href="{{ asset_url }}">
{% endstylesheets %}
endsnippet
snippet if "twig if" b
{% if ${1} %}
${0:${VISUAL}}
{% endif %}
endsnippet
snippet ife "twig if ... else" b
{% if ${1} %}
${2}
{% else %}
${0}
{% endif %}
endsnippet
snippet el "twig else"
{% else %}
${0:${VISUAL}}
endsnippet
snippet eif "twig elseif"
{% elseif ${1} %}
${0:${VISUAL}}
endsnippet
snippet for "twig for" b
{% for ${1} in ${2} %}
${3}
{% endfor %}
endsnippet
snippet ext "twig extends" b
{% extends ${1} %}
endsnippet

View File

@ -7,6 +7,8 @@ snippet date
`strftime("%Y-%m-%d")`
snippet ddate
`strftime("%B %d, %Y")`
snippet diso
`strftime("%Y-%m-%dT%H:%M:%S")`
snippet time
`strftime("%H:%M")`
snippet datetime

View File

@ -146,9 +146,9 @@ snippet itera
## Lambdas
# lamda (one line)
snippet ld
[${1}](${2}){${3}}
[${1}](${2}){${3}};
# lambda (multi-line)
snippet lld
[${1}](${2}){
${3}
}
};

View File

@ -114,7 +114,7 @@ snippet testa
end
snippet exunit
defmodule ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} do
use ExUnit.Case
use ExUnit.Case, async: true
${0}
end
@ -131,3 +131,6 @@ snippet qu
quote do
${1}
end
snippet beh
@behaviour ${1:Mix.Task}
${0}

View File

@ -0,0 +1,50 @@
snippet mod
module `substitute(substitute(expand('%:r'), '[/\\]','.','g'),'^\%(\l*\.\)\?','','')` exposing (${1})
${0}
snippet imp
import ${0:List}
snippet impe
import ${1:List} exposing (${0:map})
snippet fn
${1:fn} : ${2:a} -> ${3:a}
$1 ${4} =
${0}
snippet fn1
${1:fn} : ${2:a} -> ${3:a}
$1 ${4} =
${0}
snippet fn2
${1:fn} : ${2:a} -> ${3:a} -> ${4:a}
$1 ${5} =
${0}
snippet fn3
${1:fn} : ${2:a} -> ${3:a} -> ${4:a} -> ${5:a}
$1 ${6} =
${0}
snippet fn0
${1:fn} : ${2:a}
$1 =
${0}
snippet case
case ${1} of
${2} ->
${0}
snippet -
${1} ->
${0}
snippet let
let
${1} = ${2}
in
${0}
snippet if
if ${1} then
${2}
else
${0}
snippet ty
type ${1:Msg}
= ${0}
snippet tya
type alias ${1:Model} =
${0}

View File

@ -482,6 +482,37 @@ snippet gen_event
%%%===================================================================
%%% Internal functions
%%%===================================================================
# EUnit snippets
snippet eunit
-module(${1:`vim_snippets#Filename('', 'my')`}).
-include_lib("eunit/include/eunit.hrl").
${0}
snippet ieunit
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
${0}
-endif.
snippet as
?assert(${0})
snippet asn
?assertNot(${0})
snippet aseq
?assertEqual(${1}, ${0})
snippet asneq
?assertNotEqual(${1}, ${0})
snippet asmat
?assertMatch(${1:Pattern}, ${0:Expression})
snippet asnmat
?assertNotMatch(${1:Pattern}, ${0:Expression})
snippet aserr
?assertError(${1:Pattern}, ${0:Expression})
snippet asex
?assertExit(${1:Pattern}, ${0:Expression})
snippet asexc
?assertException(${1:Class}, ${2:Pattern}, ${0:Expression})
# common_test test_SUITE
snippet testsuite
-module(${0:`vim_snippets#Filename('', 'my')`}).

View File

@ -0,0 +1,14 @@
snippet des "Describe" b
describe('${1:}', () => {
${0}
});
snippet it "it" b
it('${1:}', () => {
${0}
});
snippet exp "expect" b
expect(${1:})${0};
snippet expe "expect" b
expect(${1:}).to.equal(${0});
snippet expd "expect" b
expect(${1:}).to.deep.equal(${0});

View File

@ -43,3 +43,8 @@ snippet el
# .DEFAULT_GOAL := target
snippet default
.DEFAULT_GOAL := ${1}
# help target for self-documented Makefile
snippet help
help: ## Prints help for targets with comments
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $\$1, $\$2}'
${0}

View File

@ -0,0 +1,18 @@
# if {{#value}} ... {{/value}}
snippet if
{{#${1:value}}}
${0}
{{/$1}}
# if not {{^value}} ... {{/value}}
snippet ifn
{{^${1:value}}}
${0}
{{/$1}}
# if else {{#value}} ... {{/value}} {{^value}} ... {{/value}}
snippet ife
{{#${1:value}}}
${2}
{{/$1}}
{{^$1}}
${3}
{{/$1}}

View File

@ -24,10 +24,7 @@ snippet ?i
snippet ns
namespace ${1:Foo\Bar\Baz};
${0}
snippet use
use ${1:Foo\Bar\Baz};
${0}
snippet c
snippet c
class ${1:`vim_snippets#Filename()`}
{
${0}
@ -81,13 +78,14 @@ snippet $s
#getter
snippet $g
${1:$foo}->get${0:Bar}();
# Tertiary conditional
snippet =?:
$${1:foo} = ${2:true} ? ${3:a} : ${0};
snippet ?:
${1:true} ? ${2:a} : ${0}
snippet t "$retVal = (condition) ? a : b"
$${1:retVal} = (${2:condition}) ? ${3:a} : ${4:b};
# Predefined variables
snippet C
$_COOKIE['${1:variable}']
snippet E
@ -104,7 +102,12 @@ snippet S
$_SERVER['${1:variable}']
snippet SS
$_SESSION['${1:variable}']
snippet get "get"
$_GET['${1}']
snippet post "post"
$_POST['${1}']
snippet session "session"
$_SESSION['${1}']
# the following are old ones
snippet inc
include '${1:file}';
@ -205,7 +208,19 @@ snippet doc_h
* @copyright ${4:$2}, `strftime('%d %B, %Y')`
* @package ${0:default}
*/
snippet doc_i "interface someClass {}"
/**
* $1
* @package ${2:default}
* @author ${3:`!v g:snips_author`}
**/
interface ${1:someClass}
{${4}
}
snippet inheritdoc "@inheritdoc docblock"
/**
* {@inheritdoc}
*/
# Interface
snippet interface
/**
@ -254,55 +269,54 @@ snippet nc
${0}
}
# define(...)
snippet def
define('${1}'${2});
snippet def "define('VARIABLE_NAME', 'definition')"
define('${1:VARIABLE_NAME}', ${2:'definition'});
# defined(...)
snippet def?
${1}defined('${2}')
snippet wh
snippet wh "while (condition) { ... }"
while (${1:/* condition */}) {
${0}
}
# do ... while
snippet do
snippet do "do { ... } while (condition)"
do {
${0}
} while (${1:/* condition */});
snippet if
if (${1:/* condition */}) {
} while (${1});
snippet if "if (condition) { ... }"
if (${1}) {
${0}
}
snippet ifn
if (!${1:/* condition */}) {
snippet ifn "if (!condition) { ... }"
if (!${1}) {
${2}
}
snippet ifil
<?php if (${1:/* condition */}): ?>
snippet ifil "<?php if (condition): ?> ... <?php endif; ?>"
<?php if (${1}): ?>
${0}
<?php endif; ?>
snippet ife
if (${1:/* condition */}) {
snippet ife "if (cond) { ... } else { ... }"
if (${1}) {
${2}
} else {
${3}
}
${0}
snippet ifeil
<?php if (${1:/* condition */}): ?>
${2:<!-- html... -->}
snippet ifeil "<?php if (condition): ?> ... <?php else: ?> ... <?php endif; ?>"
<?php if (${1}): ?>
${2}
<?php else: ?>
${3:<!-- html... -->}
${3}
<?php endif; ?>
${0}
snippet el
snippet el "else { ... }"
else {
${0}
}
snippet eif
snippet eif "elseif(condition) { ... }"
elseif (${1}) {
${0}
}
snippet switch
snippet switch "switch($var) { case 'xyz': ... default: .... }"
switch ($${1:variable}) {
case '${2:value}':
${3}
@ -312,34 +326,33 @@ snippet switch
${4}
break;
}
snippet case
snippet case "case 'value': ... break"
case '${1:value}':
${2}
break;
snippet for
snippet for "for ($i = 0; $i < $count; $i++) { ... }"
for ($${2:i} = 0; $$2 < ${1:count}; $$2${3:++}) {
${0}
}
snippet foreach
snippet foreach "foreach ($var as $value) { .. }"
foreach ($${1:variable} as $${2:value}) {
${0}
}
snippet foreachil
snippet foreachil "<?php foreach ($var as $value): ?> ... <?php endforeach; ?>"
<?php foreach ($${1:variable} as $${2:value}): ?>
${0:<!-- html... -->}
${0}
<?php endforeach; ?>
snippet foreachk
snippet foreachk "foreach ($var as $key => $value) { .. }"
foreach ($${1:variable} as $${2:key} => $${3:value}) {
${0}
}
snippet foreachkil
snippet foreachkil "<?php foreach ($var as $key => $value): ?> ... <?php endforeach; ?>"
<?php foreach ($${1:variable} as $${2:key} => $${3:value}): ?>
${0:<!-- html... -->}
<?php endforeach; ?>
# $... = array (...)
snippet array b
snippet array "$... = array(...)"
$${1:arrayName} = array('${2}' => ${3});
snippet try
snippet try "try { ... } catch (Exception $e) { ... }"
try {
${0}
} catch (${1:Exception} $e) {
@ -369,6 +382,14 @@ snippet http_redirect
header ("HTTP/1.1 301 Moved Permanently");
header ("Location: ".URL);
exit();
snippet log "error_log(var_export($var, true));"
error_log(var_export(${1}, true));
snippet var "var_export($var)"
var_export(${1});
snippet ve "Dumb debug helper in HTML"
echo '<pre>' . var_export(${1}, 1) . '</pre>';
snippet pc "Dumb debug helper in cli"
var_export($1);$0
# Getters & Setters
snippet gs
/**
@ -425,14 +446,12 @@ snippet aw
array_walk($${1:foo}, function(&$${2:v}, $${3:k}) {
$$2 = ${0};
});
# static var assign once
snippet static_var
static $${1} = null;
if (is_null($$1)){
$$1 = ${2};
}
snippet CSVWriter
<?php
@ -467,7 +486,6 @@ snippet CSVWriter
}
}
snippet CSVIterator
// http://snipplr.com/view.php?codeview&id=1986 // modified
@ -570,72 +588,75 @@ snippet CSVIterator
}
} // end class
snippet is
isset($1{VISUAL})
# phpunit
snippet ase
# phpunit
snippet ase "$this->assertEquals()"
$this->assertEquals(${1:expected}, ${2:actual});
snippet asne
snippet asne "$this->assertNotEquals()"
$this->assertNotEquals(${1:expected}, ${2:actual});
snippet asf
$this->assertFalse(${1:Something});
snippet ast
$this->assertTrue(${1:Something});
snippet asfex
$this->assertFileExists(${1:path/to/file});
snippet asfnex
$this->assertFileNotExists(${1:path/to/file});
snippet ascon
$this->assertContains(${1:Search Value}, ${2:Array or Iterator});
snippet ashk
$this->assertArrayHasKey(${1:key}, ${2:array});
snippet asnhk
this->assertArrayNotHasKey(${1:value}, ${2:array});
snippet ascha
$this->assertClassHasAttribute('${1:Attribute Name}', '${2:ClassName}');
snippet asi
snippet asf "$this->assertFalse()"
$this->assertFalse(${1});
snippet ast "$this->assertTrue()"
$this->assertTrue(${1});
snippet asfex "$this->assertFileExists()"
$this->assertFileExists(${1:'path/to/file'});
snippet asfnex "$this->assertFileNotExists()"
$this->assertFileNotExists(${1:'path/to/file'});
snippet ascon "$this->assertContains()"
$this->assertContains(${1:$needle}, ${2:$haystack});
snippet ashk "$this->assertArrayHasKey()"
$this->assertArrayHasKey(${1:$key}, ${2:$array});
snippet asnhk "$this->assertArrayNotHasKey()"
this->assertArrayNotHasKey(${1:$key}, ${2:$array});
snippet ascha "$this->assertClassHasAttribute()"
$this->assertClassHasAttribute(${1:$attributeName}, '${2:$className}');
snippet asi "$this->assertInstanceOf(...)"
$this->assertInstanceOf(${1:expected}, ${2:actual});
snippet tc
public function test${1:name_of_the_test}()
snippet test "public function testXYZ() { ... }"
public function test${1}()
{
${0:code}
${0}
}
snippet te
snippet setup "protected function setUp() { ... }"
protected function setUp()
{
${0}
}
snippet teardown "protected function tearDown() { ... }"
protected function tearDown()
{
${0}
}
snippet exp "phpunit expects"
expects($this->${1:once}())
->method('${2}')
->with($this->equalTo(${3})${4})
->will($this->returnValue(${5}));
snippet testcmt "phpunit comment with group"
/**
* @group ${1}
*/
snippet fail "$this->fail()"
$this->fail(${1});
snippet marki "$this->markTestIncomplete()"
$this->markTestIncomplete(${1});
snippet marks "$this->markTestSkipped()"
$this->markTestSkipped(${1});
# end of phpunit snippets
snippet te "throw new Exception()"
throw new ${1:Exception}("${2:Error Processing Request}");
snippet fpc "file_put_contents" b
file_put_contents(${1:file}, ${2:content}${3:, FILE_APPEND});$0
snippet sr "str_replace"
str_replace(${1:search}, ${2:replace}, ${3:subject})$0
snippet ia "in_array"
in_array(${1:needle}, ${2:haystack})$0
snippet is "isset"
isset(${1:var})$0
snippet isa "isset array"
isset($${1:array}[${2:key}])$0
snippet in "is_null"
is_null($${1:var})$0
snippet fe "file_exists"
file_exists(${1:file})$0
snippet id "is_dir"
is_dir(${1:path})$0

View File

@ -1,5 +1,7 @@
snippet enc
# encoding: utf-8
snippet frozen
# frozen_string_literal: true
snippet #!
#!/usr/bin/env ruby
# New Block

View File

@ -1,43 +1,34 @@
# twig block
snippet bl
snippet bl "{% block xyz %} .. {% endblock xyz %}"
{% block ${1} %}
${2}
{% endblock $1 %}
# twig javascripts
snippet js
snippet js "{% javascripts 'xyz' %} .. {% endjavascripts %}"
{% javascripts '${1}' %}
<script src="{{ asset_url }}"></script>
{% endjavascripts %}
# twig stylesheets
snippet css
snippet css "{% stylesheets 'xyz' %} .. {% endstylesheets %}"
{% stylesheets '${1}' %}
<link rel="stylesheet" href="{{ asset_url }}">
{% endstylesheets %}
# twig if
snippet if
snippet if "{% if %} .. {% endif %}"
{% if ${1} %}
${2}
{% endif %}
# twig if ... else
snippet ife
snippet ife "{% if %} .. {% else %} .. {% endif %}"
{% if ${1} %}
${2}
{% else %}
${0}
{% endif %}
# twig else
snippet el
snippet el "{% else %}"
{% else %}
${0}
# twig elseif
snippet eif
snippet eif "{% elseif %}"
{% elseif ${1} %}
${0}
# twig for
snippet for
snippet for "{% for x in y %} .. {% endfor %}"
{% for ${1} in ${2} %}
${3}
{% endfor %}
# twig extends
snippet ext
snippet ext "{% extends xyz %}"
{% extends ${1} %}