gVim 是否将其所有文件存储在 Program Files/vim 目录中?
gVim 是否将文件(特别是首选项)存储在其他目录中而不是程序文件中(例如像 emacs 中的 %apps%
中)? 如果没有,我可以在 USB 闪存驱动器中携带 gVim 吗? (Vim 有一个便携式版本,但由于它不在其他文件夹中存储任何内容,我不知道它需要便携式版本)。
Does gVim store files (specially preferences) in other directories rather than Program Files (for instance in %apps%
like emacs)?
If not, can I carry gVim in a USB frashdrive? (There's a portable version of Vim, but since it doesn't store anything in other folders I can't figure out it needs a portable version).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知(不包括临时文件和 bk 选项),Vim 本身只在自己的目录之外创建一个文件:$HOME(您的用户目录)中的 _viminfo 文件,其中包含重新打开时可以使用的各种信息一些文件。您可以在 Vim 帮助中阅读更多详细信息。
您可以使用 _vimrc 更改 viminfo 选项以将其存储在其他位置。
请注意,如果您添加了任何插件,其中一些插件也可能会在您的主目录中保存内容 - 如果您查看该目录中的内容,您正在处理的文件可能会相当明显。您必须查看这些插件的文档以了解如何将其更改为 $VIM。
To the best of my knowledge (and excluding temporary files and the bk option), Vim itself only creates a single file outside of its own directory: a _viminfo file in $HOME (your user directory) containing various information it can use if you reopen some file. You can read about it in more detail in the Vim help.
You can use your _vimrc to change the viminfo option to store it somewhere else.
Note that if you have added any plugins, some of those might also be saving stuff in your home directory - if you take a look at what is in that directory, it'll probably be fairly obvious which files you were dealing with. You'll have to check with the documentation for those plugins to see how to alter it to $VIM.
vim 默认将其插件和设置文件存储在相对于其安装路径的文件夹中。
您可以使用 $VIM 和 $VIMRUNTIME 环境变量覆盖该位置以指向设置文件。
在 vim 编辑器中使用
:help $VIM
获取有关此内容的文档。vim stores it's plugins and settings files by default in a folder relative to it's installation path.
You can override that location using $VIM and $VIMRUNTIME environment variables to point to the settings files.
From the vim editor use
:help $VIM
for documentation on this.