xml Notepad++ 默认折叠所有标签?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10462207/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-06 13:28:46  来源:igfitidea点击:

Notepad++ fold all tags by default?

xmlnotepad++folding

提问by Bugster

I have a huge XML code that I keep adding to. It has about 13.465 lines of code, and a LOT of tags. To keep everything organised (Because, the code is almost unreadable), I decided I could just fold all my tags and comment as to what they are.

我有一个巨大的 XML 代码,我一直在添加。它有大约 13.465 行代码和大量标签。为了保持一切井井有条(因为代码几乎不可读),我决定我可以折叠所有标签并评论它们是什么。

Is there any way to achieve this every time I open Notepad++ without having to use the "Fold all" option?? I'm using notepad++ windows XP, and XML.

每次打开 Notepad++ 时,有没有什么方法可以实现这一点,而不必使用“全部折叠”选项?我正在使用记事本++ Windows XP 和 XML。

回答by prrao

There is a way to define a user-defined languagefor you to tell Notepad++ to fold tabs by default.

有一种方法可以定义用户定义的语言,让您告诉 Notepad++ 默认折叠选项卡。

This is an unnecessary procedure however, since you can very quicklyfold tabs without having to specially create a user-defined language each time you have a large, clunky xml file.

然而,这是一个不必要的过程,因为您可以非常快速地折叠选项卡,而不必在每次拥有一个大而笨重的 xml 文件时专门创建用户定义的语言。

Use the shortcuts Alt+4and then Alt+3...... Alt+1to fold your xmltags in a sequence, depending on the depth you want to fold to. To expand only a particular level once again, just Ctrl-click the +sign next to the tag you want to expand. This is the best way to view large blocks of anycode in Notepad++, and avoids having to spend a lot of time configuring a special style for each language. Once your tabs are folded to the desired depth, you can insert comments where required. Few steps, easy results.

使用快捷键Alt+4然后Alt+ 3...... Alt+1xml顺序折叠标签,具体取决于要折叠到的深度。要再次仅展开特定级别,只需Ctrl单击+要展开的标签旁边的标志。这是在 Notepad++ 中查看大块任何代码的最佳方式,并且避免了必须花费大量时间为每种语言配置特殊样式。一旦您的标签折叠到所需的深度,您就可以在需要的地方插入注释。几步,轻松出结果。