Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
460 views
in Technique[技术] by (71.8m points)

html - 如何在Notepad ++中自动设置格式/缩进XML / HTML(How To Auto-Format / Indent XML/HTML in Notepad++)

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).

(我正在寻找类似于Eclipse中的Ctrl + Shift + F (自动格式化/缩进)的东西。)

To be clear,

(要清楚一点)

  • 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.

    (我已经知道如何 Notepad ++ 之外格式化XML(如上所述,Eclipse可以很好地工作),因此我不需要一堆指向其他XML格式化工具的链接。)

  • I'm specifically working with XML and HTML.

    (我专门处理XML和HTML。)

  • Ideally, there's a keybinding as convenient as the one in Eclipse, so I don't have to break my workflow.

    (理想情况下,键绑定与Eclipse中的键绑定一样方便,因此我不必中断工作流程。)

I already know about NppAutoIndent - it won't work, as I'm working with XML, HTML and CSS.

(我已经知道NppAutoIndent了-它不能工作,因为我正在使用XML,HTML和CSS。)

  ask by SBoss translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Since I upgraded to 6.3.2, I use XML Tools .

(自从我升级到6.3.2之后,我就使用XML Tools 。)

  • install XML Tools via the Plugin Manager.

    (通过插件管理器安装XML工具。)

  • use the shortcut Ctrl + Alt + Shift + B ( or menu -> Plugins -> XML Tools -> Pretty Print)

    (使用快捷键Ctrl + Alt + Shift + B菜单->插件-> XML工具->漂亮打印))

In older versions: menu -> TextFX -> HTML Tidy -> Tidy: Reindent XML.

(在旧版本中:菜单-> TextFX-> HTML Tidy-> Tidy:重新插入XML。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...