Sublime shortcut key list

零下一度
Release: 2017-06-28 15:33:19
Original
3019 people have browsed it

Sublime text 3 is the favorite code editor for coders. When dealing with code every day, you must first sharpen your tools. Mastering the basic code editor shortcut keys will make your coding more efficient. It may be a little unfamiliar at first, but just spend a week or two sticking with it and getting familiar with these commonly used shortcut keys!

Sublime text 3 is the favorite code editor for coders. When dealing with code every day, you must first sharpen your tools. Mastering the basic code editor shortcut keys can make your coding more efficient. It may be a little unfamiliar at first, but just spend a week or two sticking with it and getting familiar with these commonly used shortcuts! In fact, relevant shortcut keys will be prompted in each option of the sulime text menu bar. You can check it out for yourself. This article is mainly to sort out some hidden or unexplored shortcut keys!

Sublime Text 3 shortcut key essence version

Ctrl+Shift+P: Open the command panel
Ctrl+P: Search for files in the project
Ctrl+G: Jump to Line
Ctrl+W: Close the currently open file
Ctrl+Shift+W: Close all open files
Ctrl+Shift+V: Paste and format
Ctrl+D: Select the word, Repeat to increase the selection of the next same word
Ctrl+L: select a line, repeat to increase the selection of the next line
Ctrl+Shift+L: select multiple lines
Ctrl+Shift+Enter: in the current line Insert a new line before
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 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 content of the current brackets, and repeat the selection of the brackets themselves
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, used to write comments
Ctrl+Shift+A: Used to select before and after the current label, used to modify the label
F11: Full screen
Shift+F11: Full screen do not disturb mode, only edit the current file
Alt+F3: Select all the same words
Alt+.: Close the label
Alt+Shift+Number: Split-screen display
Alt+Number: Switch to open the Nth file
Shift+right-drag: The cursor is too long, used to change or insert column content
The forward and backward keys of the mouse can switch Tab files
Press Ctrl, click or select in sequence, you can select multiple positions that need to be edited
Press Ctrl+Shift+up and down keys to replace the line

Select the class

Ctrl+D Select the text occupied by the cursor , continuing the operation will select the next identical text.

Alt+F3 Select text and press the shortcut key to select all the same text at once for editing at the same time. For example: quickly select and change all the same variable names, function names, etc.

Ctrl+L selects the entire line. If you continue the operation, you will continue to select the next line. The effect is the same as Shift+↓.

Ctrl+Shift+L First select multiple lines, and then press the shortcut key. The cursor will be inserted at the end of each line, and you can edit these lines at the same time.

Ctrl+Shift+M Select the content within the brackets (continue to select the parent brackets). For example: quickly select to delete the code in the function, rewrite the function body code or rewrite the content inside the brackets.

Ctrl+M Move the cursor to the end or beginning 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 downwards.

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

