第一步:从官网下载Sublime text3,完成安装
第二步:安装插件管理:
ctrl + ` 调出console
进入这个链接:Installation - Package Control
复制以下代码到控制台:
import urllib.request,os,hashlib; h = 'df21e130d211cfc94d9b0905775a7c0f' + '1e3d39e33b79698005270310898eea76'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
然后回车一下,然后重启一下Sublime text3(如果在Perferences->package settings中看到package control 这一项,则说明安装成功)。
第三步:安装插件
①:cmd + shift + p 调出命令面板,输入install后选择Package control:install Package这一选项
②:等加载完成之后,在搜索栏寻找需要的插件
第四步:常用插件
① emmet 快速编写HTML和CSS代码
② Side Bar Enhancements 侧边栏优化(只支持3)
③Theme Soda 更换主题
④Clickable URLs 可点击的URL
⑤Material Theme 也是主题 效果图如下:
第五步:设置侧边栏中的HTML文件快速在浏览器中打开的快捷键
①按照下面的图片操作
② 在弹出的Sublime窗口的右侧的中括号中加入如下代码
// Chrome
{ "keys": ["command+1"], "command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "/Applications/Google Chrome.app",
"extensions":".*"
}
},
{ "keys": ["ctrl+r"], "command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "/Applications/Google Chrome.app",
"extensions":".*"
}
},
// Safari
{ "keys": ["command+2"], "command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "/Applications/Safari.app",
"extensions":".*"
}
},
// Firefox
{ "keys": ["command+3"], "command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "/Applications/Firefox.app",
"extensions":".*"
}
}
然后CMD + s 保存一下,保存后效果如下:
以上的效果就会实现侧边栏中的HTML文件快速在浏览器中打开:
操作方式为在侧边栏中选中某个文件,然后cmd + 1 ,或者 ctrl + r 此时文件就会快速在谷歌浏览器中打开,会节省很多时间。
或者是以下代码:
// Chrome
{ "keys": ["command+1"], "command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "/Applications/Google Chrome.app",
"extensions":".*"
}
},
// Safari
{ "keys": ["command+2"], "command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "/Applications/Safari.app",
"extensions":".*"
}
},
// Firefox
{ "keys": ["command+3"], "command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "/Applications/Firefox.app",
"extensions":".*"
}
}