BufReadPre event vs file that isn't readable for now: How to mount a volume before reading the file?

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

BufReadPre event vs file that isn't readable for now: How to mount a volume before reading the file?

lith
Hi!

Let's say, I want to edit a file that is on a volume that is not mounted yet. From the perspective of vim, the file doesn't exist. Whenever I want to edit that file, I have to mount that volume first.

The docs on the BufReadPre event say:

BufReadPre When starting to edit a new buffer, before
                                reading the file into the buffer.  Not used
                                if the file doesn't exist.

So, I cannot use this event to prepare reading a file that is temporarily unavailable, e.g., because its volume isn't mounted yet.

Is there another event that I can use to mount the volume before reading the file.

Regards,
Tom

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: BufReadPre event vs file that isn't readable for now: How to mount a volume before reading the file?

Bram Moolenaar

Tom wrote:

> Let's say, I want to edit a file that is on a volume that is not mounted yet. From the perspective of vim, the file doesn't exist. Whenever I want to edit that file, I have to mount that volume first.
>
> The docs on the BufReadPre event say:
>
> BufReadPre When starting to edit a new buffer, before
> reading the file into the buffer.  Not used
> if the file doesn't exist.
>
> So, I cannot use this event to prepare reading a file that is
> temporarily unavailable, e.g., because its volume isn't mounted yet.
>
> Is there another event that I can use to mount the volume before
> reading the file.

Have a look at BufReadCmd.

--
hundred-and-one symptoms of being an internet addict:
127. You bring your laptop and cellular phone to church.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.