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

ERB Snippets

A collection of sublime text snippets useful for coding ERB templates

Labels snippets

Details

  • 2022.06.13.20.17.26
  • github.​com
  • github.​com
  • 3 years ago
  • 1 hour ago
  • 13 years ago

Installs

  • Total 40K
  • Win 5K
  • Mac 23K
  • Linux 11K
May 28 May 27 May 26 May 25 May 24 May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14
Windows 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
Mac 0 0 0 0 0 1 0 1 0 1 1 0 0 0 1 0 0 1 0 0 0 1 0 1 1 0 1 0 1 0 0 0 0 3 0 2 0 1 0 0 1 0 0 0 1
Linux 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0
01234May 28May 25May 22May 19May 16May 13May 10May 7May 4May 1Apr 28Apr 25Apr 22Apr 19Apr 16May 28 Linux: 0 Mac: 0 Windows: 0May 27 Linux: 0 Mac: 0 Windows: 0May 26 Linux: 0 Mac: 0 Windows: 0May 25 Linux: 0 Mac: 0 Windows: 0May 24 Linux: 1 Mac: 0 Windows: 0May 23 Linux: 0 Mac: 1 Windows: 0May 22 Linux: 0 Mac: 0 Windows: 1May 21 Linux: 0 Mac: 1 Windows: 0May 20 Linux: 0 Mac: 0 Windows: 0May 19 Linux: 0 Mac: 1 Windows: 0May 18 Linux: 0 Mac: 1 Windows: 0May 17 Linux: 0 Mac: 0 Windows: 0May 16 Linux: 1 Mac: 0 Windows: 0May 15 Linux: 0 Mac: 0 Windows: 0May 14 Linux: 0 Mac: 1 Windows: 0May 13 Linux: 0 Mac: 0 Windows: 0May 12 Linux: 0 Mac: 0 Windows: 0May 11 Linux: 0 Mac: 1 Windows: 0May 10 Linux: 0 Mac: 0 Windows: 0May 9 Linux: 0 Mac: 0 Windows: 0May 8 Linux: 0 Mac: 0 Windows: 0May 7 Linux: 0 Mac: 1 Windows: 0May 6 Linux: 1 Mac: 0 Windows: 0May 5 Linux: 0 Mac: 1 Windows: 1May 4 Linux: 0 Mac: 1 Windows: 0May 3 Linux: 0 Mac: 0 Windows: 0May 2 Linux: 0 Mac: 1 Windows: 0May 1 Linux: 0 Mac: 0 Windows: 0Apr 30 Linux: 0 Mac: 1 Windows: 1Apr 29 Linux: 0 Mac: 0 Windows: 0Apr 28 Linux: 2 Mac: 0 Windows: 0Apr 27 Linux: 0 Mac: 0 Windows: 0Apr 26 Linux: 0 Mac: 0 Windows: 0Apr 25 Linux: 0 Mac: 3 Windows: 0Apr 24 Linux: 0 Mac: 0 Windows: 0Apr 23 Linux: 0 Mac: 2 Windows: 0Apr 22 Linux: 0 Mac: 0 Windows: 0Apr 21 Linux: 0 Mac: 1 Windows: 0Apr 20 Linux: 0 Mac: 0 Windows: 0Apr 19 Linux: 0 Mac: 0 Windows: 0Apr 18 Linux: 0 Mac: 1 Windows: 1Apr 17 Linux: 0 Mac: 0 Windows: 0Apr 16 Linux: 0 Mac: 0 Windows: 0Apr 15 Linux: 0 Mac: 0 Windows: 0Apr 14 Linux: 0 Mac: 1 Windows: 0May 28 Linux: 0 Mac: 0 Windows: 0May 27 Linux: 0 Mac: 0 Windows: 0May 26 Linux: 0 Mac: 0 Windows: 0May 25 Linux: 0 Mac: 0 Windows: 0May 24 Linux: 1 Mac: 0 Windows: 0May 23 Linux: 0 Mac: 1 Windows: 0May 22 Linux: 0 Mac: 0 Windows: 1May 21 Linux: 0 Mac: 1 Windows: 0May 20 Linux: 0 Mac: 0 Windows: 0May 19 Linux: 0 Mac: 1 Windows: 0May 18 Linux: 0 Mac: 1 Windows: 0May 17 Linux: 0 Mac: 0 Windows: 0May 16 Linux: 1 Mac: 0 Windows: 0May 15 Linux: 0 Mac: 0 Windows: 0May 14 Linux: 0 Mac: 1 Windows: 0May 13 Linux: 0 Mac: 0 Windows: 0May 12 Linux: 0 Mac: 0 Windows: 0May 11 Linux: 0 Mac: 1 Windows: 0May 10 Linux: 0 Mac: 0 Windows: 0May 9 Linux: 0 Mac: 0 Windows: 0May 8 Linux: 0 Mac: 0 Windows: 0May 7 Linux: 0 Mac: 1 Windows: 0May 6 Linux: 1 Mac: 0 Windows: 0May 5 Linux: 0 Mac: 1 Windows: 1May 4 Linux: 0 Mac: 1 Windows: 0May 3 Linux: 0 Mac: 0 Windows: 0May 2 Linux: 0 Mac: 1 Windows: 0May 1 Linux: 0 Mac: 0 Windows: 0Apr 30 Linux: 0 Mac: 1 Windows: 1Apr 29 Linux: 0 Mac: 0 Windows: 0Apr 28 Linux: 2 Mac: 0 Windows: 0Apr 27 Linux: 0 Mac: 0 Windows: 0Apr 26 Linux: 0 Mac: 0 Windows: 0Apr 25 Linux: 0 Mac: 3 Windows: 0Apr 24 Linux: 0 Mac: 0 Windows: 0Apr 23 Linux: 0 Mac: 2 Windows: 0Apr 22 Linux: 0 Mac: 0 Windows: 0Apr 21 Linux: 0 Mac: 1 Windows: 0Apr 20 Linux: 0 Mac: 0 Windows: 0Apr 19 Linux: 0 Mac: 0 Windows: 0Apr 18 Linux: 0 Mac: 1 Windows: 1Apr 17 Linux: 0 Mac: 0 Windows: 0Apr 16 Linux: 0 Mac: 0 Windows: 0Apr 15 Linux: 0 Mac: 0 Windows: 0Apr 14 Linux: 0 Mac: 1 Windows: 0May 28 Linux: 0 Mac: 0 Windows: 0May 27 Linux: 0 Mac: 0 Windows: 0May 26 Linux: 0 Mac: 0 Windows: 0May 25 Linux: 0 Mac: 0 Windows: 0May 24 Linux: 1 Mac: 0 Windows: 0May 23 Linux: 0 Mac: 1 Windows: 0May 22 Linux: 0 Mac: 0 Windows: 1May 21 Linux: 0 Mac: 1 Windows: 0May 20 Linux: 0 Mac: 0 Windows: 0May 19 Linux: 0 Mac: 1 Windows: 0May 18 Linux: 0 Mac: 1 Windows: 0May 17 Linux: 0 Mac: 0 Windows: 0May 16 Linux: 1 Mac: 0 Windows: 0May 15 Linux: 0 Mac: 0 Windows: 0May 14 Linux: 0 Mac: 1 Windows: 0May 13 Linux: 0 Mac: 0 Windows: 0May 12 Linux: 0 Mac: 0 Windows: 0May 11 Linux: 0 Mac: 1 Windows: 0May 10 Linux: 0 Mac: 0 Windows: 0May 9 Linux: 0 Mac: 0 Windows: 0May 8 Linux: 0 Mac: 0 Windows: 0May 7 Linux: 0 Mac: 1 Windows: 0May 6 Linux: 1 Mac: 0 Windows: 0May 5 Linux: 0 Mac: 1 Windows: 1May 4 Linux: 0 Mac: 1 Windows: 0May 3 Linux: 0 Mac: 0 Windows: 0May 2 Linux: 0 Mac: 1 Windows: 0May 1 Linux: 0 Mac: 0 Windows: 0Apr 30 Linux: 0 Mac: 1 Windows: 1Apr 29 Linux: 0 Mac: 0 Windows: 0Apr 28 Linux: 2 Mac: 0 Windows: 0Apr 27 Linux: 0 Mac: 0 Windows: 0Apr 26 Linux: 0 Mac: 0 Windows: 0Apr 25 Linux: 0 Mac: 3 Windows: 0Apr 24 Linux: 0 Mac: 0 Windows: 0Apr 23 Linux: 0 Mac: 2 Windows: 0Apr 22 Linux: 0 Mac: 0 Windows: 0Apr 21 Linux: 0 Mac: 1 Windows: 0Apr 20 Linux: 0 Mac: 0 Windows: 0Apr 19 Linux: 0 Mac: 0 Windows: 0Apr 18 Linux: 0 Mac: 1 Windows: 1Apr 17 Linux: 0 Mac: 0 Windows: 0Apr 16 Linux: 0 Mac: 0 Windows: 0Apr 15 Linux: 0 Mac: 0 Windows: 0Apr 14 Linux: 0 Mac: 1 Windows: 0

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 %>
image_tag helper it <%= image_tag ..., ... %>
cl_image_tag helper cli <%= cl_image_tag 'path' {*option*} %>
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
form_for helper ff <%= form_for(*@model*) do
simple_form_for helper sf <%= simple_form_for(*@model*) do
f.input helper fi <%= f.input ... %>
f.button helper fs <%= f.button :input ... %>
time_ago_in_words helper tw <%= time_ago_in_words(...) %>
t() helper t <%= t('*@model*') %>

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