Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sublime shortcut for erb comments

In sublime command + / is not working for me to comment out erb and also can't block comment out erb + html, does anyone know how to fix this, maybe a package?

For example, I want to comment out this code in sublime:

1 <% post.categories.each do |category| %>
2   <%= category.name %>
3 <% end %>

I can not just "command + /" or "command+option+/" for the selection because either of those only puts a regular style html comment around the selection. If I try commenting out just line one with command + / it puts a pound symbol # before the line - a ruby comment, not erb.

Instead to comment it out I will have to put a pound sign in the first line, then put a pound sign in the second line and an html comment around it, then put a pound sign in the third line.

So finally it will look like this

<%# post.categories.each do |category| %>
<!-- <%#= category.name %> -->
<%# end %>

I have HTML(Rails) selected.

like image 852
tjhnc Avatar asked Jan 11 '14 05:01

tjhnc


2 Answers

Make sure you followed the steps at this github link given in rails tutorial. package installing and editing the keys are clearly explained there.

like image 78
bkdir Avatar answered Sep 28 '22 14:09

bkdir


using SublimeERB plugin you can toggle between different erb tag modes including comment style.

enter image description here

like image 23
Allen Bargi Avatar answered Sep 28 '22 14:09

Allen Bargi