常用命令
安裝package control
https://packagecontrol.io/installation,上面有說明,安裝完需要重啟sublime。
重啟後,ctrl+shift+p,輸入ctrl + shift + p然後在控制視窗中輸入Package Control: Install Package斷行符號,輸入要安裝的包名即可 常用package BracketHighlighter
將配對的括弧等顯示在行數列上 Sublime Code Intel Auto complete awesomeness All autocomplete
Adds autocomplete for words found in all open files. Works well as a supplement to SublimeCodeIntel Colorpicker
使用一個色彩選擇工具改變顏色 markdownediting或者markdownPerview
這個是寫Markdown必備的。可以在包管理器中安裝。裝完之後,寫作Markdown時(右下角顯示文法為Markdown),可以按ctrl+b,直接就會產生HTML,並在瀏覽器中顯示; jsformat
JavaScript代碼格式化;https://github.com/jdc0589/JsFormat
使用: The default key binding is “ctrl+alt+f” Open the command palette via “ctrl + shift + p”, Jsformat appears as “Format: Javascript”
注意:必須是.js檔案,或者syntax設定為js或者json才可以,否則command palette不顯示“Format:Javascript” sidebarenhancement
這是用來增強左邊的側邊欄。左側邊欄可以在View -> Side Bar -> Show Side Bar中開啟,可以用Project -> Add Folder to Project…往側邊欄加入常用的檔案夾。裝完這個外掛程式,側邊欄的右鍵菜單會多一些功能,挺實用的 自訂快速鍵 在行尾添加;並跳到下一行
Best solution for this is recording a macro on Sublime Text and then assigning it to a keyboard shortcut. Follow these steps:
Create a line such as alert(‘hello’) and leave the cursor right after letter ‘o’.
Then go to Tools > Record a Macro to start recording.
Press ‘End’ to go to the end of line.
Press ; and hit Enter
Stop recording the macro by going to Tools > Stop Recording Macro
You can now test your macro by Tools > Playback Macro (optional)
Save your macro by going to Tools > Save Macro (ex: EndOfLine.sublime-macro)
Create a shortcut by adding this between the square brackets in your in your Preferences > Key Bindings - User file:(Ctrl+shift+P,輸入kbu,斷行符號)
[ {"keys": ["ctrl+;"], "command": "run_macro_file", "args": {"file": "Packages/User/EndOfLine.sublime-macro"}}]
Now, every time you hit Ctrl+;, it will magically place the semicolon at the end of current line and move the cursor to the next line.
Happy coding! Theme
https://github.com/equinusocio/material-theme
After installing material-theme,add the following to your “Settings - User”file and restart Sublime Text ,當前編輯檔案的Tab會高亮顯示,我非常喜歡這點
{ "theme": "Material-Theme.sublime-theme", "color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme", }
也可以換Material-theme裡的別的color schema,比如:
{ "theme": "Material-Theme-Darker.sublime-theme", "color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker.tmTheme", }
Recommended UI and font settings for a better experience:
{ "overlay_scroll_bars": "enabled", "line_padding_top": 3, "line_padding_bottom": 3, "always_show_minimap_viewport": true, "bold_folder_labels": true, "indent_guide_options": [ "draw_normal", "draw_active" ], // Highlight active indent "font_options": [ "gray_antialias" ], // For retina Mac }
Settings(設定)
菜單:preferences–》settings-user,輸入自訂配置: 解決windows下,中文檔案名稱在tab上顯示為方塊:”dpi_scale”: 1.0 常用配置
// User/Preferences.sublime-settings{ "color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker.tmTheme", "ignored_packages": [ ], "material_theme_bold_tab": true, "material_theme_compact_panel": true, "material_theme_compact_sidebar": true, "material_theme_contrast_mode": true, "material_theme_disable_tree_indicator": true, "material_theme_panel_separator": true, "material_theme_small_statusbar": true, "material_theme_small_tab": true, "material_theme_tabs_autowidth": true, "material_theme_tabs_separator": true, "theme": "Material-Theme-Darker.sublime-theme", "bold_folder_labels": true, "font_face": "Consolas", "font_size": 15, "font_options" : [ "gray_antialias", "subpixel_antialias" ], "overlay_scroll_bars" : "enabled", "line_padding_top" : 3, "line_padding_bottom" : 3, "always_show_minimap_viewport" : true, "bold_folder_labels" : true, "indent_guide_options" : [ "draw_normal", "draw_active" ], // Highlight active indent "highlight_line": true, "hot_exit": false, //退出時問是否儲存 "rulers": [ 80 ], "scroll_past_end": true, "tab_size": 4, "tab_completion": false, "vintage_start_in_command_mode": true, "dpi_scale": 1.0}
我在Sublime中用的是最佳模式。它提供了 vi 編輯命令代替Sublime Text。它不是原vi包的全功能,但它是我目前見過最接近 vi編輯器的文字編輯器。使用你的鍵盤快速鍵和命令包就可以非常快速的開發。
上面的設定會在你開啟一個檔案時自動開啟Vintage模式(叔註:Vintage是Sublime Text的vi模式編輯包。 可以使用組合vi命令來調用Sublime Text的功能,包括多重選取。)。
如果你不喜歡這個功能,只是刪除vintage_start_in_command_mode就可以了,如果你想完全禁用Vintage模式,那麼刪除ignored_packages設定。 user preferences http_proxy
“http_proxy”: “127.0.0.1:8087”,