wget -c http://c758482.r82.cf2.rackcdn.com/sublime_text_3_build_3083_x64.tar.bz2 # sublime3的下載地址是這裏 http://www.sublimetext.com/3 tar jxvf sublime_text_3_build_3083_x64.tar.bz2 -C /opt cd /opt/sublime_text_3/ ./sublime_text # 啓動程序查看效果 ln -s /opt/sublime_text_3/sublime_text /usr/local/bin/sublime # 軟連接到系統path中 cp /opt/sublime_text_3/sublime_text.desktop /usr/share/applications # 複製桌面支持到系統應用目錄下 cd /usr/share/applications/ vim sublime_text.desktop # change Icon=/opt/sublime_text_3/Icon/48x48/sublime-text.png and Exec=/opt/sublime_text_3/sublime_text %F # 使得sublime的圖標可顯示
安裝Package Control,按官方提供方法安裝:https://packagecontrol.io/installationphp
安裝瞭如下插件:css
1.主題插件:http://jamiewilson.io/predawn/ 安裝Predawn主題,完成後會打開他的messages文檔信息,把裏面的配置放入preferences->Settings-User配置中邊欄變成黑色的python
2.側邊欄插件:SideBarEnhancements 是一款很實用的右鍵菜單加強插件css3
3.python的插件:anaconda,不知道好很差用golang
點擊 Tools > Build System > New Build System...
將打開的文件名命名爲Python3.sublime-build
編輯文件內容爲(讓sublime text自動選擇python語法):ubuntu
{
"cmd": ["/path/to/python3", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}vim
Pylinter.sublime-settings 配置了pylinter 插件。我使用下面的配置讓 Pyhton 在保存時自動規範,並對違反規範顯示圖標。 { // Configure pylint's behavior "pylint_rc": "/Users/daniel/dev/pylintrc", // Show different icons for errors, warnings, etc. "use_icons": true, // Automatically run Pylinter when saving a Python document "run_on_save": true, // Don't hide pylint messages when moving the cursor "message_stay": true } SublimeCodeIntel 插件,智能提示插件,這個插件的智能提示功能很是強大,能夠自定義提示的內容庫,個人Python智能提示設置 { "Python": { "python":"D:/Python27/python.exe", "pythonExtraPaths": [ "D:/Python27", "D:/Python27/DLLs", "D:/Python27/Lib", "D:/Python27/Lib/lib-tk", "D:/Python27/Lib/site-packages" ] }
"PHP": {
"php": "E:/wamp/bin/php/php5.4.12/php.exe",sublime-text
"phpExtraPaths": "d:/Yii",
"phpConfigFile": "E:/wamp/bin/php/php5.4.12/php.ini"
}
}app
Python PEP8 Autoformat 插件
這是用來按PEP8自動格式化代碼的。能夠在包管理器中安裝。快捷鍵 CTRL+SHIFT+R 自動格式化python代碼
pylinter配置:ide
{ // Configure pylint's behavior "pylint_rc": "C:/Users/zhanglei/AppData/Roaming/Sublime Text 3/Packages/Pylinter", "pylint_path": "C:/Python34/Lib/site-packages/pylint", // Show different icons for errors, warnings, etc. "use_icons": true, // Automatically run Pylinter when saving a Python document "run_on_save": true, // Don't hide pylint messages when moving the cursor "message_stay": true }
4.golang的插件:GoSublime(好像也不想要下面的配置),godef導入的庫提示,goimports
{ "env": { "GOBIN":"/opt/golang/go/bin", "GOROOT":"/opt/golang/go", "GOPATH": "/opt/golang/gopath" } }
5.css3的插件:CSS3
ColorPicker 調色盤,Alignment 等號對齊按Ctrl+Alt+A,BracketHighlighter 高亮顯示匹配的括號、引號和標籤(須要時能夠使用)
下面是個人一個配置preferences->Settings-User內容:
添加 "auto_complete_selector": "source, text"來自動補全代碼
{ "caret_style": "solid", "color_scheme": "Packages/Predawn/predawn.tmTheme", "find_selected_text": true, "font_size": 11.0, "highlight_line": true, "highlight_modified_tabs": true, "ignored_packages": [ "Vintage" ], "line_padding_bottom": 0, "line_padding_top": 0, "scroll_past_end": false, "show_minimap": false, "sidebar_default": true, "tab_size": 4, "theme": "predawn.sublime-theme", "translate_tabs_to_spaces": true, "trim_trailing_white_space_on_save": true, "wide_caret": true, "word_wrap": true, "auto_complete_selector": "source, text" }
6.ctags,這個插件能跨文件跳轉,跳轉到指定函數聲明的地方。 使用package control 搜索ctags 進行安裝(安裝ctags插件就能夠了, 還有一個 CTags for PHP 插件沒什麼用)。注意安裝好插件後要須要安裝ctags命令。window 下載 ctags.exe http://ctags.sourceforge.net/。
編輯ctags的settings - User,添加以下內容:
{ "command": "C:/Python34/ctags58/ctags.exe" }
(或將ctags.exe文件放在一個環境變量能訪問到的地方,打開cmd, 輸入ctags,若是有這個命令,證實成功)
ubuntu下安裝運行命令:sudo apt-get install ctags 。
而後在sublime項目文件夾右鍵, 會出現Ctag:Rebuild Tags 的菜單,而後會在項目中生成.tags的文件。
7.運行php文件Tools->Build System->New Build System...,添加如下內容,保存
{ "cmd": ["E:/wamp/bin/php/php5.4.12/php.exe", "$file"], "file_regex": "^(...*?):([0-9]*):?([0-9]*)", "path": "E:/wamp/bin/php/php5.4.12", "selector": "source.php" }
總結:
python插件須要:SublimeCodeIntel+anaconda+pylinter+?(Python PEP8 Autoformat),感受開發python已經很nice了,也能夠加上ctags
php插件須要:SublimeCodeIntel+ctags,通常狀況也足夠應付了(就是跟蹤提示差些)