2012-09-03 22 views
15

好吧,我会在这里更加清楚.. 说我有一个垂直分割窗口中的目录列表,以及我正在编辑的文件。如何使netrw在vim中工作,就像在visual studio中的解决方案资源管理器

我可以去从一个分流至其他使用Ctrl + W 和四种方式使用NETRW插件文件中打开的文件列表.. 使用返回键,v,0,T ..

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

但我想在另一个已经存在的分割中打开文件,在那里我做所有的编辑..而不是打开一个新的分割..我希望我的问题很清楚..说通过输入命令,突出显示的文件将打开编辑拆分而不是netrw拆分.. 必须有一些简单的解决方案,这..或有人可以告诉我最好的方式来使用netrw ..我会尽量适应..

+1

也许[nerdTree](http://www.vim.org/scripts/script.php?script_id=1658)是你想要的,尽管它的缺点。 – complex857

+0

我很高兴与netrw ..但它似乎必须有一些关键的组合来实现这一目标..我错过了一些东西..如果没有解决方案,我会习惯这个..或者只是安装nerdtree插件..你确定nerdtree解决了这个问题.. – syllogismos

+0

我不确定,因为我不是一个常规的视觉工作室用户,但nerdtree似乎使用最后一个非nerdtree拆分当我打开一个文件(也有我/ o/t和其他人) – complex857

回答

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). 
+0

我找到了它..但没有找到它,我发现它现在我试图做一段时间了..谢谢.. – syllogismos

5

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

+0

很好的答案。如果可以的话,我会加倍努力。 – juanpastas

相关问题