mirror of
https://github.com/amix/vimrc
synced 2025-06-28 18:44:59 +08:00
Updated all the plugins. Removed powerline. Added vim-airline (replacement for powerline). Added vim-fugitive.
This commit is contained in:
@ -0,0 +1,30 @@
|
||||
# sugguestion? report bugs?
|
||||
# please go to https://github.com/chrisyue/vim-snippets/issues
|
||||
snippet test "phpunit test class" b
|
||||
namespace `!p
|
||||
abspath = os.path.abspath(path)
|
||||
m = re.search(r'[A-Z].+(?=/)', abspath)
|
||||
if m:
|
||||
snip.rv = m.group().replace('/', '\\')
|
||||
`;
|
||||
|
||||
/**
|
||||
* @author `whoami`
|
||||
*/
|
||||
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
|
@ -1,3 +1,6 @@
|
||||
# sugguestion? report bugs?
|
||||
# go to https://github.com/chrisyue/vim-snippets/issues
|
||||
|
||||
snippet contr "symfony2 controller" b
|
||||
namespace `!p
|
||||
abspath = os.path.abspath(path)
|
||||
@ -13,7 +16,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
* ${1:@author `whoami`}${2}
|
||||
* ${1:@author `whoami`}
|
||||
*/
|
||||
class `!p
|
||||
snip.rv = re.match(r'.*(?=\.)', fn).group()
|
||||
@ -23,6 +26,18 @@ snip.rv = re.match(r'.*(?=\.)', fn).group()
|
||||
endsnippet
|
||||
|
||||
snippet act "symfony2 action" b
|
||||
/**
|
||||
* @Route("${3}", name="${4}")
|
||||
* @Method({${5:"POST"}})
|
||||
*/
|
||||
public function ${1}Action(${2})
|
||||
{
|
||||
${6}
|
||||
return $this->redirect($this->generateUrl('home', [], false));
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet actt "symfony2 action and template" b
|
||||
/**
|
||||
* @Route("${3}", name="${4}")
|
||||
* @Method({${5:"GET"}})
|
||||
@ -32,7 +47,8 @@ public function ${1}Action(${2})
|
||||
{
|
||||
${6}
|
||||
return [];
|
||||
}
|
||||
}`!p
|
||||
abspath = os.path.abspath(path)`
|
||||
endsnippet
|
||||
|
||||
snippet comm "symfony2 command" b
|
||||
@ -50,7 +66,7 @@ use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
/**
|
||||
* ${3:@author `whoami`}${4}
|
||||
* ${3:@author `whoami`}
|
||||
*/
|
||||
class `!p
|
||||
snip.rv = re.match(r'.*(?=\.)', fn).group()
|
||||
@ -73,3 +89,149 @@ snip.rv = re.match(r'.*(?=\.)', fn).group()
|
||||
}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet subs "symfony2 subscriber" b
|
||||
namespace `!p
|
||||
abspath = os.path.abspath(path)
|
||||
m = re.search(r'[A-Z].+(?=/)', abspath)
|
||||
if m:
|
||||
snip.rv = m.group().replace('/', '\\')
|
||||
`;
|
||||
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
|
||||
/**
|
||||
* ${1:@author `whoami`}
|
||||
*/
|
||||
class `!p
|
||||
snip.rv = re.match(r'.*(?=\.)', fn).group()
|
||||
` implements EventSubscriberInterface
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static function getSubscribedEvents()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet transf "symfony2 form data transformer" b
|
||||
namespace `!p
|
||||
abspath = os.path.abspath(path)
|
||||
m = re.search(r'[A-Z].+(?=/)', abspath)
|
||||
if m:
|
||||
snip.rv = m.group().replace('/', '\\')
|
||||
`;
|
||||
|
||||
use Symfony\Component\Form\DataTransformerInterface;
|
||||
use Symfony\Component\Form\Exception\TransformationFailedException;
|
||||
|
||||
/**
|
||||
* ${3:@author `whoami`}
|
||||
*/
|
||||
class `!p
|
||||
snip.rv = re.match(r'.*(?=\.)', fn).group()
|
||||
` implements DataTransformerInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function transform(${1})
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function reverseTransform(${2})
|
||||
{
|
||||
}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet ent "symfony2 doctrine entity" b
|
||||
namespace `!p
|
||||
abspath = os.path.abspath(path)
|
||||
m = re.search(r'[A-Z].+(?=/)', abspath)
|
||||
if m:
|
||||
snip.rv = m.group().replace('/', '\\')
|
||||
`;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* ${3:@author `whoami`}
|
||||
*
|
||||
* @ORM\Entity()
|
||||
* @ORM\Table(name="`!p
|
||||
tmp = re.match(r'.*(?=\.)', fn).group()
|
||||
tmp = re.sub(r'\B([A-Z])', r'_\1', tmp)
|
||||
snip.rv = tmp.lower()
|
||||
`")
|
||||
*/
|
||||
`!p
|
||||
m = re.search(r'Abstract', path)
|
||||
if m:
|
||||
snip.rv = 'abstract '
|
||||
`class `!p
|
||||
snip.rv = re.match(r'.*(?=\.)', fn).group()
|
||||
`
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Id
|
||||
*/
|
||||
private $id;
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet form "symfony2 form type" b
|
||||
namespace `!p
|
||||
abspath = os.path.abspath(path)
|
||||
m = re.search(r'[A-Z].+(?=/)', abspath)
|
||||
if m:
|
||||
snip.rv = m.group().replace('/', '\\')
|
||||
`;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
|
||||
|
||||
/**
|
||||
* ${2:@author `whoami`}
|
||||
*/
|
||||
class `!p
|
||||
snip.rv = re.match(r'.*(?=\.)', fn).group()
|
||||
` extends AbstractType
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function setDefaultOptions(OptionsResolverInterface $resolver)
|
||||
{
|
||||
$resolver->setDefaults();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return '${1}';
|
||||
}
|
||||
}
|
||||
endsnippet
|
||||
|
Reference in New Issue
Block a user