For Java development, Eclipse is the preferred editor, and I've been using it, summarizing and collecting some shortcuts for improving development efficiency. Collection and review.
1. Shift+enter and Ctrl+shift+enter
Shift+enter creates a blank line below the current line, regardless of whether the cursor is at the end of the row. Ctrl+shift+enter inserts a blank line before the current line.
2. ALT + arrow key up and down (not copy move), left/right (return to history edit box)
This is also a magic weapon to save time. This combination moves the contents of the current line up or down. In the Try/catch section, this shortcut is especially useful.
3. ctrl+alt+ arrow keys up and down (copy move)
This is also a magic weapon to save time. This combination copies the contents of the current line and moves up or down.
4. Ctrl+m
Large display screen can improve productivity is known to everyone. Ctrl+m is the shortcut key for maximizing the editor window.
5. Ctrl +. And Ctrl+1: Next error and quick change
CTRL +. Moves the cursor to the next report fault or warning in the current file. This set of shortcut keys I generally use with ctrl+1, that is, modify the proposed shortcut keys. The new version of Eclipse suggestions are good to help you solve a lot of problems, such as missing parameters in the method, Throw/catch exception, non-executed methods and so on.
6.ctl + Shift + T opening type (open type), ctrl+t (Implementation class list interface-oriented programming, very useful)
If you want to see the full path of a class, such as Viewpager, if you are not intentionally skiving, forget to open it through the source tree. Using Eclipse to easily open an implementation class for an interface, press CTRL+T to list the implementation class of the interface
7 . CTL + SHIFT + F: Reformat the code according to the Code style settings.
Our team has a unified code format and we put it on our wiki. To do this, we open Eclipse, select the window Style, and then set the Code formatter,code style and organize Imports. Use the export feature to generate a configuration file. We put these profiles on the wiki, and everyone in the team is imported into their eclipse.
8.alt + SHIFT + t or ALT + SHIFT + M: Extracting a piece of code as a method extract methods
you have to select the part you want to extract first. If you select a line, a few lines, a block of code.
9.alt + CTRL + H check where this method or property was called
triggering on a method or attribute, or where the class can be called, is useful.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Java Eclipse most useful shortcut keys (continuous update)