Ctrl+Shift+[ Select the code, press the shortcut key to collapse the code.

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

Ctrl+K+0 Expand all folded codes.

Ctrl+← Move the cursor unitarily to the left and move the cursor quickly.

Ctrl+→ Move the cursor unitarily to the right and move the cursor quickly.

shift+↑ Select multiple lines upward.

shift+↓ Select multiple lines downward.

Shift+← Select text to the left.

Shift+→ Select text to the right.

Ctrl+Shift+← Select text unitarily to the left.

Ctrl+Shift+→ Select text unitarily to the right.

Ctrl+Shift+↑ Swap the line where the cursor is and the previous line of code (insert the line where the cursor is before the previous line).

Ctrl+Shift+↓ Swap the line where the cursor is and the next line of code (insert the line where the cursor is after the next line).

Ctrl+Alt+↑ Add multi-line cursor upwards and edit multiple lines at the same time.

Ctrl+Alt+↓ Add multi-line cursor downwards and edit multiple lines at the same time.

Edit Class

Ctrl+J Merges selected multiple lines of code into one line. For example: merge CSS properties in multi-line format into one line.

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

Tab Indent to the right.

Shift+Tab Indent 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+/ Comment single line.

Ctrl+Shift+/ Comment multiple lines.

Ctrl+K+U Convert to uppercase.

Ctrl+K+L Convert to lowercase.

Ctrl+Z Undo.

Ctrl+Y Undo.

Ctrl+U soft undo, feels the same as Gtrl+Z.

Ctrl+F2 Set bookmark

Ctrl+T Swap left and right letters.

F6 Word Detection Spelling

Search Category

Ctrl+F Open the bottom search box and search for keywords.

Ctrl+shift+F Search within a folder. The difference from ordinary editors is that sublime allows you to add multiple folders for search. It is slightly advanced and has not been studied yet.

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 a number to jump to the line of code in the file. 4. Enter # and keywords to find variable names.

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

Ctrl+R Open the search box, automatically add @, enter keywords to find the function name in the file. For example: quickly search for 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 Open the command box. Scenario example: Open the naming box, enter keywords, and call the function of sublime text or plug-in, such as using package to install the plug-in.

Esc exits the cursor multi-line selection, exits the 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 switches the tab page of the current window to the left.

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

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

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

Alt +Shift+3 Split the screen left and right-3 columns

Alt+Shift+4 Split the screen left-right-4 columns

Alt+Shift+5 Divide the screen equally into 4 columns

Alt+ Shift+8 Vertical split screen-2 screens

Alt+Shift+9 Vertical split screen-3 screens

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

F11 Full screen mode

Shift+F11 Do not disturb mode

Configure the compilation environment

Console input (take C++ as an example)

The principle is very simple, that is, create a bat externally to execute the file, and then call it. Note that you need to use start to open a new window, and you need to pause to see the results. The most annoying thing is that Sublime executes your start in the background by default. If your pause and start are placed in a file, pause will have a negative effect on start %. The file of 1 is invalid, so two files actually need to be created. Pay attention to environment variables. . . (As for what an environment variable is, I can’t explain it clearly in a few sentences. It’s best to search it on Baidu yourself.)

After configuring it, I personally feel that the console input is not very meaningful. When doing questions, I read it from the file. There is basically no need to read in for development. So~ please be careful.

MyCRun.bat

@echo off

%1

echo.

echo ------- -------------

pause

exit


MyCallRun.bat

@start MyCRun %1

The configuration file is in Sublime Text 3\Packages\C++.sublime-package. Make a backup first.

Modify the C++.sublime-build inside to

{

"shell_cmd": "g++ \"${file}\" -o \"$ {file_path}/${file_base_name}\"",

"file_regex": "^(..[^:]*):([0-9]+):?([0-9] +)?:? (.*)$",

"working_dir": "${file_path}",

"selector": "source.c, source.c++",

"variants":

[

"{

"name": "Run",

"shell_cmd": "g++ \ "${file}\" -o \"${file_path}/${file_base_name}\" && MyCallRun \"${file_path}/${file_base_name}.exe\"" // Actually, a MyCallRun is added here

}

]

}

C/C ++

Sublime Text 3 The default configuration is configured C ++. But you need to add the gcc directory to the environment variable yourself

Java

Sublime Text 3 only runs javac by default, you need to add it yourself.

I couldn’t understand Sublime’s command format, so I changed javac into my own bat. (I feel like you can also connect them with && like C++)

Create myJRun.bat where the command line can directly access it (I put it directly in jdk/bin)

@ECHO OFF

cd %~dp1

ECHO Compiling %~nx1...

IF EXIST %~n1.class (

DEL %~n1.class

)

javac %~nx1

IF EXIST %~n1.class (

ECHO Running...

ECHO ---- ------------------OUTPUT----------------------

java %~ n1

)

Note that cls cannot be used.

Modify the java compilation options (back up the original ones).

Directory: Packages/Java.sublime-package/JavaC.sublime-build

{

"shell_cmd": "myJRun.bat \"$file\"",

"file_regex": "^(...*?):([0-9]*):?([0-9]*)",

"selector": "source.java"

}

In this way, the Java code point Build written in the future will run automatically.

This method cannot be cross-platform. Let’s study Sublime’s own method.

Go

The environment for developing golang using Sublime is very simple. You only need to install a GoSublime.


The above is the detailed content of Sublime shortcut key list. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template