May 24, 2021 Sublime Text Use the manual
Good editors make coding easier, so Sublime Text provides a range of features to improve development efficiency.
Good code should be standard, so Google has its Code Guidelines for every major language. I myself normalize my code with the following settings.
// 设置tab的大小为2
"tab_size": 2,
// 使用空格代替tab
"translate_tabs_to_spaces": true,
// 添加行宽标尺
"rulers": [80, 100],
// 显示空白字符
"draw_white_space": "all",
// 保存时自动去除行末空白
"trim_trailing_white_space_on_save": true,
// 保存时自动增加文件末尾换行
"ensure_newline_at_eof_on_save": true,
Sublime Text supports code snippets, which Tab generates by entering the snippet name.
You can install third-party snipppppping with Package Control, or you can create your own.
Sublime Text Basic manual formatting operations include:
Ctrl + [
s indentation to the left,
Ctrl + ]
to the right,
Ctrl + Shift + V
paste code in the current indentation (very useful).
In addition to manual formatting, we can also automatically indent and intelligently align by installing plug-ins:
Sublime Text supports a certain amount of auto-completion, which is automatically completed by Tab.
When you write code, you run into a lot of brackets,
Ctrl + M
you can quickly switch between the start and end brackets,
Ctrl + Shift + M
can quickly select what's in parentheses, and you can use
Ctrl + Shift + J
languages such as Python.
In addition, I use
BracketHighlighter
to highlight the pairing brackets and the area where the current cursor is located, as follows:
Despite the Python console, sublime Text's console only supports single-line input, which is inconvenient,
SublimeREPL
for some coding experiments.
Despite my attempts to include as many Sublime Text practical skills as possible in this article, due to space and my personal experience, this article is still missing, and we welcome to point out the errors and omissions in this article in our comments.
Here are some features that might work but are rarely used:
I've put the Sublime Text that appears in this article here by type for review.
General
Editing
Select
Find and Replace (Finding and Replacing)
Jump
Window
Screen