rom*_*inl 24
它不工作,在所有.Vim根本没有公开可以帮助插件作者使他们的插件无缝地协同工作的通用接口.或许有一天…
与此同时,我们留下了逆向工程,阅读源代码,以及一如既往的 RTFM.
NERDTree的NERDTreeChDirMode选项决定了插件在更改Vim的"当前目录"方面的行为:
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.
Run Code Online (Sandbox Code Playgroud)
在CtrlP的一侧,该ctrlp_working_path_mode选项听起来很有趣:
w - begin finding a root from the current working directory outside of CtrlP
instead of from the directory of the current file (default). Only applies
when "r" is also present.
Run Code Online (Sandbox Code Playgroud)
所以看起来下面的两个选项会给你你想要的东西:
let g:NERDTreeChDirMode = 2
let g:ctrlp_working_path_mode = 'rw'
Run Code Online (Sandbox Code Playgroud)