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

ERB Snippets

by matthewrobertson ST2/ST3

A collection of sublime text snippets useful for coding ERB templates

Labels snippets

Details

  • 2015.10.16.07.31.11
  • github.​com
  • github.​com
  • 2 years ago
  • 1 hour ago
  • 5 years ago

Installs

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

Readme

Source
raw.​githubusercontent.​com

ERB-Sublime-Snippets

A collection of Sublime Text snippets useful for writing ERB

Installation

These snippets can now be installed via Sublime Package Control. If you do not use package control, simply checkout the source code into Sublime Text's packages directory. The location is system specific:

For OSX

$ cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/
$ git clone git://github.com/matthewrobertson/ERB-Sublime-Snippets.git ERB_Snippets

For Windows

$ cd %APPDATA%/Sublime Text 2/Packages/
$ git clone git://github.com/matthewrobertson/ERB-Sublime-Snippets.git ERB_Snippets

For Linux

$ cd ~/.Sublime Text 2/Packages/
$ git clone git://github.com/matthewrobertson/ERB-Sublime-Snippets.git ERB_Snippets

Snippets and Bindings

Snippet Tab Trigger Output
ERB tags er <% %>
print ERB tags pe <%= %>
print ERB comment pc <%# %>
if block if <% if %>...<% end %>
if / else block ife <% if %>...<% else %>...<% end %>
else tag else <% else %>
elsif tag elsif <% elsif %>
unless block unless <% unless %>...<% end %>
end block end <% end %>
submit_tag helper st <%= submit_tag ..., ... %>
text_field_tag helper tft <%= text_field_tag ..., ... %>
password_field_tag helper pft <%= password_field_tag ..., ... %>
label_tag helper lblt <%= label_tag ..., ... %>
link_to helper lt <%= link_to ..., ... %>
each helper each <% @things.each do |thing| %> ... <% end %>
form_for helper ff <%= form_for(@ ) do |f| %> ... <% end %>
t() helper t <%= t('@') %>

Resolve conflicting tab trigger

It is possible for the snippets in this package to conflict with other Sublime text plugins, such as the built-in Rails package or Rails Developer Snippets. You may want to disable unwanted snippets.

For Sublime Text 2

Delete unwanted snippet files from ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/<PackageName>/

For Sublime Text 3

  1. Install the PackageResourceViewer Package
  2. Open unwanted snippets with PackageResourceViewer: Open Resource command and comment it out

Questions, Comments, Concerns?

Feel free to submit a pull request with any snippets you would like to add to the project. If you have any problems or suggestions you can contact me on twitter.

License

Released under WTFPL, Version 2