Sublime Text 3 編寫的 HTML 文件如何在瀏覽器中打開?能夠在 HTML 文件中右鍵點擊
Open in Browser
選項,這種方式常常出現網頁打不開的狀況。例如路徑不容許出現中文;莫名其妙打開 Firefox 瀏覽器等。這裏介紹使用 View In Browser
插件來實現 HTML 文件在瀏覽器中打開的功能。web
Package Control 插件能夠方便咱們查找、安裝、更新和刪除 Sublime Text 使用到的插件。安裝 Package Control 有兩種方式:自動安裝和手動安裝。chrome
自動安裝瀏覽器
自動安裝須要經過 Sublime Text 的控制檯,使用 Ctrl + \
快捷鍵或者
View->
Show Console(
視圖->
顯示控制檯`) 菜單,打開控制器窗口,而後粘貼如下代碼到窗口中:工具
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 Text 2,則使用如下代碼:ui
import urllib2,os,hashlib; h = 'df21e130d211cfc94d9b0905775a7c0f' + '1e3d39e33b79698005270310898eea76'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler()) ); by = urllib2.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), 'wb' ).write(by) if dh == h else None; print('Error validating download (got %s instead of %s), please try manual install' % (dh, h) if dh != h else 'Please restart Sublime Text to finish installation')
手動安裝url
Sublime Text
> Preferences(偏好設置)
> Browse Packages…(瀏覽包...)
菜單,在當前目錄下找到 Installed Packages(已導入的包)
目錄。Installed Packages
目錄。Package Control
安裝完成後,在 Sublime Text 菜單的 Preferences (偏好設置)
菜單裏面,能夠看到 Package Control
菜單項,點擊菜單或者使用 command + shift + p
快捷鍵啓動 Package Control
。spa
插件管理工具 Package Controlfirefox
在打開的窗口中,輸入 pci
,選擇 Package Control: Install Package
選項,稍後在彈出的窗口中輸入 View In Browser
,點擊安裝 View In Browser
插件。插件
View In Browser 插件3d
安裝完成後,使用默認的快捷鍵:
Firefox瀏覽器: Ctrl + Alt + f
Chrome瀏覽器: Ctrl + Alt + c
IE瀏覽器: Ctrl + Alt + i
Safari瀏覽器: Ctrl + Alt + s
若是想要自定義快捷鍵的話,能夠在 Keybindings
中配置各瀏覽器快捷鍵。
{ "keys": [ "ctrl+alt+v" ], "command": "view_in_browser" }, { "keys": [ "f5" ], "command": "view_in_browser", "args": { "browser": "firefox" } }, { "keys": [ "f3" ], "command": "view_in_browser", "args": { "browser": "chrome" } }, { "keys": [ "ctrl+alt+i" ], "command": "view_in_browser", "args": { "browser": "iexplore" } }, { "keys": [ "f4" ], "command": "view_in_browser", "args": { "browser": "safari" } }
經過 Package Control
還能夠已經安裝的插件,使用 command + shift + p
調出插件管理窗口,輸入 pcr
,選擇 Package Control: Remove Package
選項,在隨後的窗口中選擇想要移除的插件就能夠移除了。
Package Control 移除插件
選擇要移除的插件
經過安裝 Package Control
插件管理工具,能夠方便的管理 Sublime Text 所用到的插件。
做者:GLGeek
連接:https://www.jianshu.com/p/686672aff949
來源:簡書
簡書著做權歸做者全部,任何形式的轉載都請聯繫做者得到受權並註明出處。
Detect languageAfrikaansAlbanianAmharicArabicArmenianAzerbaijaniBasqueBelarusianBengaliBosnianBulgarianCatalanCebuanoChichewaChinese (Simplified)Chinese (Traditional)CorsicanCroatianCzechDanishDutchEnglishEsperantoEstonianFilipinoFinnishFrenchFrisianGalicianGeorgianGermanGreekGujaratiHaitian CreoleHausaHawaiianHebrewHindiHmongHungarianIcelandicIgboIndonesianIrishItalianJapaneseJavaneseKannadaKazakhKhmerKoreanKurdishKyrgyzLaoLatinLatvianLithuanianLuxembourgishMacedonianMalagasyMalayMalayalamMalteseMaoriMarathiMongolianMyanmar (Burmese)NepaliNorwegianPashtoPersianPolishPortuguesePunjabiRomanianRussianSamoanScots GaelicSerbianSesothoShonaSindhiSinhalaSlovakSlovenianSomaliSpanishSundaneseSwahiliSwedishTajikTamilTeluguThaiTurkishUkrainianUrduUzbekVietnameseWelshXhosaYiddishYorubaZulu |
|
AfrikaansAlbanianAmharicArabicArmenianAzerbaijaniBasqueBelarusianBengaliBosnianBulgarianCatalanCebuanoChichewaChinese (Simplified)Chinese (Traditional)CorsicanCroatianCzechDanishDutchEnglishEsperantoEstonianFilipinoFinnishFrenchFrisianGalicianGeorgianGermanGreekGujaratiHaitian CreoleHausaHawaiianHebrewHindiHmongHungarianIcelandicIgboIndonesianIrishItalianJapaneseJavaneseKannadaKazakhKhmerKoreanKurdishKyrgyzLaoLatinLatvianLithuanianLuxembourgishMacedonianMalagasyMalayMalayalamMalteseMaoriMarathiMongolianMyanmar (Burmese)NepaliNorwegianPashtoPersianPolishPortuguesePunjabiRomanianRussianSamoanScots GaelicSerbianSesothoShonaSindhiSinhalaSlovakSlovenianSomaliSpanishSundaneseSwahiliSwedishTajikTamilTeluguThaiTurkishUkrainianUrduUzbekVietnameseWelshXhosaYiddishYorubaZulu |
|
|
|
|
|