在IntelliJ IDEA中不仅可以对类、方法等结构的代码进行折叠(ctrl+-)还可以自定义折叠代码。IntelliJ IDEA支持两种风格的自定义代码折叠,如下:

visual studio style

//region Description    
Your code goes here...    
//endregion  

netbeans style

// <editor-fold desc="Description">    
Your code goes here...    
// </editor-fold> 

你可以直接手写,也可以使用快捷键实现对一段代码的自定义折叠,快捷键为:ctrl+alt+t

如图:

IntelliJ IDEA #region 代码折叠

相关文章:

  • 2021-08-22
  • 2022-12-23
  • 2022-01-17
  • 2021-12-08
  • 2021-07-21
  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
猜你喜欢
  • 2021-11-17
  • 2022-01-10
  • 2021-09-24
  • 2022-12-23
  • 2022-12-23
  • 2021-06-26
  • 2022-02-22
相关资源
相似解决方案