Eclipse practical shortcut key record table

Source: Internet
Author: User
Tags java keywords

  As a Java programmer, eclipse is a programming tool that I often use. I have to learn to familiarize myself with programming tools before programming, here I will introduce what we need most in programming-Shortcut Keys. If we are familiar with shortcuts, our programming speed will be much faster and many mistakes can also be avoided, because we are living people and will inevitably make mistakes. However, there are too many shortcut keys for eclipse, and some of them are true and rarely used, which is of little help. Therefore, these shortcut keys should be organized here for ease of use. The following shortcut keys are all tested in my own eclipse, and I have already seen their execution results. Of course, you can find a lot of them if you search for them online, just like what I did, but I found that some shortcuts did not play a role in my eclipse, and some did not, even if they did, therefore, I would like to pick out some useful ones. If your eclipse version is different from my version or some shortcut keys have different effects, please forgive me. In addition, if you have the same function as the shortcut key, I only select one to record, because we don't need that much. The shortcut keys of the editing type are introduced first. 1. I believe everyone is familiar with the CTRL + F shortcut, that is, to search for keywords and replace them globally. If you use this shortcut key, a small window will pop up, so we only need to perform the operation according to the requirements in it. 2. I tested the shortcut key Ctrl + Shift + k in eclipse, that is, from bottom to top to find the method name with the same name. However, this shortcut key can only be used to find the same method name as the class name, because the class name is always placed in our Code First, it searches for the class name by default. Therefore, this shortcut key is used to quickly locate the constructor. 3. CTRL + k is similar to the above, but the search order is from top to bottom. 4. CTRL + D Delete the entire line of code in the current line. 5. Shift + enter insert blank lines under the current row. 6. Press Ctrl + Shift + enter to insert empty rows on the current row. 7. Press Ctrl + Q to locate the location of the previous operation. 8. Alt +/This shortcut key is really very useful! Because it will automatically prompt the Code. For example, when we input t, it will list all methods related to T. If we prompt more, basically, we will list the one we want, which will save us a lot of effort and, more importantly, reduce programming errors, because sometimes we are very likely to write errors, and this probability is really not small! When I first learned programming, I checked the code for a long time because of a variable name written by mistake, because such errors are hard to find out why! 9. Press Ctrl + A to select all the codes. Do not explain them. 10. Alt + Shift + S then press the r shortcut key to automatically generate the get () and set () methods for some variables. This is possible, because many times when we design a class, we will have the corresponding get () and set () methods for its data members, because we usually operate on them in our code. 11. The CTRL + T shortcut will help us find all the implementation classes of an interface. Next is the quick window operation. This part is of little significance for me personally, because I personally think it is quite good to use the mouse, but write it out, because everyone has different requirements. 1. CTRL + W close the current window. 2. CTRL + F7 if you open a class window, it will display package explorer. 3. CTRL + F8 I tried this, that is, switching between debug and perspective 4. CTRL + F10 open the View menu and modify the view. Then there is the shortcut key of the navigation type. This part of the function is also a type that requires less opportunities at ordinary times, probably because I am a newbie, so I have no idea about my own classes and libraries, but it should be useful for some people who have already developed or have a large number of custom tool classes or libraries in the company? Haha, I can only say that. If you want to use it, take it away. 1. CTRL + O this is the shortcut key to open the structure of a class. It lets us know what data members and Methods this class has. I personally think This is not bad. I can know what my class is like. 2. CTRL + Shift + t the shortcut key of the file type is familiar to everyone, so you can find all the classes with the same name and their locations based on the class name you entered, this is also very practical, but I almost don't need it. 3. F4 can open the hierarchical structure of the class, including the data members and methods of the class. It is the enhanced version of the first shortcut key. 4. Shift + F2 can open the external javadoc. 5. CTRL + Shift + R. The root keyword can be used to search for related resources, including self-written classes or externally imported classes. 6. Alt + leading, ALT + → scan your code one by one with spaces in the forward and backward directions. 7. CTRL + Shift + P to the matching brackets. Sometimes there are too many nested layers in our code, too many parentheses, and we are all confused. Especially if we do not have good indentation habits or even none, we can't understand it! In this case, the matching brackets are very useful. However, I think this is really okay, because we only need to double-click the mouse at the first bracket to locate the content included in the bracket. Therefore, this shortcut key is not necessary. 8. Press Ctrl + Q to go to the previous code editing point. The so-called editing point can be the modification or the last cursor stopped. 9. CTRL + Shift + align, CTRL + Shift + align go to the previous or next member. The member can be a data member or a method. 10. CTRL + l go to the number of rows you entered. Honestly, I think this is a little redundant, because I often don't know which line of my code has anything, where to go, and why to go there, this is a big problem. The following is the shortcut key of the search type. This type of shortcut keys are very practical, especially the large code, it is very troublesome to search for the relevant bytes, because the code is too large, so you need to use the shortcut keys. 1. Press Ctrl + Shift + u to find all the characters in the code that you want to find. However, it should be noted that the cursor is placed behind the byte instead of circled, and this shortcut key is not useful for modifiers or Java keywords, but for data types such as int, in addition, it will automatically help you find the method to return Int. If it is a variable, it will find out the way to return the variable and perform any operations on the variable, such as assigning values. Even the method name can be used to locate the row of the method, but remember that if the method name is used, the cursor must be behind the method name and cannot contain parentheses. 2. Press Ctrl + H to open the search box. You don't need to talk about what the search box is. 3. CTRL + G: the method that displays the variable in the same package. 4. CTRL + Shift + g This is a method for displaying the list of parameters in the same package. It must be a complete list of parameters, because it is actually linked to a specific method, and is still limited to the same class, it does not play a role. The text editing class is really useless, because there are not many, that is, an insert is a bit useful, that is, when I need to replace the whole line of code with other code, I can put it at the beginning of the line, rewrite from scratch. But, to be honest, I can remove it all, so... That's it. There is really no need to talk about file shortcut keys. I believe everyone is familiar with them, because they often have to deal with them, such as saving them, but let's list them, but it is no longer arranged as above, and it just goes through like below. CTRL + S (SAVE), CTRL + Shift + S (save all), CTRL + Shift + W (close all), ALT + enter (Open attributes of this class ), CTRL + N (new file ). The next shortcut key is the key, because it can help you sort out your code and even automatically generate some code. However, you must note that some shortcut keys are the same as those set for your input method, so they may not work. You need to check your input method settings. 1. CTRL + Shift + F: the shortcut key can typeset the code you selected. If your code needs to be indented but you cannot indent it one by one, you must use this shortcut key, this will make your code more tidy. 2. Press Ctrl +/to comment out the selected code and then press it again to cancel the comment. Finally, there is a shortcut for refactoring, that is, when we need to refactor our code, such as the extraction method, all of which have corresponding shortcuts. Here is just a rough list of the functions of the corresponding shortcut keys, because each of them can talk about a lot. Alt + Shift + Z, undo refactoring, ALT + Shift + M, extraction method, extraction of local variables, ALT + Shift + L, inline, ALT + Shift + I, move, alt + Shift + V, rename, ALT + Shift + R, redo, ALT + Shift + Y. Now the full text is over. Of course, there are still many convenient shortcut keys I have not written or found any materials here, but I think, the shortcut keys described above have already met my needs, so I will not continue to discuss them, because I wrote a blog article to help me record relevant information, therefore, many things are written based on myself. I am not a great guy, and I am not able to post any tutorials at all. I am so embarrassed to make a shift in front of some real cool people.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.