在 Windows 中编辑 _vimrc [英] Editing _vimrc in Windows

查看:28
本文介绍了在 Windows 中编辑 _vimrc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 上使用 VIM 时遇到了一些问题,我想知道是否有人可以提供帮助.截至目前,我正在尝试使其在 VIM 启动时将其工作目录更改为默认 (C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Vim 7.3).我要处理的方法是添加 cd $HOME\Desktop\VimFiles,其中 $HOMEC:\Users\Alphabet (字母是我的帐户名称).

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).

我现在遇到的问题是,在打开 _vimrc 并添加上述行后,我无法保存文件,即使强制(使用 w!).我想知道为什么会这样以及我如何解决这个问题.作为补充说明,我在 GVIM 中运行它.

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.

注意:我试图在 VIM 中做同样的事情,并且能够很好地编辑 _vimrc 文件,但是当我转到它的位置并使用 GVIM 或 Notepad++ 打开它时,cd"行没有不出现.这有什么原因吗?

感谢任何帮助.谢谢!

推荐答案

您似乎试图在没有适当权限的情况下在受保护的目录中写入文件.

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

在 Vim 中,:echo $HOME 告诉你应该把你的 _vimrc 放在哪里.在你的情况下,你的 _vimrc 应该是 C:\Users\Alphabet\_vimrc 并且你应该把你的插件和诸如此类的东西放在 C:\Users\Alphabet\vimfile\.

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\.

切勿触摸系统文件!

这篇关于在 Windows 中编辑 _vimrc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