Java common shortcut key summary of of super classic

  • 2020-04-01 02:13:58
  • OfStack

There are a lot of shortcut keys, one by one to say for sure!
You can also set it yourself in myeclipse.
Below give you stick a, very whole!

Eclipse is a common shortcut
Eclipse editing function is very powerful, grasp the Eclipse shortcut key function, can greatly improve the development efficiency. Eclipse has the following edit-related shortcuts.
  1. "ALT + /"
  This shortcut key is a good helper for users to edit, can provide users with the content of the auxiliary, do not worry about remembering the names of all methods and attributes, when you can't remember the names of all classes, methods and attributes, more experience the benefits of [ALT+/] shortcut key.
  2. "Ctrl + O"
  Shows an outline of methods and properties in a class, quickly locates methods and properties of a class, and is useful for finding bugs.

  3. "Ctrl + /"
  Quick comments, quick comments or uncomments for the line where the cursor is or the line selected, there may always be a need to comment something or uncomment something while debugging, now you don't need to comment each line repeatedly.

  4. "Ctrl + D"
  Delete the current line, which is one of my favorites, without having to press 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 key.

  View and locate the shortcut keys

  In the program, it is not easy to quickly locate the location of the code, quickly find the location of the Bug, Eclipse provides a powerful search function, you can use the following shortcut keys to help complete the search and location of the 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 files in the Workspace build path, don't go to the trouble of not finding the classes, 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 wildcards.

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

  5. "Ctrl + Shift + O"
Quickly generate import, when you copy a program from the Internet, do not know how to import into the called class, try [Ctrl+Shift+O] shortcut key, there will be a surprise.

  6. [Ctrl + Shift + F]
  Format code, writing format specification of the code is a required course for every programmer, when you see a piece of code is not pleasing to the eye, selected after pressing the shortcut key (Ctrl+Shift+F) to format this code, if not selected code is 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.

  [Alt+ please ], [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.

  Debug shortcut

  Eclipse has the following shortcuts for running debugging.

  1. [Ctrl+Shift+B] : set a breakpoint on the current line or cancel the breakpoint set.
  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 [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 edit-related shortcuts that 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 that you can't enumerate, and you can use the help document to find out how to use them, as well as a few common ones.
  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.

  There are many shortcuts in Eclipse, and you can find all of them through the help document, but it is impossible and unnecessary to master all of them. If you take the time to familiarize yourself with the shortcuts listed in this section, you will get twice the result with half the effort

1. Edit - > The content Assist - >   Add          Alt + /   Code associated
Window - > 2. Next Editor - > Add      Ctrl+Tab toggle Windows
3. Run/Debug Toggle Line Breakpoint -> Add Ctrl+ 'add/delete breakpoints while debugging
4. The Source - > Surround with try/catch Block. Ctrl + Shift + v  Add a try catch box
5. The Source - > Generate Getters and Setters -> Ctrl+Shift+. Add the get set method


-- useful shortcut keys --
Alt+/ code assistant to complete some code insertion (but generally with the input method conflict, you can modify the hot key of the input method, or temporarily use Alt+/ to replace)
Ctrl+1: hover over a variable and press Ctrl+1 to provide a quick refactoring plan. Select a few lines and press Ctrl+1 to place the code in a block such as for, while, if, do, or try.
Double - click the open parenthesis (bracket, bracket, brace) to select everything in the bracket.
Alt+Enter displays the properties of the currently selected resource (project,or file,or file)

-- -- -- -- -- -- -- -- -- -- - Ctrl series -- -- -- -- -- -- -- -- -- -- -
Ctrl+K: hover the cursor over the variable and press Ctrl+K to find the next same variable
Ctrl+Shift+K: looks in the opposite direction to Ctrl+K
Ctrl+E quick display of the current Editer drop-down list (if the current page is not displayed in bold)
Ctrl+Shift+E shows the manager that manages all currently open views (you can choose to close, activate, etc.)
Ctrl+Q goes to the last edit
Ctrl+L position on a line (good news for programs over 100)
Ctrl+M maximizes the current Edit or View (press again and vice versa)
Ctrl+/ comments the current line and then uncomments it
Ctrl+T quickly displays the inheritance structure of the current class
Ctrl+ shift-t: Open type. If you don't mean to dawdle, forget how to open it through the source tree.
Ctrl+O: opens a small window in the code similar to the outline view
Ctrl+ hover: you can display the source code for classes and methods
Ctrl+H: open the search window
Ctrl+/(keypad) folds all the code in the current class
Ctrl+ x (keypad) expands all the code in the current class

-- -- -- -- -- -- -- -- -- -- - Ctrl + Shift series -- -- -- -- -- -- -- -- -- -- -
Ctrl+Shift+F formats the current code
Ctrl+Shift+X changes all the currently selected text to lowercase
Ctrl+Shift+Y changes all currently selected text to lowercase
Ctrl+Shift+O: fast import
Ctrl+Shift+R: open Resource

--F shortcut key series --
F3: open the file that declares the reference
F4: opens the type hierarchy
F5: single jump
F6: step over
F7: one-step jump
F8: continue. If there are no breakpoints, the program will run out

-- line editing --
Ctrl+D: deletes the current line
Ctrl+Alt+ left copy the current line to the next line (copy added)
Ctrl+Alt+ write copy the current line to the previous line (copy added)
Alt+ left the current line interacts with the following line (especially useful, you can save cutting and then pasting)
Alt+ write the current row and the preceding row interact (iditto)
Shift+Enter inserts a blank row in the next row of the current row (the mouse can be anywhere in the current row, not necessarily at the end)
Ctrl+Shift+Enter inserts a blank line in the current line (same principle as above)

-- not commonly used --
Alt+ please previous edited page
Alt+ - next edited page (for the top one, of course)
Ctrl+Shift+S: save all
Ctrl+W to close the current Editer
Ctrl+Shift+F4 close all open Editer

Ctrl+Shift+G: search for references in workspace
Ctrl+Shift+P position to the correct character (such as {})
-- I don't understand --
Ctrl+J forward incremental search (after pressing Ctrl+J, every letter you type in the editor will provide a quick match to locate a word, if not, it will be shown not found in stutes line, especially useful when looking up a word, this function has been available two years ago)
Ctrl+Shift+J reverse delta search


Related articles: