简体   繁体   English

Vim错误的erb缩进

[英]Vim bad erb indentation

When I tried to indent my .erb file via gg=G , I got this: 当我尝试通过gg=G缩进.erb文件时,我得到了:

<li>
<%= gravatar_for user, size: 52 %>
<%= link_to user.name, user %>
<% if current_user.admin? && !current_user?(user) %>
   | <%= link_to "delete", user, method: :delete, data: { confirm: "You sure?" } %>
   <% end %>
   </li>

I've tried using vim-ruby, different eruby.vim files, to no avail. 我尝试使用vim-ruby,不同的eruby.vim文件,但无济于事。 Does anyone have a eruby.vim indent file that actually works? 有人有eruby.vim缩进文件实际有效吗?

I tried it. 我尝试过这个。 If removing | 如果删除| , or put | 或放| as a single line, everything works fine. 作为一行,一切正常。

I suggest you follow this practice to make it as a single line when mixed with eruby code, or not to use | 我建议您按照这种做法将其与eruby代码混合时使其成为一行,或者不使用| at all. 完全没有 Such thing is better to be CSS border. 这样的东西最好是CSS边框。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM