Intellij idea Intellij IDEA中有标记折叠方法吗?
作为一个ex-vimmer,我希望基于注释内的标记创建持久折叠(例如,Intellij idea Intellij IDEA中有标记折叠方法吗?,intellij-idea,Intellij Idea,作为一个ex-vimmer,我希望基于注释内的标记创建持久折叠(例如,//Section blablabla{{{{,//End of blablabla}}})。Intellij IDEA中是否有此功能?Intellij支持此功能,尽管语法有点不同: //<editor-fold desc="Properties"> private String foo; private String bar; //</editor-fold> // 私人字符串foo; 私人弦杆;
//Section blablabla{{{{,//End of blablabla}}}
)。Intellij IDEA中是否有此功能?Intellij支持此功能,尽管语法有点不同:
//<editor-fold desc="Properties">
private String foo;
private String bar;
//</editor-fold>
//
私人字符串foo;
私人弦杆;
//
折叠区域时,将显示desc
属性的值。如果您愿意,也可以完全省略它
您可以使用环绕/编辑器折叠注释操作轻松环绕选定代码:
- ⌘+ALT+T(操作系统X)
- Control+ALT+T(Linux Windows)
来源和其他信息/屏幕截图:
- 最简单的语法可能是:
//region
...
all your code goes here
...
//endregion
您还可以在区域
部分给出说明:
//region Getters & Setters
...
all your code goes here
...
//endregion
+1,这看起来比我的解决方案好得多。然而,我想知道为什么在看起来如此干净的情况下,surround with仍然使用
语法…@BohuslavBurghardt我认为这是因为您的变体也适用于。它不是一个标准,但仍被更多的IDE:s使用。但我还是喜欢我展示的那个,我注意到它是文件类型相关的特性。它适用于java,但不适用于xml。