Simple Tips for Using Sublime Text 3

Sublime Text is a powerful editor.

Cross-platform, high performance, beautiful interface, excellent extensibility — these are my impressions of this editor. Here, I’ll document my daily usage tips.

Installation

I recommend installing Sublime Text 3.

Official site: https://www.sublimetext.com/3

Installing Package Control

Sublime Text 3’s package manager is the tool for installing most extensions. With it, you can more conveniently customize your editor — whether you’re a frontend or backend developer, you can craft the most comfortable tool.

Official guide: https://packagecontrol.io/installation

ConvertToUTF8: [Essential] This plugin allows you to edit and save files with encodings not natively supported by Sublime Text, especially GB2312, GBK, BIG5, EUC-KR, EUC-JP, etc., commonly used by CJK users.

Bracket Highlighter: For matching brackets, quotes, and HTML tags. Very useful for long code.

I recommend these two essentials. Other plugins can be configured according to your development needs. However, note that Sublime Text 3 is an editor — with plugins, you can turn it into a simple IDE, but performance takes a big hit. So my advice is: don’t chase quantity with plugins; the right ones are what matter most.

Common Shortcuts

In Sublime Text, all shortcuts can be redefined and modified via Key Bindings. Here are the ones I use most often:

  1. Cmd+Shift+P

    This is probably the most frequently used shortcut because of its immense functionality… For example: opening the package manager / setting syntax highlighting / global settings, etc. Here’s a typical scenario:

    Copy a SHOW CREATE TABLE table_name SQL statement, paste it into Sublime Text, press this shortcut, type “SQL” and hit Enter — SQL syntax highlighting is applied to the current editing window. Same goes for PHP/HTML/JavaScript.

  2. Cmd+F

    Find — supports exact match and regex.

  3. Cmd+Option+F

    Replace — same as above.

  4. Cmd+P

    Open files within a project.

  5. Cmd+G

    Go to line.

  6. Option+Cmd+2 — Split into two side-by-side editing panes.

  7. Cmd+K, B (hold Cmd, press K once, then B once) — Toggle the sidebar. Press again to restore.

That’s basically my most-used set. For more, check the menu bar or Key Bindings for all available shortcuts.

PS: Windows and other platform users, please refer directly to the documentation.

Small Tips

  1. Drag a folder to Sublime Text’s sidebar to manage it as a project tree.
  2. You can enable Vim mode.
  3. Open files from the command line — e.g., typing subl aa.txt in the terminal opens aa.txt in Sublime Text (not applicable on Windows).
  4. Hold Cmd and click to edit multiple lines at multiple positions simultaneously (middle mouse button works as an alternative).

Theme

I recommend the #1 starred theme on GitHub:

material-theme: https://github.com/equinusocio/material-theme

I’d suggest following the manual installation method from the documentation for more stability.

PS: It’s recommended to use the author’s suggested settings (Recommended settings for a better experience). It’s optimized for Retina displays. Non-Retina users can customize theme options as needed.

For other themes, feel free to install your own.

Appendix

Official method for opening files/folders with Sublime Text from the command line on macOS:

https://www.sublimetext.com/docs/3/osx_command_line.html

My Sublime Text settings (macOS):

{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"font_options":
[
"gray_antialias",
"subpixel_antialias"
],
"font_size": 14,
"high_lightline": true,
"hot_exit": true,
"ignored_packages":
[
],
"indent_guide_options":
[
"draw_normal",
"draw_active"
],
"line_padding_bottom": 3,
"line_padding_top": 3,
"material_theme_accent_lime": true,
"material_theme_compact_sidebar": true,
"material_theme_small_statusbar": true,
"material_theme_small_tab": true,
"material_theme_tabs_autowidth": true,
"open_files_in_new_window": false,
"overlay_scroll_bars": "enabled",
"remember_open_files": true,
"show_encoding": true,
"tab_size": 2,
"theme": "Material-Theme.sublime-theme",
"translate_tabs_to_spaces": true,
"word_wrap": false
}