Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Sublime Text editing


May 24, 2021 Sublime Text Use the manual


Table of contents


Editing

Sublime Text's editors are very user-friendly - it's not as anti-human as Vim (although I use Vim, I'd say Vim's shortcuts are not even as good as metabolites), and a small number of shortcuts do most editing tasks.

Basic Editing

The ←→ is the ←→, not KJHL, (yes I'm spitting Vim, Neymar set up WSAD is also better than this ah), paste cut copy is consistent with the system.

Ctrl s Enter adds a new line below the current line and jumps to that line;

Sublime Text editing

Ctrl ←/→ word-by-word movement, and accordingly, Ctrl-Shift plus ←/→ word-by-word selection.

Sublime Text editing

Ctrl s/ s move the current display area, Ctrl s Shift s s / s move the current line.

Sublime Text editing

Select

One of the highlights of Sublime Text is its support for multiple selections - select multiple regions at the same time, and then edit at the same time.

Ctrl s D selects the word in which the current cursor is located and highlights all the places where the word appears, again Ctrl s D selects the next position where the word appears, skips using Ctrl plus K, rolls back with Ctrl plus U, and exits multiple editing with Esc.

One of the big scenarios for multiple choices is renaming -- making the code cleaner. Although Sublime Text cannot be automatically renamed like the IDE (e.g. Eclipse), we can do an intuitive and convenient rename with multiple word selection and multi-editing:

Sublime Text editing

Sometimes we need to edit all the rows in a region at the same time, and Ctrl and Shift and L can break up the currently selected area and edit them simultaneously:

Sublime Text editing

When there is a break-up, there is a merge, and Ctrl-J can combine the current selected areas into one line:

Sublime Text editing