your programing

메모장 ++에서 자동 서식 / 들여 쓰기 XML / HTML 방법

lovepro 2020. 10. 3. 11:22
반응형

메모장 ++에서 자동 서식 / 들여 쓰기 XML / HTML 방법


코드 블록을 다시 들여 쓰는 방법이 있습니까? Eclipse에서 Ctrl+ Shift+ F(자동 서식 / 들여 쓰기) 와 유사한 것을 찾고 있습니다.

확실하게,

  • Notepad ++ 외부 에서 XML 형식을 지정하는 방법을 이미 알고 있으므로 (Eclipse는 언급했듯이 잘 작동합니다) 다른 XML 형식 지정 도구에 대한 링크가 필요하지 않습니다.
  • 저는 특별히 XML과 HTML로 작업하고 있습니다.
  • 이상적으로는 Eclipse의 키 바인딩만큼 편리한 키 바인딩이 있으므로 워크 플로우를 중단 할 필요가 없습니다.

이미 NppAutoIndent에 대해 알고 있습니다. XML, HTML 및 CSS로 작업하고 있기 때문에 작동하지 않습니다.


6.3.2로 업그레이드했기 때문에 XML Tools.

  • 플러그인 관리자를 통해 XML 도구를 설치합니다.
  • 단축키 Ctrl+ Alt+ Shift+ 사용 B( 또는 메뉴-> 플러그인-> XML 도구-> Pretty Print)

이전 버전 : 메뉴-> TextFX-> HTML Tidy-> Tidy : XML 다시 들여 쓰기.


Tidy2 플러그인을 설치합니다. 메모장 ++ v6.2.2가 있고 Tidy2는 지금까지 잘 작동합니다.


모르는 사람들을 위해 npp는 플러그인 및 기타 프로젝트에서 많은 지원을 제공합니다. 이러한 플러그인은 SourceForge 에서 다운로드 할 수 있습니다 .

여기에 이미지 설명 입력

XML Toolsn ++로 텍스트 서식을 지정 해야 합니다.

다운로드 후 XML Tools..

메모장 종료 ++

이동 C:\Program File\Notepad++.... N ++ 설치 폴더.

  1. npp 루트 폴더에 다운로드 한 xml 도구의 파일 아래에 배치하십시오. copy replace

여기에 이미지 설명 입력

  1. ..\Plugins하위 폴더로 이동 하여 다운로드 한 파일 아래에 배치

여기에 이미지 설명 입력

다시 시작하고 즐기십시오 !!!

Ctrl + Alt + Shft + B to format.


It's been the third time that I install Windows and npp and after some time I realize the tidy function no longer work. So I google for a solution, come to this thread, then with the help of few more so threads I finally fix it. I'll put a summary of all my actions once and for all.

  1. Install TextFX plugin: Plugins -> Plugin Manager -> Show Plugin Manager. Select TextFX Characters and install. After a restart of npp, the menu 'TextFX' should be visible. (credits: @remipod).

  2. Install libtidy.dll by pasting the Config folder from an old npp package: Follow instructions in this answer.

  3. After having a Config folder in your latest npp installation destination (typically C:\Program Files (x86)\Notepad++\plugins), npp needs write access to that folder. Right click Config folder -> Properties -> Security tab -> select Users, click Edit -> check Full control to allow read/write access. Note that you need administrator privileges to do that.

  4. Restart npp and verify TextFX -> TextFX HTML Tidy -> Tidy: Reindent XML works.


I had to update the proxy settings under Plugins -> Plugin Manager -> Show Plugin Manager -> Settings to see any PlugIns in the "Available" list.

After that, installing "XML Tools" was easy and did the requested job as described above.


Notepad ++ doesn't provide any such feature by default. But you can use some online tools to autoformat text like https://www.freeformatter.com/xml-formatter.html .

It helps. :)


To directly answer the OP, take a look at this guy's site: Thomas Hunter Notepad++ Tidy for XML. Simple steps to follow and you get very nice formatting of your XML right inside NPP. So far the only anomaly I've found is with nested self closing elements EG:

<OuterTag>Text for outer element<SelfClosingTag/></OuterTag>

Will be tidied up to:

<OuterTag>Text for outer element
<SelfClosingTag/></OuterTag>

There may be a way to fix this, but for the time being, it's managed to reduce the number of lines in my document by 300k and this particular anomaly can be worked around.


"Plugin Admin"과 함께 Notepad 7.6을 사용하고 있는데 XML 도구를 찾을 수 없습니다. 내 플러그인 폴더가 여기에 있다는 점을 제외하고
@ some-java-guy가 대답 한 것처럼 수동으로 설치해야했습니다 C:\Users\<my username>\AppData\Local\Notepad++\plugins
. 그 디렉토리에 XmlTools라는 새 디렉토리를 만들고 거기에 XMLTools.dll을 복사했습니다. (그리고 모든 종속성을 프로그램 파일의 Notepad ++ 디렉토리에 복사했습니다.)

참고 URL : https://stackoverflow.com/questions/7117949/how-to-auto-format-indent-xml-html-in-notepad

반응형