SideBarEnhancements本是增強側邊欄的插件,這里將教大家如何用來做sublime text 3瀏覽器預覽插件,並可自定義瀏覽器預覽的快捷鍵。
第一步:安裝此插件,搜索相關教程,本博客有說明
第二步:安裝好以后點擊工具欄的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" },
//chrome { "keys": ["f1"], "command": "side_bar_files_open_with", "args": { "paths": [], "application": "C://Program Files (x86)//Google//Chrome//Application//chrome.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瀏覽器預覽效果,當然你也可以自己定義喜歡的快捷鍵,最后注意代碼中的瀏覽器路徑要以自己電腦里的文件路徑為准。