ERB Snippets
A collection of sublime text snippets useful for coding ERB templates
Details
Installs
- Total 40K
- Win 5K
- Mac 23K
- Linux 11K
Oct 31 | Oct 30 | Oct 29 | Oct 28 | Oct 27 | Oct 26 | Oct 25 | Oct 24 | Oct 23 | Oct 22 | Oct 21 | Oct 20 | Oct 19 | Oct 18 | Oct 17 | Oct 16 | Oct 15 | Oct 14 | Oct 13 | Oct 12 | Oct 11 | Oct 10 | Oct 9 | Oct 8 | Oct 7 | Oct 6 | Oct 5 | Oct 4 | Oct 3 | Oct 2 | Oct 1 | Sep 30 | Sep 29 | Sep 28 | Sep 27 | Sep 26 | Sep 25 | Sep 24 | Sep 23 | Sep 22 | Sep 21 | Sep 20 | Sep 19 | Sep 18 | Sep 17 | Sep 16 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 |
Mac | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 | 0 | 2 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 | 0 | 0 | 0 | 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
- Install the PackageResourceViewer Package
- 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