一、常用Tip
1. 设置ingore files,不要展示在工程中
http://stackoverflow.com/questions/14251624/intellij-idea-hide-iml-files
file -> settings -> file types : ingore files and folders
2. remote debug
run -> edit configrations -> + remote
3. 打开某个视图
view -> tool windowns -> 具体视图名称
4. 设置字体 & 文件编码
Settings > Editor > Colors & Fonts > Font, 新建mFont,设置字体为 courire new,14,行间距 1.2
Settings > file encodings :设置 ide-encoding、project-encoding
3. 快捷键
http://www.cnblogs.com/tonycody/p/3257601.html
福音:idea支持eclipse快捷键的组合,意味着完全可以接着使用已经习惯的eclipse的快捷键.
- go to class : ctrl + shift + t
- file structure : ctrl + o (快速打开方法)
- go to file : ctrl + shift + r
- implements : ctrl + t
- call hierarchy : ctrl + alt + h
- find : ctrl + f
- ctrl + r : 当前文本批量替换 (eclipse : ctrl + 2)
- smart code complete : alt + /
- quick documentation : f2
- alt + insert : generate code (setter/getter, ovvride etc)
- format code : ctrl + shift + f
- back : ctrl + alt + <-
- forward : ctrl + alt + ->
- move caret to line start : alt + <- (配合 ctrl + ->/<- 使用效果更佳)
- move caret to line end : alt + ->
- find in path : ctrl + h
- rename : alt + shift + r (等同eclipse:ctrl + 2 -> r )
- optimize import : ctrl + alt + o
快速打开设置界面:atrl + alt + s
3. remote debug 无法debug到代码
当以maven project方式导入,存在多个子工程时,debug config ‘search sources from module classpath’ 必须选择父工程.
4. 代码补全
http://www.oschina.net/question/12_70799
二、待解决问题
1. idea 如何支持 maven 父子工程的结构,比如:父工程更新pom,子工程能自动更新 ?
setting -> maven -> importing -> 勾选:import maven projects automatically
2. 如何保存文件是自动编译 ?
setting -> compiler -> 勾选:make project automatically
3. 琐碎点:
a、如何快速导入maven工程 ? 在maven_project视图下,点 '+' 找到根pom.xml,确认即可
b、如何删除module ? 在maven_project视图下,右键 remove projects
c、如何执行unit测试 ? idea很多功能是基于plugin,必须开启junit plugin后,即可执行
d、plugin如何安装:http://blog.youkuaiyun.com/ouyang1738/article/details/8728448
e、修复文件打开方式:http://www.oschina.net/question/25621_78109