Copyright 2016 by 蔡舒啸 保持署名-非商业性使用-相同方式共享 Creative Commons BY-NC-ND 3.0

目录

环境:

Ubuntu 16.04 64位

github atom 1.8.0

google-chrome 版本 51.0.2704.106 (64-bit) deb 格式安装包

node 4.4.4

npm 2.15.1

浏览器可以打开 github.com

工具:

github atom

google-chrome

atom 插件 - atom-shell-commands 插件项目主页 https://atom.io/packages/atom-shell-commands

步骤:

打开命令行(在桌面按下 Ctrl+Alt+T),输入

apm install atom-shell-commands

等待一会儿安装成功

按插件主页的教程,用你最喜欢的方式打开文件  ~/.atom/config.cson(修改前先备份),在最后插入以下内容,保存:

"atom-shell-commands":

commands: [

{

name: "open with chrome"

command: "google-chrome"

arguments: [

"{FileName}"

]

options:

cwd: "{FileDir}"

keymap: 'ctrl-2'

}

]

重启 atom,新建 foo.html,如下:

点击这里

document.write("Hello, World!");

document.write("

This is a heading

");

保存。然后按快捷键 ctrl+2,就用 google-chrome 打开了 foo.html!

我的天!真的启动了 google-chrome,打开了 foo.html!

这意味着,atom 开发前端代码可以随时用 chrome 调试!太方便了!

感谢 atom-shell-commands 插件的作者韦易笑@知乎!

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