Vim:打开文件后读取modeline吗? [英] Vim: read modeline after opening the file?
本文介绍了Vim:打开文件后读取modeline吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我从事各种各样的项目,其中许多设置文件特定的vim设置.我被要求不要在.vimrc中设置模式行;加载文件后有什么方法可以加载模式设置?
I work on a variety of projects and many of them set file-specific vim settings. I have been asked to not have modelines set in .vimrc; is there a way after loading the file to load the modelines settings?
所以,如果我用vim打开tmp.c:
So if I open tmp.c with vim:
int main(int argc, char* argv[]) {
return 0;
}
/* vim: set expandtab tabstop=4 : */
是否可以运行一个命令来设置modeline中的内容?只是在打开:set modeline
后不做任何事情.
Is there a command I can run to set the stuff in the modeline? Just doing :set modeline
after it is open doesn't do anything.
推荐答案
在:set modeline
之后,用:e
重新加载缓冲区.
After :set modeline
, reload your buffer with :e
.
这篇关于Vim:打开文件后读取modeline吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文