我在我的 vim 配置中放了什么?我该如何改变它?
我希望它像 .html 扩展名...因为它是 html...
最佳答案
我觉得你需要
au BufRead,BufNewFile *.ejs setfiletype html
au
是 autocmd
把它放在测试中也是个好主意
if has("autocmd")
au BufRead,BufNewFile *.ejs setfiletype html
endif
如果您使用不支持此功能的精简版 Vim,避免出现错误消息。
最后,如果您有一个默认的文件类型规则,例如:
au BufRead,BufNewFile * setfiletype text
*.ejs
规则必须在之上。
关于html - 我如何编辑我的 VIM 配置,以便 Vim 像对待我的 html 文件一样对待 ".ejs"文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5826192/