Hi,

In a vim script, what's the best way to load a file (to search for
some info), then get rid of it again without any side-effects.
Eg, it shouldn't change the alternative buffer, it should no longer
be loaded in a hidden buffer, and it should work even when there's not
enough room to split the window.

I could split to a new tab, then load the file into it, then do :bdel.
But would this cause tab-flashing as the GUI is changed, or is there a
way to prevent the update?  And would this be an inefficient way to do
it?

I could also use readfile(), which would probably suffice, but is this
more or less efficient than loading a file into a vim buffer.  I will
still need to read the whole file either way since I don't know how
far through the file I will need to look.

Now if there was a searchfile() function, that would be handy :-)
Eg, pass it a file name and a pattern to search for, and maybe the
maximum number of matches, and a list of matching lines is returned.
That way if the match is found early and you only ask for one, then
vim wouldn't bother reading the rest of the file.

Rob.

--

Robert Webb <[EMAIL PROTECTED]>,
Software developer
http://www.software3d.com

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

Raspunde prin e-mail lui