Show the list of the files inside the folder of the current file

45 views
Skip to first unread message

Javier Garcia

unread,
Nov 13, 2012, 9:48:12 AM11/13/12
to vim...@googlegroups.com
Hi,

imagine I'm editing file, and I want to show the list of the files inside the folder who belongs the file I'm editing, to edit one of them.

How can I do that? Is there any way using FuzzyFinder?

Shlomi Fish

unread,
Nov 13, 2012, 9:57:30 AM11/13/12
to vim...@googlegroups.com
Hi Javier,
You can use the :E command.

Regards,

Shlomi Fish

--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
Interview with Ben Collins-Sussman - http://shlom.in/sussman

Linux — Because Software Problems Should not Cost Money.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

Javier Garcia

unread,
Nov 13, 2012, 11:29:26 AM11/13/12
to vim...@googlegroups.com
Thanks Shlomi, but in that case, I should change first to the folder's file using something like :cd %:h. In other case, :E shows the root proyect folder files, doesn't it?

Chris Lott

unread,
Nov 13, 2012, 11:30:57 AM11/13/12
to vim...@googlegroups.com
On Tue, Nov 13, 2012 at 5:48 AM, Javier Garcia <tiren...@gmail.com> wrote:
> imagine I'm editing file, and I want to show the list of the files inside the folder who belongs the file I'm editing, to edit one of them.
>
> How can I do that? Is there any way using FuzzyFinder?

Look at:
h :FufFileWithCurrentBufferDir@en

CtrlP is a good, maintained, alternative to FuzzyFinder which has
options so that finding a file can be the file's current working
directory (or a few other options).

You could also look at
:h acd
if that works with your plugins.

c
--
Chris Lott <ch...@chrislott.org>

Javier Garcia

unread,
Nov 13, 2012, 11:32:42 AM11/13/12
to vim...@googlegroups.com
I meant when I open a new tab.

Chris Lott

unread,
Nov 13, 2012, 11:41:59 AM11/13/12
to vim...@googlegroups.com
On Tue, Nov 13, 2012 at 7:32 AM, Javier Garcia <tiren...@gmail.com> wrote:
> I meant when I open a new tab

I don't understand the question. Do you want to open a file in a new
tab from Fuzzy File finder? Then use ctrl-l

Otherwise, what are you opening in the new tab? If nothing, then your
current working directory is your home directory and that's what
FuzzyFile finder shows. There is no "folder that belongs to the file
I'm editing" because you have no file open.

What directory do you want it to be if you have nothing in a buffer?
How is Vim to know?

taco

unread,
Nov 13, 2012, 10:33:51 AM11/13/12
to vim...@googlegroups.com
On 11/13/2012 10:57 PM, Shlomi Fish wrote:
> Hi Javier,
>
> On Tue, 13 Nov 2012 06:48:12 -0800 (PST)
> Javier Garcia <tiren...@gmail.com> wrote:
>
>> Hi,
>>
>> imagine I'm editing file, and I want to show the list of the files inside the
>> folder who belongs the file I'm editing, to edit one of them.
>>
>> How can I do that? Is there any way using FuzzyFinder?
>>
> You can use the :E command.
>
> Regards,
>
> Shlomi Fish
>
thank you very much, this is very useful.

Tony Mechelynck

unread,
Nov 13, 2012, 6:35:53 PM11/13/12
to vim...@googlegroups.com, Javier Garcia
FuzzyFinder (which I don't use) is not necessary.

To see the contents of the directory of the current file:

in a new window, horizontally split
:new %:h

in a new window, vertically split
:vert new %:h

in a new tab
:tabnew %:h

in a new tab at far right
:exe tabpagenr('$') 'tabnew %:h'

see
:help pi_netrw.txt
:help :new
:help current-file
:help filename-modifiers
:help :vert
:help tabnew
See also
:help :aboveleft
:help :leftabove
:help :belowright
:help :rightbelow
:help :topleft
:help :botright
:help :tab
for even finer control on where the new window or tab opens.


Best regards,
Tony.
--
TIM: That is not an ordinary rabbit ... 'tis the most foul cruel and
bad-tempered thing you ever set eyes on.
ROBIN: You tit. I soiled my armour I was so scared!
"Monty Python and the Holy Grail" PYTHON (MONTY)
PICTURES LTD

Reply all
Reply to author
Forward
0 new messages