使用 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 进行查看。

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