Better improve your work efficiency - Edea's shortcuts

zhaozj2021-02-08  203

Unconsciously, there is also a time for Idea. Although I don't dare to say that if I have finished confusing this tool, I still have some shortcuts, I spend some time to write out and share :)

Below is a summary of the shortcuts I often use, sorted by the frequency I use: 1. Ctrl Space complete class, method, and variable name automatic input This shortcut is the shortcut that I use most often, it can Automatic entry of the class, method, and variable name is very convenient (JB also has similar functions, called codeinsight, but I will not use it to complete the input of the variable name, causing me to my IDEA), now I wrote The program basically does not complete the full input variable name, because there is a tool to help you, why do you want to knock your keyboard?

2. Ctrl N (Ctrl Shift N) Jump to the specified Java file (other files) This shortcut will let me transfer the good feelings of SourceInSight to IDEA, this feature is very convenient, at least I don't have to have every time Looking for the class files and JSP files I want to edit in a long string of files (JB also have similar features, but I only find that you can search for Java files, you can't search for JSP files)

3. Ctrl b jumps to the definition This is not to say more. It seems that it is a function that it will provide, but I want to give JetBrains, it is more convenient to have a context window as SourceInSight. At least I don't have to jump in the program (talking about jump, I remember a fun function of the IDEA, it can split an Editor window, just like Vi, this function is somewhat It is also a function like Context Window, but it is not the same as SourceInsight's Context Window.

4. Ctrl Alt Right / LEFT When you jump (forward / back) between edited code position, you often need to jump between the code. This feature can make us very convenient to do this. (And SourceInsight is very elephant, I don't know if this feature is mimicing SourceInsight.)

5. Ctrl Alt T is also very convenient to surround the selected code line (* including if, while, try catch et al.), I have to do it before: 1 Write IF-ELSE, 2 and adjust the code The indentation format, pay attention to whether parentheses match, now use this feature to do, save more, but let me get more lazy)

6. Ctrl Alt B jump to the method to implement this is also a very common function, there is not much to say.

7. Ctrl W Press a Word to select this shortcut function in the IDEA to select the words at the characters where the cursor is located, and then the extension area selecting the source code. For example, the following statement java.text.SIMPLEDATEFORMAT formatter = new java.text.SIMPLEDATEFORMAT ("YYYY-MM-DD HH: MM"); when the position of the cursor is in the string in the double quotes, Select this string, then the expression on the right side, then the entire sentence. I usually use it when I re-modify the code to select those long composite expressions, which is convenient:) 8. SHIFT F1 Shows the specified Java DOCS in the browser should also be almost all Java IDE provides the features that don't say much.

9. Ctrl q Shows Java Docs in Editor Window. This feature is very convenient - because sometimes just forgets the meaning of a parameter in the method you have written, don't want a browser to see Java Doc, this The advantage of this feature is reflected in

10. Ctrl / Note / Reverse Note The specified statement This feature This feature is very like a feature provided in the PB, which can comment and refuse to refer to the statement you selected (using a single line comment symbol "//"), you can also use Ctrl Shift / comment for multi-row statements (ie, use multi-line comment symbol "/ * ... * /")

11. F2 / SHIFT F2 Jump to the next / Previous error statement Idea provides a function of easy jump between the error statements, and you can quickly jump between the error statements.

12. SHIFT F6 provides a method, the renaming of the variables, the refector feature provided by the IDEA, I have a relatively small, compared to this feature is the most used. There is nothing to say for this feature, it is really convenient, try it.

13. Ctrl Alt 1 The code format selected according to the template is scheduled to format your Java code according to the format set in the template, but unfortunately only valid for the Java file :(

14. CTRL Alt i will automatically indent the selected code. This feature can also work when editing the JSP file, providing a supplement to the upper formatting code function.

15. Ctrl Alt O Optimize IMPORT automatically removes useless IMPORT statements, quite a good feature.

16. Ctrl ] / [Jump to code block end / start this feature VI, and a very common code editing function.

转载请注明原文地址:https://www.9cbs.com/read-3060.html

New Post(0)