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

更新时间:2020-01-27 05:35:34

Browse

ERB Snippets

A collection of sublime text snippets useful for coding ERB templates

Labels snippets

Details

  • 2018.06.08.06.51.45
  • github.​com
  • github.​com
  • 2 years ago
  • 2 hours ago
  • 7 years ago

Installs

  • Total 32K
  • Win 4K
  • Mac 18K
  • Linux 9K
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 Jan 9 Jan 8 Jan 7 Jan 6 Jan 5 Jan 4 Jan 3 Jan 2 Jan 1 Dec 31 Dec 30 Dec 29 Dec 28 Dec 27 Dec 26 Dec 25 Dec 24 Dec 23 Dec 22 Dec 21 Dec 20 Dec 19 Dec 18 Dec 17 Dec 16 Dec 15 Dec 14 Dec 13 Dec 12
Windows 1 1 2 2 3 2 1 0 2 1 0 1 1 7 1 0 1 1 2 6 1 2 5 1 1 0 2 2 1 0 1 1 0 0 2 0 3 2 0 3 1 1 2 1 1 0
Mac 8 8 8 4 8 6 47 3 16 9 15 10 22 215 9 22 8 13 7 20 108 19 9 5 5 2 8 3 5 10 8 3 3 10 2 5 7 9 6 6 6 6 5 6 10 5
Linux 3 4 2 5 4 3 17 3 9 3 4 9 11 122 5 19 5 3 6 8 43 8 3 4 3 2 1 3 1 3 4 2 1 1 2 4 2 3 2 2 4 4 2 2 2 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 %>
image_tag helper it <%= image_tag ..., ... %>
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(@ ) do
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