Thanks, sorry for my poor english. I try to explain with an example :

I have 4 opened files in vim : file1.txt file2.txt file3.txt file4.txt
I want to search the pattern 'abcd'. The 'abcd' string is present in
file2.txt and file4.txt.

If I make : ":bufdo /abcd". I will obtain something like that :

"file1.txt"
Pattern not found: abcd
"file2.txt"
"file3.txt"
Pattern not found: abcd
"file4.txt"

At the end of the command, I am in the file4.txt. My problem is that I
would be in file2.txt at the end of the 'bufdo' command.


I try vimgrep, I obtain a good result with : ":1vimgrep <pattern>
<file>". However, I don't want search in <file> but rather only in
opened file in vim. Is it possible ?




On Tue, Jun 9, 2009 at 6:51 PM, Ben Fritz<[email protected]> wrote:
>
>
>
> On Jun 9, 9:28 am, Cyril snt <[email protected]> wrote:
>> I know that several questions already exist about this problem.
>> However, when I make a search in several files, I see something like
>> that:
>>
>> "main.sh" [unix] 108L, 2504C
>> "default.sh" [unix format] 46 lines, 745 characters
>> E486: Pattern not found: TAG
>> "ready.sh" [unix format] 37 lines, 733 characters
>> E486: Pattern not found: TAG
>> "restart.sh" [unix format] 33 lines, 429 characters
>> E486: Pattern not found: TAG
>> "smart_ipconfig.sh" [unix format] 69 lines, 1342 characters
>> E486: Pattern not found: TAG
>> "vlan_tag.sh" [unix format] 38 lines, 553 characters
>> "write_conf.sh" [unix format] 21 lines, 253 characters
>> E486: Pattern not found: TAG
>>
>
> What command are you using to search in several files? I do not see
> anything like this when using :vimgrep.
>
>> But I want to stop to the first occurence of the pattern. In my
>> example, I need to stop in main.sh and if I remake the command in
>> vlan_tag.sh.
>>
>
> What do you mean "stop to the first occurence"? If you want to simply
> jump to the first match after the search is done, then :grep
> and :vimgrep do that for you by default. If you want to interrupt the
> seach when the first match is found to save time by not searching for
> additional hits, I don't think that's possible with :vimgrep, but your
> system's grep program (called via :grep of course) may have an option
> for that.
>
> I'm absolutely clueless as to what you meant by "if I remake the
> command in vlan_tag.sh". Please elaborate, preferably with a concrete
> example including Vim commands, and what you want Vim to do (exactly).
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to