[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vim
Subject:    Re: navigating directories from vim
From:       Neil Zanella <nzanella () cs ! mun ! ca>
Date:       2004-03-22 2:11:02
Message-ID: Pine.LNX.4.44.0403212248360.24181-100000 () garfield ! cs ! mun ! ca
[Download RAW message or body]


On Sun, 21 Mar 2004, Suresh Govindachar wrote:

> If the file name is foo.c, then:
> 
>      :e  %:h

Suresh,

Thank you for your reply...

This does not work for me, even though my pwd is
the current directory. I am using vim 6.2 and get
the following error when I type it:

E500: Evaluates to an empty string

> or :sf %:h

Same error for the above command.

> Preceding works only if pwd is not the parent 
> directory. If pwd is the parent directory then 
> the following work "as expected":
>      
>     :sf .
>     :sf   ./../..

This works for me. However it shows the contents of the directory
in another window. To have the directory contents replace the
current file directly it is also possible to type:

:vi .
:vi ..
:vi ../..
:vi ../foo/bar

etc...

> 
> You can also do things like:
> 
>     :sf   %:h/../another_dir/foo.ext
>     :cd  %:h

Hmm... this %:h thing is just not working for me.

Thanks,

Neil

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic