Sublime Text 3 is the code of the farm's favorite coding editor, daily and code to deal with, its prerequisite, master the Basic Code Editor shortcut keys, can let you play code more efficient. It may be a little rusty at first, just take a two-week stay and familiarize yourself with these frequently used shortcuts!
Sublime Text 3 is the code of the farm's favorite coding editor, daily and code to deal with, its prerequisite, master the Basic Code Editor shortcut keys, can let you play code more efficient. It may be a little rusty at first, just take a two-week stay and familiarize yourself with these frequently used shortcuts! In fact sulime text menu bar Each option will prompt related shortcut keys, you can see for yourself, this article is mainly to organize some hidden or not to be explored shortcut keys!
Sublime Text3 on the command line in Windows you need to add the executable file to the path,
After the configuration is complete, open cmd run: Subl (subl + file name form)
You can open the sublime Text3.
Sublime Text 3 shortcut key Essence Edition
Ctrl+shift+p: Open Command Panel
Ctrl+p: Searching for files in a project
Ctrl+g: Jump to the first few lines
CTRL+W: Close the currently open file
CTRL+SHIFT+W: Close all open files
Ctrl+shift+v: Pasting and formatting
Ctrl+d: Select words, repeat to add the next same word
Ctrl+l: Select rows, repeat to select the next row in turn
Ctrl+shift+l: Select multiple lines
Ctrl+shift+enter: Inserting a new row before the current line
Ctrl+x: Delete When moving forward
Ctrl+m: jump to corresponding parentheses
Ctrl+u: Soft undo, undo cursor Position
CTRL+J: Select 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 Side bar
Ctrl+shift+m: Check the contents of the current parenthesis, repeating the parentheses themselves
CTRL+F2: Set/Remove Tags
ctrl+/: Comment When moving forward
ctrl+shift+/: Insert comment at current position
ctrl+alt+/: Block comment, and focus to the first line, write the comment description with the
Ctrl+shift+a: Before and after selecting the current label, modify the label with
F11: Fullscreen
SHIFT+F11: fullscreen-free mode, editing only the current file
ALT+F3: Select all the same words
ALT +.: Closed Label
alt+shift+ Number: Split screen display
ALT + Number: Toggle to open nth file
shift+ Right-drag: Many cursors are not used to change or insert column contents
Mouse forward and backward key to toggle tab file
Press CTRL, tap or select, to edit multiple locations
Press ctrl+shift+ up/down key to replace row
Select Class
ctrl+d Selects the text that the cursor occupies, and continues, the next identical text is selected.
alt+f3 Selected text press the shortcut key, you can select all the same text at once to edit simultaneously. Give a chestnut: quickly select and change all the same variable names, function names, and so on.
ctrl+l Select the entire row, continue to select the next row, the effect is the same as the shift+↓ effect.
ctrl+shift+l Select multiple rows First, and then press the shortcut key to insert the cursor at the end of each line to edit the rows at the same time.
ctrl+shift+m Select the contents in parentheses (continue to select the parent bracket). Give me a chestnut: Quickly select the code in the delete function, rewrite the function body code, or rewrite the contents of the parentheses inside.
ctrl+m cursor moves to the end or start position within the parentheses.
Ctrl+enter Inserts a new row in the next line. For a chestnut: 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 row in the previous line. For a chestnut: even if the cursor is not at the beginning of the line, it can be inserted quickly.
ctrl+shift+[ Select the code, press the shortcut key, and collapse the code.
ctrl+shift+] Select the code, press the shortcut key, and expand the code.
ctrl+k+0 expands all collapsed code.
ctrl+← Move the cursor to the left and move the cursor quickly.
ctrl+→ Move the cursor to the right and move the cursor quickly.
shift+↑ Select multiple rows upwards.
shift+↓ Select multiple rows.
shift+← Select the text to the left.
shift+→ Select the text to the right.
ctrl+shift+← Select the text to the left of the unit.
ctrl+shift+→ Select the text to the right of the unit.
ctrl+shift+↑ swaps the cursor line and the previous line of code (before inserting the row of the cursor into the previous row).
ctrl+shift+↓ swaps the lines of the cursor and the next line of code (inserts the row of the cursor after the next line).
ctrl+alt+↑ Add a multiline cursor up, and you can edit multiple lines at the same time.
ctrl+alt+↓ Adds a multiline cursor down to edit multiple lines at the same time.
Edit Class
ctrl+j Merge the selected lines of code to one line. For a chestnut: merge the CSS properties of the multiline format into one line.
ctrl+shift+d The entire line where the cursor is copied, and inserts it into the next row.
Tab Right indent.
Shift+tab indents to the left.
ctrl+k+k removes code from the cursor at the end of the line.
ctrl+shift+k Delete the entire row.
ctrl+/ Comment Line.
ctrl+shift+/ Comment multiple lines.
ctrl+k+u Convert uppercase.
ctrl+k+l Convert lowercase.
CTRL + Z Undo.
ctrl+y restore undo.
ctrl+u Soft undo, feeling and gtrl+z the same.
ctrl+f2 Setting bookmarks
ctrl+t around the letter interchange.
F6 Word detection spelling
Search class
ctrl+f Open the bottom search box to find keywords.
ctrl+shift+f in folders, unlike the normal editor is sublime allow to add multiple folders to find, slightly high-end, not researched.
ctrl+p Open the search box. For a chestnut: 1. Enter the file name in the current project, quickly search for files, 2, enter @ and keywords, find the function name in the file, 3, enter: And number, jump to the line code in the file, 4, enter # and keyword, find the variable name.
ctrl+g Open the search box and automatically take:, enter a number to jump to that line of code. For a chestnut: Quickly locate a file in which the page code is relatively long.
ctrl+r Open the search box, automatically with @, enter keywords, find the function name in the file. For a chestnut: Quickly find a function on a page with more functions.
Ctrl +: Open the Search box, automatically with #, enter keywords, find variable names in the file, attribute names, and so on.
ctrl+shift+p Open the Command box. Scene Chestnut: Open the Name box, enter the keyword, call sublime text or plug-in features, such as using the package installation plugin.
ESC exits the cursor multi-line selection, exits the search box, command box, and so on.
Display class
ctrl+tab Toggles the tab of the current window in the order in which the files were browsed.
ctrl+pagedown Toggles the tab of the current window to the left.
ctrl+pageup Toggles the tab of the current window to the right.
alt+shift+1 window split screen, restore the default 1 screen (non-keypad number)
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 4 screen
alt+shift+8 Vertical split screen-2 screen
alt+shift+9 Vertical Split screen-3 screen
ctrl+k+b Toggle the sidebar on/off.
F11 Full Screen mode
shift+f11 free-to-disturb mode
Configuring the compilation Environment
Console input (for example in C + +)
The simple principle is to create a bat on the outside to execute the file, and then call it. Note that you need to use start to open a new window, but also need to pause to see the results, where the egg hurts is sublime default background execution of your start, if your pause and start placed in a file pause on the start%1 file is invalid , so you actually need to create two files. Note Environment variables ... (about what is the environment variable, 32 sentence explanation is not clear, best oneself Baidu a bit.) )
After the personal feeling console input meaning is not very big, do the words are read from the file, do not need to read the development of Basic. So~ you are careful.
Mycrun.bat
@echo off
%
Echo.
Echo-------------------
Pause
Exit
Mycallrun.bat
@start Mycrun%1
The configuration file is in Sublime Text 3\packages\c++.sublime-package. Back up a bit first.
Modify the inside of the C++.sublime-build for
{
"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 is here add a Mycallrun
}
]
}
C + +
Sublime Text 3 is configured by default for C + +. But you need to add the GCC directory to the environment variable yourself.
Java
Sublime Text 3 runs only Javac by default and requires you to add it yourself.
Bitter hard to understand Sublime command format, so the javac changed to a bat of their own. (It can also feel like a C + + with a && connection.)
Build myjrun.bat where the command line can be accessed directly (I put it directly under 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 You cannot use the CLS.
Modify the Java compilation options (back up the original).
Catalog: Packages/java.sublime-package/javac.sublime-build
{
"Shell_cmd": "Myjrun.bat \" $file \ "",
"File_regex": "^ (... *):( [0-9]*):? ([0-9]*) ",
"Selector": "Source.java"
}
The Java code point Build will then run automatically.
This approach can not be cross-platform, and then research and study sublime own way.
Go
Using Sublime to develop Golang environment is very simple, just need to install a gosublime is almost.
Sublime text 3 shortcut keys Daquan and configuring the compilation environment