====================
This extension is a fork of ERB-Sublime-Snippets
A collection of Visual Studio Code snippets useful for writing ERB
0.0.3 ~ 0.0.4 - Syntax fixed
0.0.2 - First release
These snippets can now be installed via VS Code Marketplace.
- Download erb-vscode-snippets.vsix
- Press
F1
enterext vsix
- Select
erb-vscode-snippets.vsix
- You can just copy the snippets from snippets.json
- Go to
Preferences > User Snippets
and entererb
- Paste the snippets code
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('@') %>` |
Released under WTFPL, Version 2