防止 vim 打开文件时更改目录

发布于 2024-09-16 22:17:12 字数 98 浏览 2 评论 0原文

我刚刚将 MacVim 更新到 7.3,现在它可以将目录更改为我当前正在编辑的任何文件。我使用 PeepOpen,所以每次我想编辑新文件时都需要 cd 回到我的项目目录,这非常烦人。

I just updated my MacVim to 7.3 and with it, it now changes directories to whatever file I'm currently editing. I use PeepOpen, so it's incredibly annoying to cd back to my project directory every time I want to edit a new file.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无声情话 2024-09-23 22:17:12

编辑 $HOME/vimrc 并添加以下行:

set noautochdir

确保 autochdir 未在该配置文件或任何其他配置文件中重置。

Edit your $HOME/vimrc and add this line:

set noautochdir

Make sure autochdir isn't reset in that or any other config file.

七婞 2024-09-23 22:17:12

我意识到这个问题很久以前就被问过,但如果其他人偶然发现这个问题,这里是正确的答案:

在 MacVim 7.3 中,pwd 设置为您打开的第一个文件的目录。此行为在快照 55 中已更改,其中对于已打开的窗口,密码永远不会更改。您可以从这里下载快照(并查看自 7.3 以来的更改):

http://github.com/ b4winckler/macvim/wiki/ChangeLog

注意:'autochdir' 与此无关,也不是 PeepOpen 中的错误。

I realize that this question was asked long ago, but in case somebody else stumbles onto this here is the correct answer:

In MacVim 7.3 the pwd is set to the directory of the first file you open. This behavior was changed in Snapshot 55 where the pwd is never changed for an already open window. You can download the snapshot (and see changes since 7.3) from here:

http://github.com/b4winckler/macvim/wiki/ChangeLog

Note: 'autochdir' has nothing to do with this, nor is it a bug in PeepOpen.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文