how to open file from netrw in current window

750 Aufrufe
Direkt zur ersten ungelesenen Nachricht

wei gao

ungelesen,
26.03.2011, 06:38:3226.03.11
an vim...@googlegroups.com
Hi,
 
I find that if I open (vs) two windows and one of them is netrw file explore, when I try to open a file in netrw window (enter key), the file will be opened in another window. How could I make the file is opened in current netrw file exploer window?
 
Thanks!
Wei

Charles E Campbell Jr

ungelesen,
26.03.2011, 07:47:0726.03.11
an vim...@googlegroups.com
Since the behavior you're asking for is the default netrw behavior, the
problem is: what in your setup is causing this behavior?

To verify this, try making a file called simple.vimrc with the following
contents:

set nocp
filetype plugin indent on


then use

vim -u simple.vimrc somefile
<c-w>v
:e .
(pick a file via netrw and press <cr> with the cursor atop some file)

I'm getting the file opened in the current netrw file explorer window as
you requested -- do you?

Regards,
Chip Campbell

wei gao

ungelesen,
26.03.2011, 10:45:5226.03.11
an vim...@googlegroups.com
I restart gvim and the file is opened in current window now. I did nothing. I don't which option will affect the netrw's open mode.

2011/3/26 Charles E Campbell Jr <drc...@campbellfamily.biz>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

KiNgTiGeR

ungelesen,
26.03.2011, 12:27:2126.03.11
an vim...@googlegroups.com
 
 
I find that if I open (vs) two windows and one of them is netrw file explore, when I try to open a file in netrw window (enter key), the file will be opened in another window. How could I make the file is opened in current netrw file exploer window?
 

I think you may had a setting about nertw_browse_split in somewhere,  default is opening in the same window.
you can try  :
let g:netrw_browse_split=0
 
  *g:netrw_browse_split*
 when browsing, <cr> will open the file by:
    =0: re-using the same window
    =1: horizontally splitting the window first 
    =2: vertically   splitting the window first 
    =3: open file in new tab
    =4: act like "P" (ie. open previous window)
 

wei gao

ungelesen,
27.03.2011, 22:03:5427.03.11
an vim...@googlegroups.com
this is terrific. thanks a lot:)

2011/3/27 KiNgTiGeR <ljh...@gmail.com>

--

dani...@funglr.com

ungelesen,
12.03.2018, 05:53:4012.03.18
an vim_use
+1 that was my problem KingTiger, was driving me crazy...
Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten