vim - 如何打开http ://localhost in my web browser from Vim?

标签 vim localhost

基本上,我想告诉Vim:

  • 打开我的Web浏览器(例如Firefox)
  • 以这个地址打开此文件(例如index.php):http://localhost
  • 换句话说:http://localhost/index.php

  • PS:不幸的是我使用Windows XP

    最佳答案

    如果您在Windows上运行Vim,则可以使用:

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

    这将使用默认的浏览器,如果要启动特定的浏览器,则将需要可执行文件的显式路径(而不是启动)。

    从Vim帮助cmd:

    :!{cmd}

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



    显然,如果您使用的是其他系统,则只需要使用适当的命令即可在该平台上启动浏览器。

    关于vim - 如何打开http ://localhost in my web browser from Vim?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2039835/

    相关文章:

    Vim:查看文件结构 - 类、方法、函数

    vim - 普通模式下Control+空格vim键绑定(bind)不起作用

    java - 端口 8080 已被 "SYSTEM"使用

    java - 在远程环境中运行 grails 的问题

    vim - 当我输入 `:q` 或 `:qa` 时,如何使 gvim 主窗口不退出?

    vim - 如何从 `Insert mode` 撤消在此模式下所做的更改?

    windows-xp - 为什么 "Diff with Vim"命令不起作用?

    java - 将 jar 作为 Linux 服务运行 - init.d 脚本在启动应用程序时卡住

    python - 连接到在本地主机上运行的 solr 服务器

    node.js - 在本地主机模拟跨站请求