Skip to content

Commit c01e2b3

Browse files
committed
Erb snippets
1 parent fcc17bc commit c01e2b3

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

vim/after/ftplugin/eruby.vim

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,17 @@ function! ERubyIterVar()
1616
return rails#singularize(collection)
1717
endfunction
1818

19-
" general ruby snippets
19+
" general erb snippets
2020
Snippet each each do |``ERubyIterVar()``| -%><CR><{}><CR><% end -%>
2121
Snippet map map do |``ERubyIterVar()``|<CR><{}><CR>end
22-
" Snippet each <% <{collection}>.each do |<{member}>| -%><CR><{}><CR><% end %>
23-
Snippet h <%=h <{}> %>
2422
Snippet = <%= <{}> %>
25-
Snippet rendp <%= render :partial => '<{}>' %>
26-
Snippet rendc <%= render :partial => @<{}> %>
27-
Snippet rendo <%= render :partial => @<{}> %>
28-
Snippet lt <%= link_to '<{caption}>', <{}> %>
23+
Snippet if <% if <{}> -%><CR><CR><% end -%>
24+
Snippet unless <% unless <{}> -%><CR><CR><% end -%>
25+
26+
" rails snippets
27+
Snippet h <%=h <{}> %>
28+
Snippet rp <%= render :partial => '<{}>' %>
29+
Snippet lt <%= link_to <{caption}>, <{}> %>
30+
Snippet ctf <% content_tag_for :<{tag}>, <{object}> do -%><CR><{}><CR><% end -%>
31+
Snippet cf <% content_for :<{capture}> do -%><CR><{}><CR><% end -%>
32+
Snippet cfj <% content_for :javascript do -%><CR><script type="text/javascript"><CR><{}><CR></script><CR><% end -%>

0 commit comments

Comments
 (0)