android development of common Eclipse shortcut keys in detail

  • 2020-05-07 20:24:35
  • OfStack

Eclipse shortcut key - easy to find, oh, bad memory
Line comment/pin comment Ctrl+/ block comment/pin comment /XML comment Ctrl+Shift+/ Ctrl+Shift+\
Find find replace Ctrl+H Ctrl+F
Find the next/go back Ctrl+K Ctrl+Shift+K
Jump to a line Ctrl + L, ha used to use Editplus, from time to time will hit Ctrl + G,
Find the declaration Ctrl+G for the current element
Find all references to the current element Ctrl+Shift+G
Reorganize Import Ctrl+Shift+O to help you once remove all unused Import declarations!
Quick fix for Ctrl+1
Introduce a class (interface) ctrl + shift + m
Header comments shift + alt + j

Change the start page in the first activity label entry AndroidManifest.xml android:name=".ResultDemoActivity"
Change ResultDemoActivity to activity which you want to boot first

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

edits related shortcuts

Eclipse's editing function is very powerful, master Eclipse shortcut key function, can greatly improve the development efficiency. Eclipse has the following editing shortcuts.
1. [ALT+/] auto prompt method
This shortcut key is a good helper for users to edit, can provide users with the content of the auxiliary, do not remember the method and attribute names, when not remember the name of the whole class, method and attribute, more experience 1 [ALT+/] shortcut key benefits.

2. 【 Ctrl + O 】
Shows an outline of methods and properties in a class, quickly locates methods and properties of a class, and is useful when looking up Bug.

3. [Ctrl+/] press again to restore
Quick comments, quick comments or uncomments for the cursor line or selected line, probably always need to comment 1 something or uncomment when debugging, now you don't need to comment every line repeatedly.

4. 【 Ctrl + D 】
Delete the current line, which is the author's favorite 1, instead of pressing the delete key so many times to delete a line.

5. 【 Ctrl + M 】
Window maximization and restore, the user in the window operation, always feel the current window is small (especially when writing code), now, try [Ctrl+M] shortcut keys.

view and locate shortcuts

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

1. [Ctrl+K], [Ctrl++Shift+K]
Quickly look down and up for the selected content, eliminating the need to click the find dialog.

2. 【 Ctrl + Shift + T 】
Find the Java class file in the workspace (Workspace) build path, don't go to the trouble of not finding the class, and use "*", "?" Equal wildcard.

3. 【 Ctrl + Shift + R 】
Corresponding to [Ctrl+Shift+T], find all files (including Java files) in the workspace (Workspace), or use a wildcard.

4. 【 Ctrl + Shift + G 】
Find references to classes, methods, and properties. This is a very useful shortcut key, for example, to modify the code that references a method, you can quickly locate all references to this method by the Ctrl+Shift+G shortcut key.

5. 【 Ctrl + Shift + O 】
Quickly generate import, after copying 1 segment of the program from the Internet, do not know how to import into the called class, try [Ctrl+Shift+O] shortcut key, 1 will have a surprise.

6. [Ctrl+Shift+F] specification code
Format code, writing standard code is a required course for every programmer, when you see a piece of code is very annoying, after the selection of the shortcut key [Ctrl+Shift+F] can format this code, if the code is not selected, the default format of the current file (Java file).

7. 【 ALT + Shift + W 】
Finding the path in the project where the current file is located quickly locates the location of the browser view, and this shortcut is useful if you want to find the package where a file is located (especially in larger projects).

8. 【 Ctrl + L 】
Locate a line in the current editor, which is also valid for non-Java files.

9. [Alt+←], [Alt+→]
The backward history and forward history are useful for tracking code. The user may have looked up several places of interest, but may not remember, and can use these two shortcuts to locate the order of the lookups.

10. 【 F3 】
A class, method, and property that quickly locates the cursor position.

11. 【 F4 】
Displays the class's inheritance relationships and opens the class inheritance view.

12. [first type "/", then type two **, then press enter or Alt+Shift+J before the method name to add Javadoc comments]
Methods the annotation

debugging shortcut

Eclipse has the following shortcuts for running debugging.

1. [Ctrl+Shift+B] : set or unset breakpoint on the current line.
2. 【F11】 : debug the program executed for the last time.
3. 【Ctrl+F11】 : run the last execution of the program.
4. [F5] : trace to the method. When the program executes to a method, you can press [F5] to trace to the method.
5. [F6] : single-step program.
6. [F7] : after executing the method, return to the last statement that called the method.
7. [F8] : continue execution to the next breakpoint or the end of the program.

common editor shortcuts

Text editors typically provide some edit-related shortcuts, which are also available in Eclipse for text editing.
1. 【Ctrl+C】 : copy.
2. 【Ctrl+X】 : cut.
【Ctrl+V】 : paste.
4. 【Ctrl+S] : save the file.
5. 【Ctrl+Z】 : undo.
6. 【Ctrl+Y】 : repeat.
7. [Ctrl+F] : find.

other shortcuts

There are also many shortcuts in Eclipse, which cannot be listed in 11 lists, and users can find out how to use them through the help document. There are also several common shortcuts 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.

Related articles: