简体   繁体   English

Eclipse 导入的快捷键

[英]Key Shortcut for Eclipse Imports

It's been a while since I last used Eclipse.我上次使用 Eclipse 已经有一段时间了。 I used to love this handy key shortcut that added all the imports to the top of the source file, but I've forgotten it.我曾经喜欢这个方便的快捷键,它将所有导入添加到源文件的顶部,但我已经忘记了。 Does anyone know what this shortcut is?有谁知道这个快捷方式是什么?

Ctrl + Shift + O (<-- an 'O' not a zero) Ctrl + Shift + O (<-- 'O' 不是零)

Note: This shortcut also removes unused imports.注意:此快捷方式还会删除未使用的导入。

Some useful shortcuts.一些有用的快捷键。 You're looking for the 1st one...你正在寻找第一个......

  1. Ctrl + Shift + O : Organize imports Ctrl + Shift + O :组织导入
  2. Ctrl + Shift + T : Open Type Ctrl + Shift + T :打开类型
  3. Ctrl + Shift + F4 : Close all Opened Editors Ctrl + Shift + F4 :关闭所有打开的编辑器
  4. Ctrl + O : Open declarations Ctrl + O : 打开声明
  5. Ctrl + E : Open Editor Ctrl + E :打开编辑器
  6. Ctrl + / : Line Comment Ctrl + / : 行注释
  7. Alt + Shift + R : Rename Alt + Shift + R :重命名
  8. Alt + Shift + L : extract to Local Variable Alt + Shift + L :提取到局部变量
  9. Alt + Shift + M : extract to Method Alt + Shift + M :提取到方法
  10. F3 : Open Declaration F3 : 打开声明

Source Here来源在这里

