您的位置:首页 > 其它

mac idea 常用快捷键和设置

2015-09-07 11:48 806 查看

常用的快捷键

代码补全Ctrl + space
删除行Command + D
注释Command + /
导入包Command + shift + O
格式化代码Command + shift + F
运行Ctrl + Alt + R
Incremental SearchCommand + J 在编辑器中实现快速查找功能,通过上下箭头进行上下文搜索
Quick Definition Command + Y 它会弹窗显示建议列表中的方法定义的内容,如果你不确定要使用哪个方法
Find NextCommand + K
Find PreviousCommand + shift + K
详细方法、类Ctrl + 点击类名、方法
Ctrl+Alt+ left/right 返回至上次浏览的位置
Command + F12 类似eclipse 的ctrl + O的功能outline

调整界面为酷酷的黑色

Preferences=>Appearance=>theme=>Darcula

设置快捷键:

Preferences=>keymaps

自动补全:

Mac下默认是clt+space,可以使用keymaps=>Main menu=>Code=>Competion设置。比Eclipse好的地方是Spring、Maven的xml,乃至freemarker模板以及iBatis的sqlmap都支持高亮和自动补全。

去除自动补全的大小写敏感:

不知道多少童鞋和我一样被Eclipse惯坏了,使用自动补全完全不注意大小写的,IntelliJ默认区分大小写,很是让人难过。不过在Editor=>Code Completion里把Case sensitive completion设置为None就可以了。

自动展开目录

Eclipse有个打开文件就自动展开目录的功能,在IntelliJ里从Project左边栏的齿轮上选择Autoscroll to Source和Autoscroll from Source都勾选上即可。

自动编译

IntelliJ默认是不会自动编译项目的,所以在run之前会有个make的过程,习惯自动编译项目的可以在这里打开:Compiler=>make project automatically。因为IntelliJ项目空间不大,所以开启之后也不会像Eclipse一样出现build workspace很久的情况。

另外一个 intelliJ 的快捷键 http://www.ituring.com.cn/article/37792
Eclipse 和 intellij的快捷键对照表

Eclipse IntelliJ IDEA Description
F4 ctrl+h show the type hierarchy
ctrl+alt+g ctrl+alt+F7 find usages
ctrl+shift+u ctrl+f7 finds the usages in the same file
alt+shift+r shift+F6 rename
ctrl+shift+r ctrl+shift+N find file / open resource
ctrl+shift+x, j ctrl+shift+F10 run (java program)
ctrl+shift+o ctrl+alt+o organize imports
ctrl+o ctrl+F12 show current file structure / outline
ctrl+shift+m ctrl+alt+V create local variable refactoring
syso ctrl+space sout ctrj+j System.out.println(“”)
alt + up/down ctrl + shift + up/down move lines
ctrl + d ctrl + y delete current line
??? alt + h show subversion history
ctrl + h ctrl + shift + f search (find in path)
“semi” set in window-> preferences ctrl + shift + enter if I want to add the semi-colon at the end of a statement
ctrl + 1 or ctrl + shift + l ctrl + alt + v introduce local variable
alt + shift + s alt + insert generate getters / setters
ctrl + shift + f ctrl + alt + l format code
ctrl + y ctrl + shift + z redo
ctrl + shift + c ctrl + / comment out lines (my own IDEA shortcut definition for comment/uncomment on german keyboard layout on laptop: ctrl + shift + y)
ctrl + alt + h ctrl + alt + h (same!) show call hierarchy
none ? ctrl + alt + f7 to jump to one of the callers of a method
ctrl + shift + i alt + f8 evaluate expression (in debugger)
F3 ctrl + b go to declaration (e.g. go to method)
refer http://www.catalysts.cc/en/wissenswertes/intellij-idea-and-eclipse-shortcuts/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: