- 安裝package control
簡(jiǎn)單的安裝方法:
從菜單 View - Show Console 或者 ctrl + ~ 快捷鍵,調(diào)出 console。將以下 Python 代碼粘貼進(jìn)去并 enter 執(zhí)行,不出意外即完成安裝。以下提供 ST3 和 ST2 的安裝代碼:
Sublime Text 3:
import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())
Sublime Text 2:
import urllib2,os; 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( ))); open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( 'http://sublime.wbond.net/' +pf.replace( ' ','%20' )).read()); print( 'Please restart Sublime Text to finish installation')
更多請(qǐng)參考
插件大全1例如:ColorPicker
插件大全2
- 安裝漢化包
ctrl+`,復(fù)制命令或者直接復(fù)制下面:
import urllib.request,os,hashlib; h = 'eb2297e1a458f27d836c04bb0cbaf282' + 'd0e7a3098092775ccb37ca9d6b2e4b7d'; 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)
1.點(diǎn)擊Preferences/Package Control,然后點(diǎn)擊Package Control:Install Package,(第一次運(yùn)行可以要幾秒鐘,因?yàn)橐螺dPackage Control里面存在的包"花名冊(cè)"),然后在彈出的命令界面,輸入Chinese,選擇ChineseLocalization(回車(chē)或者鼠標(biāo)單擊擊)。
2.切換語(yǔ)言,幫助(H)/Language/簡(jiǎn)體中文,繁體中文,日本語(yǔ),English。
- 安裝FileHeader插件
自動(dòng)創(chuàng)建文件開(kāi)頭模板,并且會(huì)根據(jù)最后的保存時(shí)間修改更新時(shí)間
- 安裝CSS Format插件
css格式化
- 安裝emmet插件
1、command + shift + p調(diào)出命令窗口,輸入install,選中package control:install package,等待
2、command + shift + p調(diào)出命令窗口,輸入emmet
3、【如果】刪除已安裝插件:按ctr+shift +p然后輸入remove 回車(chē),再輸入要?jiǎng)h除的插件名。
開(kāi)始使用:輸入以下簡(jiǎn)寫(xiě),按tab鍵
html:5
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
</body>
</html>
注意:
編寫(xiě)中文網(wǎng)頁(yè),記得把頭部語(yǔ)言改為 <html lang="zh-cn"> 而不是<html lang="en">
html:xt【過(guò)渡型,PC端適應(yīng)老式瀏覽器】tips:DW生成的過(guò)渡類(lèi)型文件沒(méi)有:xml:lang="en"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org /TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Document</title>
</head>
<body>
</body>
</html>
html:4t
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Document</title>
</head>
<body>
</body>
</html>
html:4s
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Document</title>
</head>
<body>
</body>
</html>
html:xxs
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Document</title>
</head>
<body>
</body>
</html>
ul#nav>li.itemS*4>a{Item $}
<ul id="nav">
<li class="itemS"><a href="">Item 1</a></li>
<li class="itemS"><a href="">Item 2</a></li>
<li class="itemS"><a href="">Item 3</a></li>
<li class="itemS"><a href="">Item 4</a></li>
</ul>