如何使用键盘快捷键在 Intellij-IDEA 中显示(展开)隐藏(折叠)的代码? [英] How to show(unfold) the hidden(folded) code in Intellij-IDEA with keyboard shortcut?
问题描述
如何在 IntelliJ IDEA 中显示(展开)隐藏(折叠)的代码,如下图所示,只使用键盘而不触摸鼠标?
How can I show(unfold) the hidden(folded) code in IntelliJ IDEA, as shown in the picture below, just using keyboard without touching the mouse?
推荐答案
在 IntelliJ IDEA 中,您可以使用以下快捷方式折叠/展开代码块:
In IntelliJ IDEA you can use to following shortcuts to fold/unfold code blocks:
- 要折叠和展开 当前选定的代码块:
- CTRL+- 和 CTRL++ 在 Windows 上;
- ⌘ CMD+- 和 ⌘ CMD++ 在 Mac 上;
- To fold and unfold CURRENT selected block of code:
- CTRL+- and CTRL++ on Windows;
- ⌘ CMD+- and ⌘ CMD++ on Mac;
- CTRL+⇧ SHIFT+- 和 CTRL+⇧ SHIFT++ 在 Windows 上
- ⌘ CMD+⇧ SHIFT+- 和 ⌘ CMD+⇧ SHIFT++ 在 Mac 上.
- CTRL+⇧ SHIFT+- and CTRL+⇧ SHIFT++ on Windows
- ⌘ CMD+⇧ SHIFT+- and ⌘ CMD+⇧ SHIFT++ on Mac.
顺便说一下,在设置→编辑器→常规→代码折叠中,您可以为各种情况指定默认折叠行为(例如,imports、one-line 方法、内部类、@SuppressWarnings注解、数组字面量、泛型构造函数等等其他):
By the way, in Settings → Editor → General → Code Folding you can specify the default folding behavior for a various situations (e.g., imports, one-line methods, inner classes, @SuppressWarnings annotations, array literals, generic constructors and many others):
即使在那之后,您上面列出的折叠/展开热键也能正常工作.
And even after that your folding/unfolding hotkeys listed above will work as well.
这篇关于如何使用键盘快捷键在 Intellij-IDEA 中显示(展开)隐藏(折叠)的代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!