how to open file from netrw in current window

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

how to open file from netrw in current window

wei gao
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

--
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
Reply | Threaded
Open this post in threaded view
|

Re: how to open file from netrw in current window

Charles E Campbell Jr
wei gao wrote:
> 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?
>
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

--
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
Reply | Threaded
Open this post in threaded view
|

Re: how to open file from netrw in current window

wei gao
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 <[hidden email]>
wei gao wrote:
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?

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

--
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

--
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
Reply | Threaded
Open this post in threaded view
|

Re: how to open file from netrw in current window

KingTiger.Lu
In reply to this post by wei gao
 
 
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)
 

--
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
Reply | Threaded
Open this post in threaded view
|

Re: how to open file from netrw in current window

wei gao
this is terrific. thanks a lot:)

2011/3/27 KiNgTiGeR <[hidden email]>
 
 
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)
 

--
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

--
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
Reply | Threaded
Open this post in threaded view
|

Re: how to open file from netrw in current window

zionsaint
This post has NOT been accepted by the mailing list yet.
Could you tell me witch option you set caused the problem you mentioned? since your problem is just the way I want netrw to be.
Reply | Threaded
Open this post in threaded view
|

Re: how to open file from netrw in current window

daniel.t
In reply to this post by KingTiger.Lu
+1  that was my problem KingTiger, was driving me crazy...

On Sunday, March 27, 2011 at 1:27:21 AM UTC+9, KingTiger.Lu wrote:

>  
>
>  
>
> 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)
>
>  
--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.