Re: Getting out of netrw

2006-11-04 Thread Jean-Rene David
* Gary Johnson [2006.11.04 18:30]:
> When you open file A, then open file B, then
> want to go back to A, you don't do so by
> quitting B--you explicitly open A.

Looking at it that way, it makes good sense.

Thanks again for all the suggestions.

-- 
JR


Re: Getting out of netrw

2006-11-04 Thread Bill McCarthy
On Sat 4-Nov-06 6:10pm -0600, A.J.Mechelynck wrote:

> Bill McCarthy wrote:
>> On Sat 4-Nov-06 5:40pm -0600, A.J.Mechelynck wrote:
>> 
>>> Vim's ":quit", ":close" or ":exit" commands will close any window, including
>>> "special" windows like the netrw, options, quickfix, ... windows. So where's
>>> the problem?
>> 
>> Reading the thread, it appears the OP was editing a file and
>> then started the explorer with something like ":edit ." -
>> i.e. he was in a single window.
>> 
>> In that case, :quit or :exit would close down Gvim - not
>> what he wanted.  :close would generate an error message.
>> 
>> Perhaps simply :bd is more like what he wants?
>> 
>
> Well, let him learn split-window commands then: ":new ." opens the explorer in
> a separate window; or, if you want a File-Explorer-like display on the side,
> ":topleft vsplit ."; later, ":q" will close that extra window.

Good point.  And if wants to work in a full window, then
":tabe ." will do that and still close down with ":q".

-- 
Best regards,
Bill



Re: Getting out of netrw

2006-11-04 Thread A.J.Mechelynck

Bill McCarthy wrote:

On Sat 4-Nov-06 5:40pm -0600, A.J.Mechelynck wrote:


Vim's ":quit", ":close" or ":exit" commands will close any window, including
"special" windows like the netrw, options, quickfix, ... windows. So where's
the problem?


Reading the thread, it appears the OP was editing a file and
then started the explorer with something like ":edit ." -
i.e. he was in a single window.

In that case, :quit or :exit would close down Gvim - not
what he wanted.  :close would generate an error message.

Perhaps simply :bd is more like what he wants?



Well, let him learn split-window commands then: ":new ." opens the explorer in 
a separate window; or, if you want a File-Explorer-like display on the side, 
":topleft vsplit ."; later, ":q" will close that extra window.



Best regards,
Tony.


Re: Getting out of netrw

2006-11-04 Thread Bill McCarthy
On Sat 4-Nov-06 5:40pm -0600, A.J.Mechelynck wrote:

> Vim's ":quit", ":close" or ":exit" commands will close any window, including
> "special" windows like the netrw, options, quickfix, ... windows. So where's
> the problem?

Reading the thread, it appears the OP was editing a file and
then started the explorer with something like ":edit ." -
i.e. he was in a single window.

In that case, :quit or :exit would close down Gvim - not
what he wanted.  :close would generate an error message.

Perhaps simply :bd is more like what he wants?

-- 
Best regards,
Bill



Re: Getting out of netrw

2006-11-04 Thread A.J.Mechelynck

Jean-Rene David wrote:

* Yegappan Lakshmanan [2006.11.04 13:00]:

You can try using CTRL-^ to jump to the alternate buffer.


Good idea.

Most suggestions were useful, BTW, thanks all.


This looks like a bug in netrw.


Well personally I find not having a "quit" or
"exit" function pretty close to a bug. But there
are so many ways around it I don't find it a very
serious one...



Vim's ":quit", ":close" or ":exit" commands will close any window, including 
"special" windows like the netrw, options, quickfix, ... windows. So where's 
the problem?



Best regards,
Tony.


Re: Getting out of netrw

2006-11-04 Thread Gary Johnson

Say I open vim7's new super duper file explorer
"netrw" to browse some local directory. Say then I
decide I don't want to open any new file and just
want to go back to what I was doing. What would be
the standard way to do that?




On 2006-11-04, Jean-Rene David <[EMAIL PROTECTED]> wrote:
> * Yegappan Lakshmanan [2006.11.04 13:00]:
> > You can try using CTRL-^ to jump to the alternate buffer.
> 
> Good idea.

You can also use ":e#" to edit the alternate buffer.

> Well personally I find not having a "quit" or
> "exit" function pretty close to a bug. But there
> are so many ways around it I don't find it a very
> serious one...

This is not a bug, nor close to a bug.

Opening the file explorer in a buffer is no different fundamentally
from opening a file in a buffer.  The commands and behaviors are
different from those you use when editing a file, but it's still
just text in a buffer.

When you open file A, then open file B, then want to go back to A,
you don't do so by quitting B--you explicitly open A.

Regards,
Gary

-- 
Gary Johnson | Agilent Technologies
[EMAIL PROTECTED] | Wireless Division
 | Spokane, Washington, USA


Re: Getting out of netrw

