Editing _vimrc in Windows

自古美人都是妖i 提交于 2019-12-25 14:11:38

问题


I am having some trouble with VIM on windows, and I was wondering if anyone could be of assistance. As of right now, I am trying to make it so that when VIM starts, it changes it's working directory to one besides the default (C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Vim 7.3). The way I am going about this is adding in cd $HOME\Desktop\VimFiles, where $HOME is C:\Users\Alphabet (Alphabet is the name of my account).

The issue I am running into right now is that after opening up _vimrc and adding in the line stated above, I cannot save the file, even when forcing it (with w!). I was wondering why this is and how I can go about fixing this. As an added note, I am running this in GVIM.

Note: I have attempted to do the same thing in VIM, and am able to edit the _vimrc file fine, but when I go to it's location and open it with GVIM or Notepad++, the "cd" line doesn't show up. Is there a reason for this?

Any help is appreciated. Thank you!


回答1:


It looks like you are trying to write a file in a protected directory without the proper privileges.

In Vim, :echo $HOME tells you where you are supposed to put your _vimrc. In your case, your _vimrc should be C:\Users\Alphabet\_vimrc and you should put your plugins and whatnot in C:\Users\Alphabet\vimfile\.

Never touch system files!



来源:https://stackoverflow.com/questions/16495326/editing-vimrc-in-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!