Intellij IDEA
中摺疊代碼的方式,如下:
1. 針對類、方法的摺疊
快捷鍵: ctrl
+ -
,ctrl
+ +
適用於擴展
2. 自定義摺疊
自定義摺疊有兩種類型,分別爲visual studio style
和netbeans style
。在摺疊標識上,可以使用1中的快捷鍵進行快速摺疊或展開。
a. vistual studio style
// region description
here is your logical code
// endregion
b. netbeans style
// <editor-fold description="">
here is your logical code
// </editor-fold>
另外,可以採用快捷鍵快速在摺疊的地方進行跳轉。具體的快捷鍵可能設置的會不同,可以使用ctrl
+ shift
+ A
搜索custom folding
進行查看。