ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Evercode​Lab Sublime Snippets

by EvercodeLab ST2/ST3

Collection of SublimeText 2/3 snippets for Symfony 2, Ruby on Rails and JavaScript

Labels snippets

Details

  • 2014.11.25.09.21.39
  • github.​com
  • github.​com
  • 3 years ago
  • 1 day ago
  • 5 years ago

Installs

  • Total 1K
  • Win 547
  • OS X 371
  • Linux 266
Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9 Feb 8 Feb 7 Feb 6 Feb 5 Feb 4 Feb 3 Feb 2 Feb 1 Jan 31 Jan 30 Jan 29 Jan 28 Jan 27 Jan 26 Jan 25 Jan 24 Jan 23 Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10
Windows 0 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 2 0 0 0 0 0 0 1 1 0 1 0 1 1
OS X 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 2 0 1 0 0 1 1 1 1
Linux 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

Eversnippets Collection

Just some peace of code that helps us in work.

Setup

  1. Install Package Controll
  2. In Sublime Text 2/3 press ⌘+shift+p (or ctrl+shift+p) and enter Install Package
  3. In this palet enter EvercodeLab Sublime Snippets and press enter
  4. Profit!

Manual install

For osX:

ST2

git clone git@github.com:EvercodeLab/evercodelab-sublime-snippets.git \
    ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/EvercodeSnippetPack

ST3

git clone git@github.com:EvercodeLab/evercodelab-sublime-snippets.git \
    ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/EvercodeSnippetPack

For Linux:

git clone git@github.com:EvercodeLab/evercodelab-sublime-snippets.git \ 
    ~/.config/sublime-text-2/Packages/EvercodeSnippetPack

HTML (Rails)

  • <%: <% %>
  • erb: <%= %> seems wierd at first, but is easy to type with just left hand
  • if: if-end
  • ife: if-else-end
  • case: case-when-when-end
  • when: when
  • each: object-each-do-end
  • tap: object-tap-do-end
  • try: object-try-do-end
  • formfor: form-for
  • fi: form input
  • imgtag: image-tag
  • linkto: link-to
  • optforsel: options for select
  • optfrom: options from collection for select
  • render: render partial
  • selecttag: select tag
  • simplefields: simple fields for form
  • simpleform: simple form with fields

RSpec

  • itsrt: it-should-respond-to
  • itsbt: it-should-belong-to
  • itshm: it-should-have-many
  • itshabtm: it-should-have-and-belong-to-many
  • its: its-property-should

Ruby on Rails

  • match: match-path-action
  • get: get-path
  • post: post-path
  • res: resources
  • ro: resources-only
  • re: resources-except

JavaScript

  • docready: jQuery document ready function
  • console: console.log() function — help debug JavaScript
  • anonymous-function: anonymous function
  • on: jQuery onfunction, 'click' by default

Symfony 2 snippets

Controller

  • sf-crud-controller: generate whole CRUD controller
  • sf-controller-with-annotation: controller with annotations
  • sf-action-with-annotation: action annotated with @Route and @Template
  • sf-em: getting Entity Manager in Controller
  • sf-get-repository: getting repository with Entity manager
  • sf-get-user-from-security-context: get User information from security.context
  • sf-redirect: redirect
  • sf-flash: flash message
  • sf-403: throwing 403 exception
  • sf-404: throwing 404 exception

Doctrine

  • sf-entity-class: generates entity class
  • sf-orm-column: generates ORM column defenition
  • sf-orm-column-with-set-and-get: generates ORM column defenition with setter and getter
  • sf-repository-class: generates entity repository class
  • sf-query-builder: generate query builder
  • sf-setter-and-getter: setter and getter methods
  • sf-setter: settere
  • sf-getter: getter

Form

  • sf-form-type: creates form type class
  • sf-cnoice-list-class: creates choice list class

Twig

For basic Twig functions use PHP Twig. It provide next snippets:

  • }}: {{ }}
  • %%: {% %}
  • block: {% block name %}{% endblock %}
  • blockb: block with blank line
  • extends: {% extends 'template' %}
  • filter: {% filter name %}{% endfilter %}
  • filterb: filter with blank line
  • for: {% for item in seq %}
  • fore: for with else
  • if: {% if condition %}{% endif %}
  • ifb: same as if but with blank line
  • ife: same as if but with else statement
  • else: {% else %}
  • set: {% set var = value %}
  • setb: same as set but in other syntax

And here some more Twig snippets:

  • twig-path: path function
  • twig-include: include other template
  • twig-render: render other template
  • twig-spaceless: render peace of templte without spaces

SonataAdmin

  • sf-sonata-admin-class: creates SonataAdmin class

Config

  • sf-service: yml service defenition
  • sf-service-admin: yml admin service defenition

PHP

  • class: just PHP class
  • php: PHP open tag
  • pubfun: public function
  • privfun: private function
  • protfun: protected function

Other

  • snippet: just for generation of other snippets

More to come. Stay tuned.