0%

Intellij IDEA 13快捷键

以下快捷键对应Intellij IDEA mac版keymap设为Eclipse(mac)时。大部分跟eclipse一样,但有一些不同。部分快捷键做了自定义,会附上配置文件。 复制/剪切/粘贴 command+c/command+x/command+v 指定位置查找: ctrl+h 打开的文件内查找:默认没有,我改成了command+f 因为ctrl+f冲突,移动到下一个关键字:enter 移动光标到括号结尾:ctrl+],与下面的对应,我加了alt+command+]同时选中alt+command+shift+] 移动光标到括号开始:alt+command+[ 与上面的对应,我加了ctrl+],同时选中alt+command+shift+[ 打开源码相关菜单:ctrl+enter,可以生成构造方法,setter,getter,覆盖,委托,equals,hashCode,toString等方法。 代码完成,默认是ctrl+空格,与Spotlight冲突,我改成了ctrl+/ 代码对齐:command+shift+f 优化导入:command+shift+o 貌似只会删除无用的导入,不会添加需要导入的类 导入缺少的类:光标移到报错的代码上,按command+1,选择import class(第一项,可以直接回车),暂时没找到批量导入方法 复制光标所在行到下一行:command+alt+down 删除光标所在行:command+d 查看类层次结构:F4 查找所有调用:command+ctrl+g 展开/收缩方法:command++/- 展开所有:command+shift+= 收缩所有:command+shift+_ 显示当前类的所有方法和变量(类似eclipse里的大纲):command+o 运行:ctrl+alt+r,shift+command+F11 跳到源代码:F3 显示所有实现:command+t 跳到父类的实现(在子类的覆盖方法上):alt+shift+s 查找类:command+shift+t 生成if/if esle/try catch/synchronized等surround代码段:选中代码段,按alt+command+z 智能类型代码完成(在new后面自动加上类型):alt+shift+空格 注释:选中后 command+/ 每行双斜杠,ctrl+shift+/ /*注释/ 在错误处跳转:command+. command+shift+. 可以快速跳转到当前打开文件错误的地方 在方法间跳转:ctrl+alt+up/ctrl+alt+down 配置文件,保存到~/Library/Preferences/IdeaIC13/keymaps/Eclipse _Mac OS X_ copy.xml Eclipse _Mac OS X_ copy.xml:

<?xml version="1.0" encoding="UTF-8"?>
<keymap version="1" name="Eclipse (Mac OS X) copy" parent="Eclipse (Mac OS X)">
  <action id="CodeCompletion">
    <keyboard-shortcut first-keystroke="control SLASH" />
  </action>
  <action id="CollapseAllRegions">
    <keyboard-shortcut first-keystroke="shift meta DIVIDE" />
    <keyboard-shortcut first-keystroke="shift meta MINUS" />
  </action>
  <action id="CollapseRegion">
    <keyboard-shortcut first-keystroke="meta MINUS" />
  </action>
  <action id="EditorCloneCaretAbove">
    <keyboard-shortcut first-keystroke="control meta DOWN" />
  </action>
  <action id="EditorCodeBlockEnd">
    <keyboard-shortcut first-keystroke="control CLOSE_BRACKET" />
    <keyboard-shortcut first-keystroke="shift control P" />
    <keyboard-shortcut first-keystroke="meta alt CLOSE_BRACKET" />
  </action>
  <action id="ExpandAllRegions">
    <keyboard-shortcut first-keystroke="meta MULTIPLY" />
    <keyboard-shortcut first-keystroke="shift meta EQUALS" />
  </action>
  <action id="ExpandRegion">
    <keyboard-shortcut first-keystroke="meta ADD" />
  </action>
  <action id="Find">
    <keyboard-shortcut first-keystroke="meta F" />
  </action>
  <action id="GotoImplementation">
    <keyboard-shortcut first-keystroke="meta T" />
  </action>
  <action id="GotoSuperMethod">
    <keyboard-shortcut first-keystroke="shift alt S" />
  </action>
  <action id="MethodHierarchy.ImplementMethodAction" />
  <action id="SwitchApply">
    <keyboard-shortcut first-keystroke="control alt ENTER" />
  </action>
  <action id="SwitchDown">
    <keyboard-shortcut first-keystroke="control alt DOWN" />
  </action>
  <action id="SwitchLeft">
    <keyboard-shortcut first-keystroke="control alt LEFT" />
  </action>
  <action id="SwitchRight">
    <keyboard-shortcut first-keystroke="control alt RIGHT" />
  </action>
  <action id="SwitchUp">
    <keyboard-shortcut first-keystroke="control alt UP" />
  </action>
</keymap>