Skip to content

ZneuRay/ERB-VSCode-Snippets

 
 

Repository files navigation

ERB-VSCode-Snippets

====================

This extension is a fork of ERB-Sublime-Snippets

A collection of Visual Studio Code snippets useful for writing ERB

Version

0.0.3 ~ 0.0.4 - Syntax fixed

0.0.2 - First release

Features

feature

Installation

These snippets can now be installed via VS Code Marketplace.

Manual installation with extension

  1. Download erb-vscode-snippets.vsix
  2. Press F1 enter ext vsix
  3. Select erb-vscode-snippets.vsix

Manual installation without extension

  1. You can just copy the snippets from snippets.json
  2. Go to Preferences > User Snippets and enter erb
  3. Paste the snippets code

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('@') %>`

License

Released under WTFPL, Version 2

About

A collection of Visual Studio Code snippets useful for coding ERB templates

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published