Using Sublime Shortcuts

Sublime text 3 is the favorite code editor for coders. When dealing with code every day, you must first sharpen your tools. Mastering the shortcut keys of the basic code editor can make your coding more efficient. It might be rusty at first, just spend a week or two sticking with it and getting familiar with these common shortcuts! In fact, each option in the sulime text menu bar will prompt related shortcut keys. You can go and see for yourself. This article mainly organizes some hidden or undiscovered shortcut keys!

Sublime Text 3 Shortcut Essentials

Ctrl+Shift+P: Open the command palette
Ctrl+P: Search for files in the project
Ctrl+G: Jump to the line
Ctrl+W: Close the currently open file
Ctrl+Shift+W: Close all open files
Ctrl+Shift+ V: Paste and format
Ctrl+D: Select word, repeat to add Select the next same word
Ctrl+L: Select line, repeat to add next line
Ctrl+Shift+L: Select multiple lines
Ctrl+Shift+Enter : Insert a new line before the current line
Ctrl+X: Delete the current line
Ctrl+M: Jump to the corresponding bracket
Ctrl+U: Soft undo, undo the cursor position
Ctrl+J: Select the label content
Ctrl+F: Find the content
Ctrl+Shift +F: Find and replace
Ctrl+H: Replace
Ctrl+R: Go to method
Ctrl+N: New window
Ctrl+K+B: Switch sidebar
Ctrl+Shift+M: Select the current bracket content, repeat the optional bracket itself
Ctrl +F2: set/delete mark
Ctrl+/: comment the current line
Ctrl+Shift+/: insert a comment at the current position
Ctrl+Alt+/: block comment, and focus to the first line, write comment description
Ctrl+Shift+A: select the current label Before and after, modify the
F11 used by the label: full screen
Shift+F11: Full-screen DND mode, only edit the current file
Alt+F3: Select all the same words
Alt+.: Close tabs
Alt+Shift+Number: Split screen display
Alt+Number: Switch to open the Nth file
Shift+Right drag: Cursor No, it is used to change or insert column content.
The mouse forward and backward keys can switch Tab files.
Press Ctrl, click or select in turn, and
press Ctrl+Shift+up and down keys for multiple positions that need to be edited to replace rows.

select class

Ctrl+D  selects the text occupied by the cursor, and continues to select the next same text.

Alt+F3  select the text and press the shortcut key to select all the same text at one time for simultaneous editing. Example: Quickly select and change all the same variable names, function names, etc.

Ctrl+L  selects the entire row, and continues to select the next row, the  effect is the same as Shift+↓  .

Ctrl+Shift+L  selects multiple lines first, and then presses the shortcut key, the cursor will be inserted at the end of each line, and these lines can be edited at the same time.

Ctrl+Shift+M  selects the content within the brackets (continues to select the parent bracket). For example: Quickly select and delete the code in the function, rewrite the function body code or rewrite the content in the parentheses.

Ctrl+M  Moves the cursor to the end or start of the brackets.

Ctrl+Enter  inserts a new line on the next line. For example: even if the cursor is not at the end of the line, you can quickly insert a line down.

Ctrl+Shift+Enter  inserts a new line on the previous line. For example: even if the cursor is not at the beginning of the line, it can quickly insert a line up.

Ctrl+Shift+[  Select the code and press the shortcut key to fold the code.

Ctrl+Shift+]  Select the code and press the shortcut key to expand the code.

Ctrl+K+0  expands all folded codes.

Ctrl+← Moves the cursor unitwise  to the left, moving the cursor quickly.

Ctrl+→  Moves the cursor unitwise to the right, moving the cursor quickly.

shift+↑  selects multiple lines up.

shift+↓  selects multiple lines down.

Shift+←  Select text to the left.

Shift+→  Select text to the right.

Ctrl+Shift+←  Selects text uniformly to the left.

Ctrl+Shift+→  Selects text uniformly to the right.

Ctrl+Shift+↑  swaps the line where the cursor is located with the previous line of code (inserts the line where the cursor is located before the previous line).

Ctrl+Shift+↓  swaps the line where the cursor is located with the next line of code (inserts the line where the cursor is located after the next line).

Ctrl+Alt+↑  adds a multi-line cursor upwards, which can edit multiple lines at the same time.

Ctrl+Alt+↓  adds a multi-line cursor down, and can edit multiple lines at the same time.

edit class

Ctrl+J  merges selected multiple lines of code into one line. For example: combine CSS properties in multiple lines into one line.

Ctrl+Shift+D  Copy the entire line where the cursor is located and insert it into the next line.

Tab  is indented to the right.

Shift+Tab  indents to the left.

Ctrl+K+K  deletes code from the cursor to the end of the line.

Ctrl+Shift+K  deletes the entire line.

Ctrl+/  to comment a single line.

Ctrl+Shift+/  to comment multiple lines.

Ctrl+K+U  Convert uppercase.

Ctrl+K+L  Convert lowercase.

Ctrl+Z  to undo.

Ctrl+Y  Redo Undo.

Ctrl+U  Soft Undo, feels  the same as Gtrl+Z  .

Ctrl+F2  set bookmark

Ctrl+T  swaps left and right letters.

F6  word detection spelling

search class

Ctrl+F  opens the bottom search box to find keywords.

Ctrl+shift+F  searches within a folder. The difference from ordinary editors is that sublime allows to add multiple folders for search, which is slightly high-end and not studied.

Ctrl+P  opens the search box. For example: 1. Enter the file name in the current project to quickly search the file. 2. Enter @ and keywords to find the function name in the file. 3. Enter: and the number to jump to the line of code in the file. 4. Enter # and a keyword to find variable names.

Ctrl+G  opens the search box, automatically with:, enter a number to jump to the line of code. For example: Quickly locate files with long page code.

Ctrl+R  opens the search box, automatically with @, enter the keyword, and find the function name in the file. For example: Quickly find a function on a page with many functions.

Ctrl+:  Open the search box, automatically add #, enter keywords, and search for variable names, attribute names, etc. in the file.

Ctrl+Shift+P  opens the command box. Scenario chestnut: Open the naming box, enter a keyword, and invoke the functions of sublime text or plugins, such as using package to install plugins.

Esc  exits cursor multi-line selection, exits search box, command box, etc.

Display class

Ctrl+Tab  switches the tabs of the current window in the order in which the files have been browsed.

Ctrl+PageDown  toggles the tab page of the current window to the left.

Ctrl+PageUp  toggles the tab page of the current window to the right.

Alt+Shift+1  window split screen, restore default 1 screen (non-keyboard numbers)

Alt+Shift+2  left and right split screen - 2 columns

Alt+Shift+3  left and right split screen - 3 columns

Alt+Shift+4  left and right split screen - 4 columns

Alt+Shift+5  equally divided into 4 screens

Alt+Shift+8  vertical split screen - 2 screens

Alt+Shift+9  vertical split screen - 3 screens

Ctrl+K+B  Turns the sidebar on/off.

F11  full screen mode

Shift+F11  Do Not Disturb Mode

Configure the build environment

Console input (take C++ as an example)

The principle is very simple, that is, to create a bat externally to execute the file, and then call it. It should be noted that you need to use start to open a new window, and you need to pause to see the results. The most painful thing is that Sublime executes your start in the background by default. If your pause and start are placed in a file, pause to start % 1 file is invalid, so two files need to be created. Pay attention to environment variables. . . (About what is an environment variable, I can't explain it in three or two sentences, it is best to Baidu it yourself.)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325281144&siteId=291194637