- 安裝package control
簡單的安裝方法:
從菜單 View - Show Console 或者 ctrl + ~ 快捷鍵,調出 console。將以下 Python 代碼粘貼進去並 enter 執行,不出意外即完成安裝。以下提供 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')
-
安裝漢化包
ctrl+`,復制命令或者直接復制下面:
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.點擊Preferences/Package Control,然后點擊Package Control:Install Package,(第一次運行可以要幾秒鍾,因為要下載Package Control里面存在的包"花名冊"),然后在彈出的命令界面,輸入Chinese,選擇ChineseLocalization(回車或者鼠標單擊擊)。
2.切換語言,幫助(H)/Language/簡體中文,繁體中文,日本語,English。
- 安裝FileHeader插件
自動創建文件開頭模板,並且會根據最后的保存時間修改更新時間
- 安裝CSS Format插件
css格式化
- 安裝emmet插件
1、command + shift + p調出命令窗口,輸入install,選中package control:install package,等待
2、command + shift + p調出命令窗口,輸入emmet
3、【如果】刪除已安裝插件:按ctr+shift +p然后輸入remove 回車,再輸入要刪除的插件名。
開始使用:輸入以下簡寫,按tab鍵
html:5
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> </body> </html>
注意:
編寫中文網頁,記得把頭部語言改為 <html lang="zh-cn"> 而不是<html lang="en">
html:xt【過渡型,PC端適應老式瀏覽器】tips:DW生成的過渡類型文件沒有: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>
官方語法文檔
文/飯團小家(簡書作者)
原文鏈接:http://www.jianshu.com/p/f44e91bf9dfb
著作權歸作者所有,轉載請聯系作者獲得授權,並標注“簡書作者”。
原文鏈接:http://www.jianshu.com/p/f44e91bf9dfb
著作權歸作者所有,轉載請聯系作者獲得授權,並標注“簡書作者”。