SideBarEnhancements本是增强侧边栏的插件,这里将教大家如何用来做sublime text 3浏览器预览插件,并可自定义浏览器预览的快捷键。
第一步:安装此插件,
在sublime里面ctrl+shift+p
install package 回车
输入SideBarEnhancements安装
第二步:安装好以后点击工具栏的preferences > package setting > side bar > Key Building-User,键入以下代码
[
/*{ "keys": ["alt+f12"],
"command": "side_bar_open_in_browser",
"args":{"paths":[], "type":"production", "browser":""}
},*/
{ "keys": ["ctrl+shift+c"], "command": "copy_path" },
/rome
{ "keys": ["f1"], "command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "C://Program Files (x86)//Google//Chrome//Application/rome.exe",
"extensions":".*"
}
},
//firefox
{ "keys": ["f2"], "command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "E://软件//Firefox//firefox.exe",
"extensions":".*" //匹配任何文件类型
}
},
//ie
{ "keys": ["f3"], "command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "C://Program Files//Internet Explorer//iexplore.exe",
"extensions":".*"
}
},
]
这里设置按Ctrl+Shift+C复制文件路径,按F1~F3分别在chrome,firefox,IE浏览器预览效果,当然你也可以自己定义喜欢的快捷键,最后注意代码中的浏览器路径要以自己电脑里的文件路径为准。