Re: Network-oriented file reading and writing
- Charles Campbell wrote:
> Anyway, here's the idea: I've introduced two new autocmd events, BufReadCmdNice idea. I wonder if a more generic solution would be possible. Suppose
> and BufWriteCmd. When they're triggered they *don't* actually read or write,
> but they execute associated command(s) (like any good autocmd does). It just
> so happens that with the <.vimrc> inclusion given below, that the appropriate
> Nr or Nw command gets executed, which in turn does the rcp or ftp operation
> for you.
the pattern for the autocommand is not enough to decide if the text should be
read from a file or obtained with a command. Perhaps a global variable need
to be checked. Some script would be needed to decide what to do:
au BufReadPre <pattern> call GetText()
<get text with command>
<prevent reading text from file>
In the situation that the text is read with a command, there needs to be some
way to prevent the file-read action to take place. Since autocommands may
nest, this is a bit tricky.
LAUNCELOT: No "Aaaaarrrrrrggghhh ... " at the back of the throat.
BEDEVERE: No! "Oooooh!" in surprise and alarm!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/-/-- Bram Moolenaar --- Bram@... --- http://www.moolenaar.net --\-\
\ \ Vim: http://www.vim.org ICCF Holland: http://www.vim.org/iccf / /