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 24K
  • Win 3K
  • OS X 14K
  • Linux 7K
Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7 Aug 6 Aug 5 Aug 4 Aug 3 Aug 2 Aug 1 Jul 31 Jul 30 Jul 29 Jul 28 Jul 27 Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6
Windows 0 2 2 2 1 1 0 0 0 2 1 0 0 1 0 0 1 2 3 0 0 1 0 1 2 0 2 1 5 3 1 1 0 0 1 0 0 1 0 3 4 0 0 0 0 4
OS X 4 7 15 6 5 5 8 6 6 11 9 12 11 7 4 5 7 6 8 14 25 6 6 7 9 10 9 4 6 5 7 7 6 27 14 7 3 6 10 12 11 49 6 6 6 5
Linux 2 1 4 0 8 2 4 1 1 5 5 9 5 4 2 0 8 9 4 5 8 3 0 2 2 7 10 3 4 6 1 2 9 7 9 2 5 5 1 11 5 8 2 2 4 5

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