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
  • 35 minutes ago
  • 5 years ago

Installs

  • Total 23K
  • Win 3K
  • OS X 13K
  • Linux 7K
Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11 Jun 10 Jun 9 Jun 8 Jun 7 Jun 6 Jun 5 Jun 4 Jun 3 Jun 2 Jun 1 May 31 May 30 May 29 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
Windows 0 3 1 4 2 0 1 0 1 1 1 1 0 0 3 0 0 0 1 0 0 1 2 1 3 0 1 3 0 1 2 2 1 1 1 1 1 1 2 3 1 3 2 3 1 0
OS X 3 6 5 11 8 5 1 7 5 4 10 20 8 4 8 1 9 5 8 1 3 7 10 13 10 19 5 5 6 8 5 8 6 10 5 7 8 8 7 14 10 2 10 10 10 20
Linux 1 2 6 7 4 2 3 4 2 2 5 7 2 3 5 3 9 6 8 4 2 8 4 3 10 23 0 0 3 2 2 6 5 3 6 4 4 7 6 6 3 0 6 8 6 4

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