📜 ⬆️ ⬇️

Several useful shortcuts for Sublime Text Ninji

Good day, dear habravchane. Many use the great Sublime Text editor, which has become popular due to its simplicity, flexibility / customization, and a huge number of plug-ins. I want to share with you, in my opinion, the most useful shortcuts when working with Sublime.

image

Jump by fragments

Win / Linux: CTRL + R
Mac: CMD + R
Probably the most useful keyboard shortcut to save your time. The content of the document is divided into specific fragments (functions, HTML tags or CSS styles). The transition occurs when you select the corresponding fragment in the pop-up window.
')

File navigation

Win / Linux: CTRL + P
Mac: cmd + p
Most developers have to switch between different files many times. HTML and CSS or PHP and JavaScript ... These shortcuts simplify these steps. You can also switch tabs using " CMD+ALT+Left/Right Arrow " and " CTRL+Pagedown/Pageup " for OSX and Windows, respectively.

Highlight current word

Win / Linux: CTRL + D
Mac: CMD + D
It is very convenient to select words by double-clicking the left mouse button. But it is even more convenient and faster to do it on the keyboard, without the help of a touchpad or mouse. And with the combination " CMD+L " or " CTRL+L " the current line is highlighted.

Split screen

Horizontally
Win / Linux: ALT + Shift + 2/3/4/5
Mac: CMD + ALT + 2/3/4/5

Upright
Win / Linux: ALT + Shift + 5/8/9
Mac: CMD + ALT + Shift + 1/2/3
Instead of constantly switching between files, Sublime makes it possible to divide the workspace vertically or horizontally into several parts. Very usable. And using Num1 in the above combinations, we return a single screen.

Bookmarks

Win / Linux: CTRL + F2
Mac: CMD + F2
In the process of writing code, you have to "experiment", change some data and whole lines to get the desired result. Remembering the line numbers where changes occurred is quite difficult. But in sublayme there are bookmarks that are added by these shortcuts. And switch between them using " F2 " or " Shift+F2 ".

Merge and rearrange rows

Win / Linux: CTRL + Shift + Up / Down
Mac: CMD + CTRL + Up / Down
It is rarely necessary to relocate strings in places, but this method is very convenient. Shortcuts " CMD+J " or " CTRL+J " combine strings.

Combined cursor

Win / Linux: CTRL + ALT + Up / Down
Mac: TRL + Shift + Up / Down
Honestly, I have not been able to use this function, but I am sure that there is a lot of potential in the “combined cursor” and many will find use for this feature. The cursor is distributed over multiple lines and it becomes possible to edit them simultaneously.

Instant search and replace

Win / Linux: ALT + F3
Mac: CMD + CTRL + G
Thanks to this life hacking, we forget about search and replace (find what, raplace with, replace next / all). By selecting specific text and pressing the necessary keys, Sublime finds all matches and creates a “merged cursor” on all lines where there are matches.

String search

Win / Linux: CTRL + G
Mac: CTRL + G

Close current HTML tag

Win / Linux: ALT +.
/ Linux: cmd + alt +.

Line selection

Mac: cmd + l

Sources:
10 keyboard shortcuts to become a true Sublime Text ninja
10 Sublime text shortcuts that every developer should know

Many thanks to all for your attention.

Source: https://habr.com/ru/post/208514/


All Articles