使用 Intellij IDEA 時摺疊代碼

Intellij IDEA中摺疊代碼的方式,如下:

1. 針對類、方法的摺疊

快捷鍵: ctrl + -ctrl + + 適用於擴展

2. 自定義摺疊

自定義摺疊有兩種類型,分別爲visual studio stylenetbeans 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 進行查看。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章