简体   繁体   English

Vimrc没有更新

[英]Vimrc not updating

I am trying to setup vim to wrap my git commits to 72 characters but I am having trouble doing so. 我正在尝试设置vim来将git commit封装为72个字符,但是这样做很麻烦。 When I edit ":e $myvimrc" and add the settings to wrap the text it doesn't seem to work. 当我编辑“:e $ myvimrc”并添加设置以包装文本时,它似乎不起作用。 I tried to open the vimrc file directly form my program files to check that the changes I have made had indeed been saved, but they are not showing in the file. 我试图直接从程序文件中打开vimrc文件,以检查是否确实保存了所做的更改,但这些更改未显示在文件中。

Strange thing is that when I open the vimrc file in vim to edit it the changes I made are still there, they just don't seem to be saving to the actual file. 奇怪的是,当我在vim中打开vimrc文件进行编辑时,所做的更改仍然存在,它们似乎并没有保存到实际文件中。

I have tried to edit the vimrc directly as well but it wont allow me to save in that location. 我也尝试直接编辑vimrc,但是它不允许我保存在该位置。 Hopefully im just doing something silly and if I am I apologies, very fresh to git and vim. 希望我只是做一些愚蠢的事情,如果我对不起,对git和vim很新鲜。 Thanks in advance 提前致谢

usually you don't need do special setting for gitcommit Filetype. 通常,您不需要对gitcommit Filetype进行特殊设置。 Because GITCOMMIT was pre-defined as wrap & textwidth=72 under your $VIMRUNTIME/ftplugin/gitcommit.vim 因为GITCOMMIT在$VIMRUNTIME/ftplugin/gitcommit.vim下被预定义为wrap & textwidth=72

Check if you have filetype on in your vimrc, so that the filetype plugins are activated. 检查您的vimrc中是否具有filetype on ,以便激活文件类型插件。

It is recommended to place your personal Vim configuration in your user's home directory (on Windows, typically C:\\Users\\<yourname> ; or use :e $HOME/_vimrc inside Vim). 建议将个人Vim配置放在用户的主目录中(在Windows上,通常为C:\\Users\\<yourname> ;或在Vim中使用:e $HOME/_vimrc )。

If your ~/.vimrc file currently resides in Vim's installation directory, under C:\\Program Files (ie $VIM/_vimrc ), then you're experiencing the effects of the Windows File System Redirector , redirecting non-admin writes to Program Files into a virtual store (cp. UAC Virtualization and how it affects your Installers . 如果您的~/.vimrc文件当前位于Vim的安装目录中,位于C:\\Program Files (即$VIM/_vimrc ),则您将遇到Windows File System Redirector的影响 ,将非管理员写入重定向到Program Files。进入虚拟存储(cp UAC虚拟化及其对安装程序的影响)

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

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