当 vim 列出目录内容时,如何打开光标下的文件(Netrw Directory Listing)

当 vim 列出目录内容时,如何打开光标下的文件(Netrw Directory Listing)

我可以按 o,但它会创建一个新窗口并在那里打开文件。我希望它在同一个窗口中打开。至少每次打开某个文件时它应该显示在同一个窗口中,但它会为我打开的每个文件创建新窗口。还有没有办法让它以垂直分割而不是水平分割打开?我在哪里可以找到“Netrw 目录列表”模式下所有可能命令的完整文档/备忘单?

答案1

有关其他问题的答案,请参阅

:help netrw

对于所有文件,

:help netrw-v

使用垂直分割窗口,以及

:help netrw-browse-maps

获取正常模式命令(地图)的列表。

答案2

以下是帮助中的快速参考

  ---           -----------------
  Map           Quick Explanation
  ---           -----------------
 <cr>   Netrw will enter the directory or read the file 
 <del>  Netrw will attempt to remove the file/directory                                                                
   D    Attempt to remove the file(s)/directory(ies)                            
   o    Enter the file/directory under the cursor in a new   
    browser window.  A horizontal split is used.
   O    Obtain a file specified by cursor                    
   p    Preview the file                                     
   P    Browse in the previously used window                            
   qf   Display information on file                                                         
   R    Rename the designed file(s)/directory(ies)            
   t    Enter the file/directory under the cursor in a new tab           
   v    Enter the file/directory under the cursor in a new   
    browser window.  A vertical split is used.
   x    View file with an associated program                 
   %    Open a new file in netrw's current directory         

答案3

在网络列表中按ENTER

相关内容