Opening multiple file in vim using patterns

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Opening multiple file in vim using patterns

Druce, Richard
Hi ppls,

This is a bit of a newbie question, (I've only been using vim for a
couple of days now) so I apologise in advance for any stupidities that
might be present. When doing development work, I often want to add extra
files into the current buffer I am editing. So if my current directory
was /dev and I had the helloWorld.cpp and helloWorld.h in the /dev/src
and /dev/include directories, I would like to be able to type something
like :badd <pattern> where <pattern> is something like /.*/helloWorld.*
so that both these files are added into the current buffer and can be
accessed. Even better would to be able to to this with the TlistAddfiles
command so that the tags for all these files would appear on the right.
Is this possible.. Or is this even the best way to do this? Thanks for
any help in advance.=20

Cheers,
Richard.
Reply | Threaded
Open this post in threaded view
|

Re: Opening multiple file in vim using patterns

Stefan Karlsson-3
This is not a complete solution to your problem but I think you should
take a look at the ":argadd" command.

You can search a directory tree with e.g. "argadd
E:\Development\**\*.h". I'm not sure you can use regexps (which I guess
is what you want) to select the files and directories though.

See ":help :argadd" for the complete story.

--
Stefan Karlsson | [hidden email]


Druce, Richard wrote:

> Hi ppls,
>
> This is a bit of a newbie question, (I've only been using vim for a
> couple of days now) so I apologise in advance for any stupidities that
> might be present. When doing development work, I often want to add extra
> files into the current buffer I am editing. So if my current directory
> was /dev and I had the helloWorld.cpp and helloWorld.h in the /dev/src
> and /dev/include directories, I would like to be able to type something
> like :badd <pattern> where <pattern> is something like /.*/helloWorld.*
> so that both these files are added into the current buffer and can be
> accessed. Even better would to be able to to this with the TlistAddfiles
> command so that the tags for all these files would appear on the right.
> Is this possible.. Or is this even the best way to do this? Thanks for
> any help in advance.=20
>
> Cheers,
> Richard.
>
>  
Reply | Threaded
Open this post in threaded view
|

Re: Opening multiple file in vim using patterns

Yegappan Lakshmanan
In reply to this post by Druce, Richard
Hello,

On 9/30/05, Druce, Richard <[hidden email]> wrote:

> Hi ppls,
>
> When doing development work, I often want to add extra
> files into the current buffer I am editing. So if my current directory
> was /dev and I had the helloWorld.cpp and helloWorld.h in the /dev/src
> and /dev/include directories, I would like to be able to type something
> like :badd <pattern> where <pattern> is something like /.*/helloWorld.*
> so that both these files are added into the current buffer and can be
> accessed.
>

>
> Even better would to be able to to this with the TlistAddfiles
> command so that the tags for all these files would appear on the right.
> Is this possible.
>

You can use the TlistAddFiles command (from the taglist plugin) to add
multiple files (and the tags defined in them) to the taglist window.
In the above case, you can use the following command from the dev
directory:

   :TlistAddFiles */helloWorld.*

- Yegappan