如何更改Vim中的默认保存位置?

时间:2014-01-02 16:49:26

标签: windows vim directory

目前它是C:\Windows\System32这是非常不切实际的。我知道您可以使用:cd [directory]更改当前目录,但有没有办法更改新文件的默认保存位置而无需一直更改目录?

2 个答案:

答案 0 :(得分:3)

我不在Windows,因此无法找到确切的菜单名称,但如果我没记错,最简单的方法是:

  1. 查找您的gVim应用程序
  2. 右键单击
  3. 选择Properties
  4. 更改其中一个标签中的启动位置。通常将其设置为您的主目录。

答案 1 :(得分:1)

您可以使用:cd命令更改Vim的当前工作目录。 见

 :help :cd 

If you want Vim to always start in a particular directory, you can 
put the :cd command in your ~/_vimrc file.



If you want Vim to use 
the parent directory of the file you are editing as its current 
working directory, you can put this setting in your ~/_vimrc file:

 set autochdir 

:help 'autochdir'