# 32. IntelliJ IDEA 常用细节 -1

## 说明

IntelliJ IDEA 有很多人性化的设置我们必须单独拿出来讲解，也因为这些人性化的设置让我们这些 IntelliJ IDEA 死忠粉更加死心塌地使用它和分享它。

## 常用设置

![常用设置](https://github.com/einverne/intellij-idea-tutorial/tree/78789f5efb4007ce43e451beacc4e724db0dc3b7/images/xxvi-a-settings-introduce-2.gif)

* 如上图 Gif 所示，该功能用来快速设置代码检查等级。我个人一般在编辑大文件的时候会使用该功能。IntelliJ IDEA 对于编辑大文件并没有太大优势，很卡，原因就是它有各种检查，这样是非常耗内存和 CPU 的，所以为了能加快大文件的读写，我一般会暂时性设置为 `None`。
* `Inspections` 为最高等级检查，可以检查单词拼写，语法错误，变量使用，方法之间调用等。
* `Syntax` 可以检查单词拼写，简单语法错误。
* `None` 不设置检查。

![常用设置](https://github.com/einverne/intellij-idea-tutorial/tree/78789f5efb4007ce43e451beacc4e724db0dc3b7/images/xxvi-a-settings-introduce-4.jpg)

* 如上图标注 1 所示，当我们 Java 类中导入的某个包下类超过这里设置的指定个数，就会换成用 `*` 号来代替。

![常用设置](https://github.com/einverne/intellij-idea-tutorial/tree/78789f5efb4007ce43e451beacc4e724db0dc3b7/images/xxvi-a-settings-introduce-6.jpg)

* 如上图标注 1 所示，IntelliJ IDEA 有一种叫做 `省电模式` 的状态，开启这种模式之后 IntelliJ IDEA 会关掉代码检查和代码提示等功能。所以一般我也会认为这是一种 `阅读模式`，如果你在开发过程中遇到突然代码文件不能进行检查和提示可以来看看这里是否有开启该功能。

![常用设置](https://github.com/einverne/intellij-idea-tutorial/tree/78789f5efb4007ce43e451beacc4e724db0dc3b7/images/xxvi-a-settings-introduce-7.gif)

* 如上图 Gif 所示，在我们按 `Ctrl + Shift + N` 进行打开某个文件的时候，我们可以直接定位到该文件的行数上。一般我们在调 CSS，根据控制台找空指针异常的时候，使用该方法速度都会相对高一点。

![常用设置](https://github.com/einverne/intellij-idea-tutorial/tree/78789f5efb4007ce43e451beacc4e724db0dc3b7/images/xxvi-a-settings-introduce-10.jpg)

* 如上图箭头所示，IntelliJ IDEA 默认是开启单词拼写检查的，有些人可能有强迫症不喜欢看到单词下面有波浪线，就可以去掉该勾选。但是我个人建议这个还是不要关闭，因为拼写检查是一个很好的功能，当大家的命名都是标准话的时候，这可以在不时方便地帮我们找到代码因为拼写错误引起的 Bug。

![常用设置](https://github.com/einverne/intellij-idea-tutorial/tree/78789f5efb4007ce43e451beacc4e724db0dc3b7/images/xxvi-a-settings-introduce-11.gif)

* 如上图 Gif 所示，我们可以对组件窗口的子窗口进行拖动移位，有时候设置过头或是效果不满意，那我们需要点击此按钮进行窗口还原。

![常用设置](https://github.com/einverne/intellij-idea-tutorial/tree/78789f5efb4007ce43e451beacc4e724db0dc3b7/images/xxvi-a-settings-introduce-13.gif)

* 如上图 Gif 所示，默认 `Ctrl + 空格` 快捷键是基础代码提示、补充快捷键，但是由于我们中文系统基本这个快捷键都被输入法占用了，所以我们发现不管怎么按都是没有提示代码效果的，原因就是在此。我个人建议修改此快捷键为 `Ctrl + 逗号`。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://einverne.gitbook.io/intellij-idea-tutorial/settings-introduce-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
