Tony Mechelynck wrote:

> The script will only work on Windows anyway, because each OS has its own
> way (when it has one) of opening a given non-executable file in the
> default handler program for that filetype. There's no portable way to do
> that, you've got to use, for each OS, whatever works in that OS. Windows
> has cmd /c, so in Windows you can use that. You can even test
>
>       if has('win32') || has('win64')
>               !start cmd /c %
>       endif

What would be useful is a new vim function, maybe open(), to open a given
file or url in whatever way is appropriate for that system.  An optional
second argument could specify how to open it, such as "open" or "print" on
Windows.  For Windows, it would just call ShellExecute(), which would also
avoid any DOS window appearing, even the one that briefly flashes with
":silent ! start".  It would make script-writing for this sort of thing
easier, and portable without having to think about it.

Rob.

--

Robert Webb <[EMAIL PROTECTED]>,
Want to make polyhedra?
http://www.software3d.com/Stella.php


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

Raspunde prin e-mail lui