How do I open http://localhost in my web browser from Vim?

localhost, vim

Solution

If you are running Vim on windows, then this will work:

:! start http://localhost/index.php

This will use the default browser, if you wanted to start a specific browser then you would need the explicit path to the executable (instead of start).

From the Vim help cmd:

:!{cmd}

Execute {cmd} with the shell. See also the 'shell' and 'shelltype' option.

Obviously, if you are on some other system you just need to use the appopriate command to start the browser on that platform.

Problem

Basically, I want to tell Vim: - Open my web browser (for instance, Firefox) - Open this file (say index.php) in thought this address : http://localhost - In other words: http://localhost/index.php PS: Unfortunately I use Windows XP

Original source

Related problems