如何在vim中使netrw像visual studio中的解决方案资源管理器一样工作

syl*_*mos 15 vim netrw

好吧,我会在这里说得更清楚..说我有一个垂直分割窗口中的目录列表,以及我正在编辑的文件..

我可以使用Ctrl + w从一个分割到另一个分割,并使用netrw插件以四种方式打开文件列表中的文件..使用返回键,v,o,t ..

使用返回键,它将在当前(netrw)拆分窗口中打开..使用v,它会创建一个新的垂直拆分..(与o(水平拆分)相同,t(新选项卡))

但我希望文件在已经存在的另一个分区中打开,我在那里进行所有编辑...而不是打开一个新的分割..我希望我的问题很明确..通过输入命令,突出显示的文件将在编辑拆分而不是netrw拆分打开..必须有一些简单的解决方案..或者有人可以告诉我使用netrw的最佳方式..我会尝试适应..

rom*_*inl 24

答案在文档中::h netrw.照常.

您正在寻找P:

To edit a file or directory in the previously used (last accessed) window (see
:he CTRL-W_p), press a "P".  If there's only one window, then the one window
will be horizontally split (above/below splitting is controlled by
g:netrw_alto, and its initial size is controlled by g:netrw_winsize).

If there's more than one window, the previous window will be re-used on
the selected file/directory.  If the previous window's associated buffer
has been modified, and there's only one window with that buffer, then
the user will be asked if s/he wishes to save the buffer first (yes,
no, or cancel).
Run Code Online (Sandbox Code Playgroud)


use*_*497 5

另一种方法:使用:让g:netrw_chgwin = 2(或者你喜欢的任何窗口号).随后在netrw中选择文件将使用该窗口进行编辑.