2009-12-28 51 views
1

如何將vim設置應用於erb文件?像erb文件中的vim設置

/* tabstop=4 shiftwidth=4 foldmethod=indent */ 

好像

<% # xxx %> 
# xxxx 
<!-- xxx --> 

沒有工作

回答

0

這應該工作(把它放在接近文件的頂部):

<!-- vim: tabstop=4 shiftwidth=4 foldmethod=indent 
--> 
2

你只是缺少vim: modeline前綴。來自:h modeline

模式線有兩種形式。第一種形式:

[text]{white}{vi:|vim:|ex:}[white]{options} 

第二種形式(和Vi的一些版本兼容):

[text]{white}{vi:|vim:|ex:}[white]se[t] {options}:[text]