如何在 Notepad++ 中自动格式化/缩进 XML/HTML [英] How To Auto-Format / Indent XML/HTML in Notepad++
本文介绍了如何在 Notepad++ 中自动格式化/缩进 XML/HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法重新缩进一段代码?我正在 Eclipse 中寻找类似于 Ctrl+Shift+F 的东西(自动格式化/缩进).
Is there a way to re-indent a block of code? I'm looking for something similar to Ctrl+Shift+F in Eclipse (Auto-Format/Indent).
说清楚,
- 我已经知道如何在 Notepad++ 的外部格式化 XML(如前所述,Eclipse 工作正常)所以我不需要一堆指向其他 XML 格式化工具的链接.
- 我专门研究 XML 和 HTML.
- 理想情况下,有一个与 Eclipse 中一样方便的键绑定,所以我不必中断我的工作流程.
- I already know how to format XML outside of Notepad++ (Eclipse works fine, as mentioned) so I don't need a bunch of links to other XML-formatting tools.
- I'm specifically working with XML and HTML.
- Ideally, there's a keybinding as convenient as the one in Eclipse, so I don't have to break my workflow.
我已经知道 NppAutoIndent - 它不起作用,因为我正在处理 XML、HTML 和 CSS.
I already know about NppAutoIndent - it won't work, as I'm working with XML, HTML and CSS.
推荐答案
自从我升级到 6.3.2,我使用 XML Tools
.
Since I upgraded to 6.3.2, I use XML Tools
.
- 通过插件管理安装 XML 工具(插件 → 插件管理...然后搜索XML 工具",选中它的框并点击安装"按钮).
- 使用快捷键Ctrl+Alt+Shift+B(或菜单 → 插件 → XML 工具 → 漂亮打印)
- install XML Tools via the Plugin Admin (Plugins → Plugins Admin... Then search for "XML Tools", check its box and click the "Install" button).
- use the shortcut Ctrl+Alt+Shift+B (or menu → Plugins → XML Tools → Pretty Print)
在旧版本中:menu → TextFX → HTML Tidy → Tidy: Reindent XML.
In older versions: menu → TextFX → HTML Tidy → Tidy: Reindent XML.
这篇关于如何在 Notepad++ 中自动格式化/缩进 XML/HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文