简体   繁体   English

添加新的 .vimrc 文件时,vim 会覆盖默认设置

[英]vim overrides default settings when adding new .vimrc file

I have recently tried to aid in automating my workflow in vim.我最近试图帮助在 vim 中自动化我的工作流程。 Since there wasn't a .vimrc file in my home folder by default, I've made a new one and put my code in. After starting up vim again I was surprised to see my C code unhighlighted.由于默认情况下我的主文件夹中没有 .vimrc 文件,我创建了一个新文件并将我的代码放入。再次启动 vim 后,我惊讶地看到我的 C 代码没有突出显示。 After removing .vimrc file, everything was back to normal.删除 .vimrc 文件后,一切恢复正常。 Knowing this, I would assume vim falls back to some internally defined .vimrc file when there isn't one in the user folder.知道这一点,我会假设 vim 回退到一些内部定义的 .vimrc 文件,当用户文件夹中没有一个文件时。 Is there a way to load a user-made .vimrc file without overriding system default settings?有没有办法在不覆盖系统默认设置的情况下加载用户制作的 .vimrc 文件? If not, is there a list of commands that I can put into my .vimrc file to restore those settings?如果没有,是否有一个命令列表可以放入我的 .vimrc 文件中以恢复这些设置?

If not, is there a list of commands that I can put into my .vimrc file to restore those settings?如果没有,是否有一个命令列表可以放入我的 .vimrc 文件中以恢复这些设置?

Yes, simply add the line runtime defaults.vim on top of your vimrc.是的,只需在 vimrc 之上添加行runtime defaults.vim

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

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