Eclipse shortcuts - easy to find

Line Comment/Pin Comment Ctrl+/ Block Comment/Pin Comment/XML Comment Ctrl+Shift+/ Ctrl+Shift+\
Find Find Replace Ctrl+H Ctrl+F
Find Next/Go Back Ctrl+K Ctrl+Shift+K
Jump to a certain Line Ctrl+L,
find the declaration of the current element Ctrl+G
Find all references to the current element Ctrl+Shift+G
Reorganize Import Ctrl+Shift+O, can help you remove all unused Import declarations at once!
Quick fix Ctrl+1
to introduce a certain class (interface) ctrl + shift + m
plus head comment shift + alt + j

Change the startup page in the first activity tag item of AndroidManifest.xml android:name=”.ResultDemoActivity” \
ResultDemoActivity to the activity you want to start first

Uncheck "Block comment formatting":
Windows->Preferences->Java->Code Style->Formatter->Edit->Comments, then uncheck "Enable block comment formatting".

Edit related shortcuts

The editing function of Eclipse is very powerful. Mastering the shortcut key function of Eclipse can greatly improve the development efficiency. Eclipse has the following shortcut keys related to editing.
1. [ALT+/] Automatic prompting method
This shortcut key is a good helper for users to edit, and can provide users with content assistance. Don't worry about not remembering all the names of methods and properties. Experience the benefits of the [ALT+/] shortcut key.

  1. [Ctrl+O]
    Displays the outline of the methods and properties in the class, which can quickly locate the methods and properties of the class, which is very useful when finding bugs.

  2. [Ctrl+/] Press again to restore
    Quickly add comments, you can quickly add comments or uncomments for the line where the cursor is located or the selected line, you may always need to comment something or uncomment when debugging, now it's good, no need Make repeated comments per line.

  3. 【Ctrl+D】
    Delete the current line without pressing the delete key so many times to delete a line.

  4. [Ctrl+M]
    The window is maximized and restored. When users operate in the window, they always feel that the current window is small (especially when writing code). Now, try the [Ctrl+M] shortcut key.

View and locate shortcuts

In the program, it is very difficult to quickly locate the location of the code and quickly find the location of the bug. Eclipse provides a powerful search function, and the following shortcut keys can be used to help complete the search and positioning work.

  1. [Ctrl+K], [Ctrl++Shift+K]
    Quickly find the selected content down and up, and no longer need to click the search dialog box with the mouse.

  2. [Ctrl+Shift+T]
    Find the Java class files that can be found in the workspace (Workspace) build path, don't worry about not being able to find the class, and you can use wildcards such as "*" and "?".

  3. [Ctrl+Shift+R]
    corresponds to [Ctrl+Shift+T] to find all files (including Java files) in the workspace (Workspace), and wildcards can also be used.

  4. [Ctrl+Shift+G]
    Find references to classes, methods, and properties. This is a very useful shortcut key. For example, if you want to modify the code that references a method, you can use the [Ctrl+Shift+G] shortcut key to quickly locate all the locations that reference this method.

  5. [Ctrl+Shift+O]
    Quickly generate import. After copying a program from the Internet, I don't know how to import the called class. Try the shortcut key of [Ctrl+Shift+O], there will be surprises.

  6. [Ctrl+Shift+F] Standard code
    Formatting code, writing standard code is a compulsory course for every programmer. When you see a certain piece of code that is extremely unpleasant, press [Ctrl+Shift+F] after selecting it. The key can format this code, if the code is not selected, the current file (Java file) will be formatted by default.

  7. [ALT+Shift+W]
    Find the path in the project where the current file is located, you can quickly locate the location of the browser view, if you want to find the package where a file is located, this shortcut key is very useful (especially in relatively large projects) .

  8. [Ctrl+L]
    locates a line in the current editor, it is also valid for non-Java files.

  9. [Alt+←], [Alt+→]
    back history and forward history are very useful when tracking codes. Users may have found several related places, but they may not remember them clearly. They can be located by these two shortcut keys. search order.

  10. 【F3】
    Quickly locate a class, method and property at the cursor position.

  11. 【F4】
    Display the inheritance relationship of the class, and open the class inheritance view.

12. [Knock "/" first, then two **, then press Enter or press Alt+Shift+J before the method name to add Javadoc comments]
Method comments

Debug shortcuts

Eclipse has the following shortcut keys related to running and debugging.

  1. [Ctrl+Shift+B]: Set a breakpoint or cancel the set breakpoint on the current line.
  2. 【F11】: Debug the last executed program.
  3. 【Ctrl+F11】: Run the last executed program.
  4. 【F5】:trace to the method, when the program executes to a method, you can press the【F5】key to trace to the method.
  5. 【F6】: Single-step program execution.
  6. 【F7】: After executing the method, return to the next statement that calls this method.
  7. 【F8】: Continue to execute to the next breakpoint or end of the program.

Common editor shortcuts

Usually text editors provide some shortcut keys related to editing, and you can also use these shortcut keys to edit text in Eclipse.
1. [Ctrl+C]: Copy.
2. [Ctrl+X]: Cut.
3. [Ctrl+V]: Paste
4. [Ctrl+S]: Save the file.
5. [Ctrl+Z]: Cancel.
6. [Ctrl+Y]: Repeat.
7. [Ctrl+F]: Search.

Other shortcut keys

There are many shortcut keys in Eclipse, which cannot be listed one by one. Users can find out how to use them through the help documentation. In addition, there are several commonly used shortcut keys as follows.
1. [Ctrl+F6]: Switch to the next editor.
2. [Ctrl+Shift+F6]: Switch to the previous editor.
3. [Ctrl+F7]: Switch to the next view.
4. [Ctrl+Shift+F7]: Switch to the previous view.
5. [Ctrl+F8]: Switch to the next perspective.
6. [Ctrl+Shift+F8]: switch to the previous perspective.

The following shortcut keys are commonly used in refactoring: Note: Generally, the shortcut keys for refactoring start with Alt+Shift

Alt+Shift+R Rename (it is my favorite one, especially the Rename of variables and classes, which can save a lot of labor than manual methods)
Alt+Shift+M Extraction method (this is the most commonly used in refactoring One of the methods, especially useful for a lot of mud code)
Alt+Shift+C Modify the function structure (more practical, there are N functions calling this method, modify it once)
Alt+Shift+L Extract local variables ( You can directly extract some magic numbers and strings into a variable, especially when multiple calls)
Alt+Shift+F Change the local variable in the Class into a field variable (a more practical function)
Alt+Shift+I Combine variables (It may be a bit inappropriate to say this Inline)
Alt+Shift+V Move functions and variables (not very common)
Alt+Shift+Z Refactoring regret medicine (Undo)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325493823&siteId=291194637