---
title: "idea个人使用备份"
author: "fatmind"
date: "2013-12-23T11:24:06Z"
tags: []
categories: ["开源软件"]
slug: "idea"
draft: false
lastmod: "2014-05-15T13:48:55Z"
id: 1977222
url: "https://fatmind.iteye.com/blog/1977222"
---

一、常用Tip

 

1\. 设置ingore files，不要展示在工程中

[http://stackoverflow.com/questions/14251624/intellij-idea-hide-iml-files](http://stackoverflow.com/questions/14251624/intellij-idea-hide-iml-files)

file -&gt; settings -&gt; file types : ingore files and folders

 

2\. remote debug

run -&gt; edit configrations -&gt; + remote 

 

3\. 打开某个视图

view -&gt; tool windowns -&gt; 具体视图名称

 

4\. 设置字体 & 文件编码

Settings &gt; Editor &gt; Colors & Fonts &gt; Font， 新建mFont，设置字体为 courire new，14，行间距 1.2

Settings &gt; file encodings ：设置 ide-encoding、project-encoding

 

3\. 快捷键

[http://www.cnblogs.com/tonycody/p/3257601.html](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 + &lt;-

\- forward : ctrl + alt + -&gt;  

- move caret to line start : alt + &lt;- （配合 ctrl + -&gt;/&lt;- 使用效果更佳）

- move caret to line end : alt + -&gt; 

\- find in path : ctrl + h 

\- rename : alt + shift + r （等同eclipse：ctrl + 2 -&gt; 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](http://www.oschina.net/question/12_70799)

 

二、待解决问题

 

1\. idea 如何支持 maven 父子工程的结构，比如：父工程更新pom，子工程能自动更新 ? 

setting -&gt; maven -&gt; importing -&gt; 勾选：import maven projects automatically 

 

2\. 如何保存文件是自动编译 ?

setting -&gt; compiler -&gt; 勾选：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.csdn.net/ouyang1738/article/details/8728448

e、修复文件打开方式：http://www.oschina.net/question/25621\_78109