gpt4 book ai didi

events - 在 NERDtree 上导航时如何更改 vim 工作目录

转载 作者:行者123 更新时间:2023-12-05 05:23:08 25 4
gpt4 key购买 nike

在 NERDtree 中,如果您按 C,它会更改光标下文件夹的 NERDtree 的根目录。我想通过使用此命令更改 vim 的工作目录(例如当您使用::lcd\path\to\directory 时)。有谁知道这样做的方法吗??

最佳答案

您可以设置选项 NERDTreeChDirMode值(value)2这将在树根更改时更改 vim 的 CWD。

'NERDTreeChDirMode'

Values: 0, 1 or 2. Default: 0.

Use this option to tell the script when (if at all) to change the current working directory (CWD) for vim.

If it is set to 0 then the CWD is never changed by the NERD tree.

If set to 1 then the CWD is changed when the NERD tree is first loaded to the directory it is initialized in. For example, if you start the NERD tree with :NERDTree /home/marty/foobar

then the CWD will be changed to /home/marty/foobar and will not be changed again unless you init another NERD tree with a similar command.

If the option is set to 2 then it behaves the same as if set to 1 except that the CWD is changed whenever the tree root is changed. For example, if the CWD is /home/marty/foobar and you make the node for /home/marty/foobar/baz the new root then the CWD will become /home/marty/foobar/baz.

关于events - 在 NERDtree 上导航时如何更改 vim 工作目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38779719/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com