Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qbbr/vim-symfony
Symfony Vim plugin
https://github.com/qbbr/vim-symfony
snippets symfony vim
Last synced: 18 days ago
JSON representation
Symfony Vim plugin
- Host: GitHub
- URL: https://github.com/qbbr/vim-symfony
- Owner: qbbr
- Created: 2011-12-25T06:41:17.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2023-12-14T15:21:21.000Z (about 1 year ago)
- Last Synced: 2023-12-14T16:35:38.014Z (about 1 year ago)
- Topics: snippets, symfony, vim
- Language: Vim Script
- Homepage:
- Size: 38.1 KB
- Stars: 28
- Watchers: 4
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Symfony Vim plugin
for SF2/3 see [sf-2-3](https://github.com/qbbr/vim-symfony/tree/sf-2-3) branch
## Autocomplete routes and services
``
## Jumps
`v`
* jump to controller from routes.yaml
* jump to view (twig) from controller
* jump to view (twig) from view (twig)### Examples
```yaml
index:
path: /
controller: App\Controller\DefaultController::index
# will be open: src/Controller/DefaultController.php and goto action line
``````php
class DefaultController extends Controller
{
public function index()
{
// will be open: templates/default/index.html.twig
return $this->render('default/index.html.twig', [ // cursor here and press v
'controller_name' => 'IndexController',
]);
}
}
``````twig
{% extends 'base.html.twig' %}
{# will be open: templates/base.html.twig #}
```## Snippets
### Annotations
* `@a` - @Assert\
* `@o` - @ORM\
* `@oc` - @ORM\Column()
* `@oe` - @ORM\Entity(repositoryClass="")
* `@og` - @ORM\GeneratedValue(strategy="AUTO")
* `@oi` - @ORM\Id
* `@olife` - @ORM\HasLifecycleCallbacks()
* `@ot` - @ORM\Table(name="")
* `@r` - @Route("")
* `@rn` - @Route("", name="")
* `@m` - @Method("")
* `@t` - @Template()
* `@pc` - @ParamConverter("")### `Use` statements
* `usearray` - use Doctrine\Common\Collections\ArrayCollection;
* `useassert` - use Symfony\Component\Validator\Constraints as Assert;
* `usecache` - use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
* `usecontroller` - use Symfony\Bundle\FrameworkBundle\Controller\Controller;
* `usefile` - use Symfony\Component\HttpFoundation\File\UploadedFile;
* `usemethod` - use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
* `usenotfound` - use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* `useorm` - use Doctrine\ORM\Mapping as ORM;
* `useparamconverter` - use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
* `userequest` - use Symfony\Component\HttpFoundation\Request;
* `useresponse` - use Symfony\Component\HttpFoundation\Response;
* `usejsonresponse` - use Symfony\Component\HttpFoundation\JsonResponse;
* `useroute` - use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
* `usesecurity` - use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
* `usetemplate` - use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;### Controller
* `controller` - controller skeleton class
* `dump`, `d` - dump() function
* `get` - $this->get('')
* `am` - action method for controller
* `em` - $em = $this->getDoctrine()->getManager();
* `notfound` - throw $this->createNotFoundException('');
* `redirect` - $this->redirectToRoute('');
* `repository` - $this->getDoctrine()->getRepository('')### Form
* `form` - form type skeleton class
#### Text Fields
* `texttype` - use Symfony\Component\Form\Extension\Core\Type\TextType;
* `textareatype` - use Symfony\Component\Form\Extension\Core\Type\TextareaType;
* `emailtype` - use Symfony\Component\Form\Extension\Core\Type\EmailType;
* `integertype` - use Symfony\Component\Form\Extension\Core\Type\IntegerType;
* `moneytype` - use Symfony\Component\Form\Extension\Core\Type\MoneyType;
* `numbertype` - use Symfony\Component\Form\Extension\Core\Type\NumberType;
* `passwordtype` - use Symfony\Component\Form\Extension\Core\Type\PasswordType;
* `percenttype` - use Symfony\Component\Form\Extension\Core\Type\PercentType;
* `searchtype` - use Symfony\Component\Form\Extension\Core\Type\SearchType;
* `urltype` - use Symfony\Component\Form\Extension\Core\Type\UrlType;
* `rangetype` - use Symfony\Component\Form\Extension\Core\Type\RangeType;#### Choice Fields
* `choicetype` - use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
* `entitytype` - use Symfony\Bridge\Doctrine\Form\Type\EntityType;
* `countrytype` - use Symfony\Bridge\Doctrine\Form\Type\CountryType;
* `languagetype` - use Symfony\Bridge\Doctrine\Form\Type\LanguageType;
* `localetype` - use Symfony\Bridge\Doctrine\Form\Type\LocaleType;
* `timezonetype` - use Symfony\Bridge\Doctrine\Form\Type\TimezoneType;
* `currencytype` - use Symfony\Bridge\Doctrine\Form\Type\CurrencyType;#### Date and Time Fields
* `datetype` - use Symfony\Component\Form\Extension\Core\Type\DateType;
* `datetimetype` - use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
* `timetype` - use Symfony\Component\Form\Extension\Core\Type\TimeType;
* `birthdaytype` - use Symfony\Component\Form\Extension\Core\Type\BirthdayType;#### Other Fields
* `checkboxtype` - use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
* `filetype` - use Symfony\Component\Form\Extension\Core\Type\FileType;
* `radiotype` - use Symfony\Component\Form\Extension\Core\Type\RadioType;#### Field Groups
* `collectiontype` - use Symfony\Component\Form\Extension\Core\Type\CollectionType;
* `repeatedtype` - use Symfony\Component\Form\Extension\Core\Type\RepeatedType;#### Hidden Fields
* `hiddentype` - use Symfony\Component\Form\Extension\Core\Type\HiddenType;
#### Buttons
* `buttontype` - use Symfony\Component\Form\Extension\Core\Type\ButtonType;
* `resettype` - use Symfony\Component\Form\Extension\Core\Type\ResetType;
* `submittype` - use Symfony\Component\Form\Extension\Core\Type\SubmitType;#### Base Fields
* `formtype` - use Symfony\Component\Form\Extension\Core\Type\FormType;