2006-11-04 Thread Gary Johnson
On 2006-11-04, Yegappan Lakshmanan <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> On 11/3/06, Jean-Rene David <[EMAIL PROTECTED]> wrote:
> > Say I open vim7's new super duper file explorer
> > "netrw" to browse some local directory. Say then I
> > decide I don't want to open any new file and just
> > want to go back to what I was doing. What would be
> > the standard way to do that?
> >
> > I can use  to eventually land up where I was
> > but I need to backtrack all the motion commands I
> > did in the netrw buffer.
> >
> > I thought of using :q but that closes vim if only
> > one window is open.
> >
> > Am I missing something obvious?
> >
> 
> You can try using CTRL-^ to jump to the alternate buffer.
> 
> But for some reason, this doesn't work right after starting
> up Vim. It works after that.
> 
>$ vim xyz.txt
>:e .
> 
> If you press CTRL-^ now to jump to the alternate buffer,
> it says, "E23: No alternate file". But if you do the following,
> then it works.
> 
>$ vim xyz.txt
>:e .
>:e xyz.txt
> 
> Now, you can use CTRL-^ to jump between netrw buffer
> and xyz.txt file.
> 
> This looks like a bug in netrw.

Your first example works fine for me, whether xyz.txt exists or not.  
It may be that you have an old version of netrw.  I'm using version 
103g.

Regards,
Gary

-- 
Gary Johnson | Agilent Technologies
[EMAIL PROTECTED] | Wireless Division
 | Spokane, Washington, USA


Re: Getting out of netrw

2006-11-04 Thread Jean-Rene David
* Yegappan Lakshmanan [2006.11.04 13:00]:
> You can try using CTRL-^ to jump to the alternate buffer.

Good idea.

Most suggestions were useful, BTW, thanks all.

> This looks like a bug in netrw.

Well personally I find not having a "quit" or
"exit" function pretty close to a bug. But there
are so many ways around it I don't find it a very
serious one...

-- 
JR


Re: Getting out of netrw

2006-11-04 Thread Yegappan Lakshmanan

Hi,

On 11/3/06, Jean-Rene David <[EMAIL PROTECTED]> wrote:

Say I open vim7's new super duper file explorer
"netrw" to browse some local directory. Say then I
decide I don't want to open any new file and just
want to go back to what I was doing. What would be
the standard way to do that?

I can use  to eventually land up where I was
but I need to backtrack all the motion commands I
did in the netrw buffer.

I thought of using :q but that closes vim if only
one window is open.

Am I missing something obvious?



You can try using CTRL-^ to jump to the alternate buffer.

But for some reason, this doesn't work right after starting
up Vim. It works after that.

   $ vim xyz.txt
   :e .

If you press CTRL-^ now to jump to the alternate buffer,
it says, "E23: No alternate file". But if you do the following,
then it works.

   $ vim xyz.txt
   :e .
   :e xyz.txt

Now, you can use CTRL-^ to jump between netrw buffer
and xyz.txt file.

This looks like a bug in netrw.

- Yegappan


Re: Getting out of netrw

2006-11-04 Thread Marius Roets
On Friday 03 November 2006 22:14, Charles E Campbell Jr wrote:
>
> Or you could use  :Texplore  to open a netrw-browser in a new tab!
>
And so we learn new things every day ;)

Thanks
Marius



Re: Getting out of netrw

2006-11-03 Thread Charles E Campbell Jr

Marius Roets wrote:


On 11/3/06, Jean-Rene David <[EMAIL PROTECTED]> wrote:


I thought of using :q but that closes vim if only
one window is open.

Am I missing something obvious?




Then F2 opens explorer in a new tab, and q closes the tab, and
you should be back where you were before pressing F2.


Or you could use  :Texplore  to open a netrw-browser in a new tab!

Regards,
Chip Campbell



Re: Getting out of netrw

2006-11-03 Thread Marius Roets

On 11/3/06, Jean-Rene David <[EMAIL PROTECTED]> wrote:


I thought of using :q but that closes vim if only
one window is open.

Am I missing something obvious?


I use :Sexplore (or :Vexplore) to open the explorer. Then it's not a
problem using :q. Or if you really want to be fancy, put this in your
.vimrc:
function MyExplore()
 tabnew
 Explore
 nmap  q :q
endfunction

nmap  :call MyExplore()

Then F2 opens explorer in a new tab, and q closes the tab, and
you should be back where you were before pressing F2.

Marius


Re: Getting out of netrw

2006-11-03 Thread Charles E Campbell Jr

Jean-Rene David wrote:


Say I open vim7's new super duper file explorer
"netrw" to browse some local directory. Say then I
decide I don't want to open any new file and just
want to go back to what I was doing. What would be
the standard way to do that?

I can use  to eventually land up where I was
but I need to backtrack all the motion commands I
did in the netrw buffer.
 


You can use the jumplist to get a listing of locations where you've been:

:ju

The left hand column is a count that you can use to precede .
For example:

 jump line  col file/line
   3  10 some text
   2 700 another line
   1  1154   23 end.

and  3 will jump to entry #3.

Regards,
Chip Campbell





Getting out of netrw

2006-11-03 Thread Jean-Rene David
Say I open vim7's new super duper file explorer
"netrw" to browse some local directory. Say then I
decide I don't want to open any new file and just
want to go back to what I was doing. What would be
the standard way to do that?

I can use  to eventually land up where I was
but I need to backtrack all the motion commands I
did in the netrw buffer.

I thought of using :q but that closes vim if only
one window is open.

Am I missing something obvious?

-- 
JR