有没有办法将资源管理器(netrw)的根目录设置为Vim中当前window的工作目录?

Is there a way to set the root directory of explorer (netrw) to the working dirctory of the current window in Vim?

例如,屏幕上有两个拆分的 windows,some/path 的资源管理器和一个路径为 another/path/123.txt 的文件 我想通过在 123.txt

中做一些事情来将资源管理器路径设置为 another/path

有没有办法将资源管理器(netrw)的根目录设置为Vim中当前window的工作目录? (也许NERDtree中有一种方法可以做一些类似于我希望做的事情,只是出于好奇)

感谢您的回答。 我的英语不是很好,对此感到抱歉

一种方法是关闭树浏览器 window,然后从 123.txt 文件

拆分+浏览
:only|Sexplore %:h<cr>
<c-w>o:sp %:h<cr>

复制 Tim Pope 的 vim-vinegar- 用于快速目录浏览的半相关简单映射(和设置)大约是:

noremap - :e %:h<cr>
let g:netrw_banner = 0

用这个你会做<c-w>o<c-w>s-

如需更多帮助,请参阅:

:h :only
:h :Sex
:h :_%
:h ::h