Some other useful shortcuts:其他一些有用的快捷方式:

  1. Alt + Shift + R : R ename ALT + SHIFT + R:R为ename
  2. Alt + Shift + Y : Word wrap Alt + Shift + Y :自动换行
  3. Alt + Shift + V : Move the selected elements Alt + Shift + V :移动所选元素
  4. Alt + Shift + I : I nline refactoring ALT + SHIFT + I:n线重构
  5. Alt + Shift + M : Extract M ethod refactoring. Alt + Shift + M:提取物中号ethod重构。
  6. Alt + Shift + L : Extract L ocal Variable Alt + Shift + L:提取大号OCAL变
  7. Alt + Shift + A : Block selection mode Alt + Shift + A :块选择模式
  8. Alt + Shift + Arrow Keys : selects enclosing elements Alt + Shift +箭头键:选择封闭元素
  9. Alt + Shift + F1 : Focus on eclipse element to know plugin implementation details. Alt + Shift + F1 :关注 eclipse 元素以了解插件实现细节。
  10. Alt + Shift + F2 : Plugin implementation details. Alt + Shift + F2 :插件实现细节。
  11. F4 : Type Hierarchy F4 : 类型层次
  12. Ctrl + Shift + T : Open T ype按Ctrl + Shift + T:打开牛逼YPE
  13. Ctrl + Shift + H : Open Type in H ierarchy按Ctrl + Shift + H:开放H中ierarchy
  14. Ctrl + Alt + H : Call H ierarchy按Ctrl + Alt + H:呼叫^ h ierarchy
  15. Ctrl + Shift + G : Reference in workspace Ctrl + Shift + G :工作区中的参考
  16. Ctrl + Alt + G : Quick Search for selected text Ctrl + Alt + G :快速搜索所选文本
  17. Ctrl + Shift + O : O rganize imports按Ctrl + Shift + O:O rganize进口
  18. Ctrl + Shift + M : Add import for currently selected. Ctrl + Shift + M :为当前选定的添加导入。
  19. Ctrl + Shift + L : Shows you a L ist of your currently defined shortcut keys按Ctrl + Shift + L:显示您当前定义的快捷键A L IST
  20. Ctrl + Shift + U : Occurrence in current file Ctrl + Shift + U :出现在当前文件中
  21. Ctrl + Shift + A : Open plug-in A rtifact按Ctrl + Shift + A:打开插件的A rtifact
  22. Ctrl + Shift + { : Two side by side editors with current file Ctrl + Shift + { :带有当前文件的两个并排编辑器
  23. Ctrl + Shift + Space : Parameter Hints Ctrl + Shift + Space : 参数提示
  24. Ctrl + Shift + Mouse hover : To view javadoc Ctrl + Shift + 鼠标悬停:查看 javadoc
  25. Shift + Mouse hover : To view source code Shift + 鼠标悬停:查看源代码
  26. Ctrl + Space : Content Assist Ctrl +空格:内容辅助
  27. Ctrl + F3 / O : Outline Ctrl + F3 / O :大纲
  28. Ctrl + T : T ype Hierarchy按Ctrl + T:YPE层次
  29. Ctrl + H : Open Search Dialog Ctrl + H :打开搜索对话框
  30. Ctrl + 1 : Quick Fix Ctrl + 1 :快速修复
  31. Ctrl + Shift + NUM_KEYPAD_DIVIDE : Collapse All code blocks Ctrl + Shift + NUM_KEYPAD_DIVIDE :折叠所有代码块
  32. Ctrl + Shift + NUM_KEYPAD_MULTIPLY : To open all code blocks Ctrl + Shift + NUM_KEYPAD_MULTIPLY :打开所有代码块
  33. Alt + left arrow : Open recently closed file Alt +左箭头:打开最近关闭的文件

Ctrl + Shift + any key :Direct actions (on text mostly) Ctrl + Shift + 任意键:直接操作(主要针对文本)

Alt + Shift + any key : Indirect actions Alt + Shift + 任意键:间接操作


Ctrl It was originally used to send Control character to terminals. Ctrl最初用于向终端发送控制字符 Ctrl commands are commonly used shortcuts. Ctrl 命令是常用的快捷方式。 (In Mac Command ) (在 Mac命令中

Alt It enables alternate uses for other keys. Alt它允许其他键的交替使用。


The above shortcuts are default, if we want to change shortcuts we can do.以上快捷键是默认的,如果我们想改变快捷键我们可以做。 In eclipse -> Windows -> preferences -> keys.在 Eclipse -> Windows -> 首选项 -> 键。 Where we can find all shortcuts with full details:我们在哪里可以找到所有带有完整详细信息的快捷方式:
在此处输入图片说明

and
https://shortcutworld.com/IntelliJ-IDEA/win/IntelliJ_Shortcuts https://shortcutworld.com/Eclipse/win/Eclipse-Helios_Shortcuts https://www.jetbrains.com/help/idea/migrating-from-eclipse-to-intellij-idea.html#Shortcuts https://shortcutworld.com/IntelliJ-IDEA/win/IntelliJ_Shortcuts https://shortcutworld.com/Eclipse/win/Eclipse-Helios_Shortcuts https://www.jetbrains.com/help/idea/migrating-from-eclipse- to-intellij-idea.html#Shortcuts

You also can enable this import as automatic operation.您还可以将此导入启用为自动操作。 In the properties dialog of your Java projects, enable organize imports via Java Editor - Save Action .在 Java 项目的属性对话框中,通过Java Editor - Save Action启用organize imports After saving your Java files, IDE will do organizing imports, formatting code and so on for you.保存您的 Java 文件后,IDE 将为您组织导入、格式化代码等。

IntelliJ just inserts them automagically; IntelliJ 只是自动插入它们; no shortcut required.不需要捷径。 If the class name is ambiguous, it'll show me the list of possibilities to choose from.如果类名不明确,它会向我显示可供选择的可能性列表。 It reads my mind....它读我的心......

Ctrl + Space : Show Imports Ctrl +空格:显示导入

This displays imports as you're typing a non-standard class name provided the proper references have been added to the project.这会在您键入非标准类名时显示导入,前提是已将正确的引用添加到项目中。

This works on partial or complete class names as you are typing them or after the fact (Just place the cursor back on the class name with squigglies).这适用于部分或完整的类名,因为您正在键入它们或在输入之后(只需将光标放回带有波浪线的类名上)。

也可以使用CTRL + 1这将建议导入。

对于静态导入,选择字段并按 Ctrl+Shift+M

Yes.是的。 you can't remember all the shortcuts.你无法记住所有的快捷方式。 You will forget many of them for sure.你肯定会忘记其中的许多。 In this way, you can recall it and get the work done quickly.这样,您就可以回忆起来并快速完成工作。

Press Ctrl + 3Ctrl + 3

And type whatever the hell you want :) It's a shortcut for shortcuts并输入您想要的任何内容:) 这是快捷方式的快捷方式

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM