前言
之前一直在使用EditPlus3
劣像,后來得知了SublimeText
,好牛X的樣子,所以就開始使用了
首先SublimeText的安裝
先去官方下載安裝包,這里下載的是SublimeText2 根據(jù)安裝向?qū)О惭b就好了
Package Control
如果需要給SublimeText
安裝插件桐筏,首先需要安裝Package Control
- 按
Ctrl+``或者
View>Show Console打開
Console`(SublimeText控制臺(tái)) - 粘貼下邊的代碼到
Console
并回車,Package Control
// 2.x版本
import urllib2,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88'; 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')
...
// 3.x版本
import urllib.request,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88'; 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 manpciual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
- 等待左下角的進(jìn)度完成,然后重啟
SublimeText2
就成功了
MarkdownEditing
安裝MarkdownEditing
- 按下
Ctrl+Shift+P
然后輸入Package Control: Install Package
或pci
然后在彈出框輸入MarkdownEditing
回車梅忌,等待安裝完成狰腌,然后重啟SublimeText
就可以看到Markdown
的效果了 - 此插件可以設(shè)置一些主題,不過他的主題對(duì)
Markdown
的語言沒作用牧氮,只是更改了編輯文本的主題樣式 - 然后就是有一些快捷鍵比如:
插入鏈接:
win+ctrl+v
插入圖片:win+ctrl+k
其他詳細(xì)可以通過打開Ctrl+Shift+P
然后輸入MarkdownEditing
查看
HTML/CSS/JS Prettify
安裝HTML-CSS-JS Prettify
按下Ctrl+Shift+P
然后輸入Package Control: Install Package
或pci
然后在彈出框輸入HTML-CSS-JS Prettify
然后回車琼腔,等待安裝完成重啟就行了
配置HTML-CSS-JS Prettify
配置的時(shí)候只需要右鍵HTML/CSS/JS Prettify>Set Plugin Options
打開插件的配置文件,修改下nodejs
的路徑就行了踱葛,其中有三個(gè)平臺(tái)的路徑丹莲,只需要修改自己相應(yīng)的平臺(tái)就行了
{
// Simply using `node` without specifying a path sometimes doesn't work :(
// https://github.com/victorporof/Sublime-HTMLPrettify#oh-noez-command-not-found
// http://nodejs.org/#download
"node_path": {
"windows": "D:/develop/web/nodejs/node.exe",
"linux": "/usr/bin/nodejs",
"osx": "/usr/local/bin/node"
},
// Automatically format when a file is saved.
"format_on_save": false,
// Only format the selection if there's one available.
"format_selection_only": true,
// Log the settings passed to the prettifier from `.jsbeautifyrc`.
"print_diagnostics": true
}
Pretty JSON
安裝Pretty JSON
- 按下
Ctrl+Shift+P
然后輸入Package Control: Install Package
或pci
然后在彈出框輸入Pretty JSON
然后回車等待安裝完成 - 選擇
Preferences > Package Settings > Pretty JSON > Settings - Default?
進(jìn)行相關(guān)設(shè)置,其實(shí)這個(gè)沒有什么要設(shè)置的 - 快捷鍵就是
Ctrl+Alt+J
一些常用設(shè)置
- Tab為4空格:菜單欄
View>Indentation>Tab Width: 4