Small knowledge, big challenge! This paper is participating in theEssentials for programmers”Creative activities
preface
Everyone says IDEA is good, but do you know the strength of IDEA? Here are some ideas for improving your daily development efficiency.
Code editing
Copy and paste
As we know, the most commonly used copy and paste method is Ctrl + C/V, but if you want to paste the copy history, you can select the content you want to paste by Ctrl + Shift + V in IDEA.
Also, in IDEA, the code is automatically formatted during pasting by default. If we don’t want it to format automatically, we can use the shortcut Ctrl + Alt + Shift + V to paste at this point. Or right-click the menu and choose Paste as Plain Text to Paste.
Formatting code
To format automatically, you can select Ctrl + A for all or select the part you want to format and then use the shortcut Ctrl + Alt + L to format.
Cut and copy one or more lines
To cut a line, move the mouse cursor to the line to be cut, and then use the shortcut key Ctrl + X to cut.
To copy a line, move the mouse cursor to the line you want to copy and then use the shortcut key Ctrl + D to copy it.
To copy multiple lines, select the multiple lines you want to copy, and then use the shortcut key Ctrl + D to copy.
Move one or more lines up or down
To move a line up or down, place the mouse cursor on the line to be moved, and then press Ctrl + Shift + up/down to move the line quickly.
To move multiple lines up or down, select the desired multiple lines and quickly move them up or down by pressing Ctrl + Shift +.
Quick jump
Locate by line number
Press The shortcut key Ctrl + G and then enter the line to jump to the corresponding line.
The Tab to switch
If we have multiple files open, in order to quickly switch between different files, in addition to clicking the corresponding file label with the mouse, we can also use the shortcut key Alt + left/right to quickly switch between files.
View a list of recently viewed files
Through the shortcut key Ctrl + E, we can quickly open the list of files we recently browsed;
Quickly open the file folder
To open the file folder, right-click the file and select Show in Explorer.
Quick find and replace
Content find and replace
-
A single file
For a single file, you can use the shortcut key Ctrl + F to search, Ctrl + R to replace;
-
Global file
For global search, Ctrl + Shift+ F, for global replace, Ctrl + Shift+ R;
File search
To quickly find a file, press Ctrl + Shift+ N to find it;
Find menus or actions
Ctrl + Shift + A shortcut, then we can find the menu and action we need by keyword;
Universal search
By double clicking Shift twice, to achieve universal search, can achieve file search, can also achieve menu, operation search, but note that it can not carry out file content search;
Pay attention to
In the new version of IDEA, file lookup, menu or action lookup, and universal lookup are all integrated, so we only need to remember one of them!
conclusion
Here are some efficiency tips for using IDEA. If you haven’t already, try them out
Finally, writing is not easy. If you find this article helpful, just give it a thumbs up and go!