| 태그 'Code Beautifier'에 해당되는 글 1건 |
| EditPlus3에서 astyle 적용하기 |
Tech - https://ohyung.net/585 (YMD: 09/02/04 00:10)
Editplus3에서 Code Beautifier 혹은 Source Beautifier 를 사용하는 방법...

Code Beautifier란... 소스코드를 보기 좋게 정렬 시켜주는 프로그램등을 말한다.
물론 vi 에서 블럭 설정후 = 키를 누른다던가, 리눅스 상에서 indent 명령을 쳐도 된다.
비쥬얼 스튜디오가 없고, Code::Blocks등이 없을 경우에도 해당된다.

이건 순전히 메모장 코딩을 좋아하기 때문에 하는 뻘짓거리 ㅋㅋ

난 개인적으로 ANSI 스타일을 좋아한다... 여기에 tab은 항상 4이다;
들여쓰기 스타일 : http://en.wikipedia.org/wiki/Indent_style 


일단 UniversalIndentGUI를 다운 받고 푼뒤 실행시킨다.
http://universalindent.sourceforge.net/index.php 


그뒤 왼쪽메뉴에서 indenter를 고른뒤 ( 난 Astyle을 골랐다; ) 하위 메뉴들을 변경해 가면서 보기 좋은 스타일을 고른다. ( 이때 최초 제공되는 문서를 보면서 작업하면 괜찮다. )

다 설정이 되었다면 identer 메뉴에서 Create Identer Call Shell Script를 골라 bat 파일을 생성한다. ( 이 배치 파일로 실행도 가능하다... ex)...bat 소스파일 등;;;)

하지만 난 EditPlus3에서 쓸거기 때문에...
"프로그램을 푼 디렉토리/UniversalIndentGUI_win32/indenters/.astylerc "
파일을 찾아 옵션을 모은다..

그뒤 EditPlus3 메뉴의 "도구 - 사용자 도구 구성"을 눌러

추가 -> 프로그램을 한뒤

명령에 astyle.exe 파일 ( "프로그램을 푼 디렉토리/UniversalIndentGUI_win32/indenters/astyle.exe" )을 찾아 넣고
인수에
$(FilePath) -y --indent-classes --indent-switches --indent-cases --indent-namespaces --pad=oper --unpad=paren --convert-tabs --force-indent=tab=4 --brackets=break --break-elseifs --one-line=keep-statements --one-line=keep-blocks --indent=tab=4 --brackets=break

--style=gnu

같이 "프로그램을 푼 디렉토리/UniversalIndentGUI_win32/indenters/.astylerc "에서 모은 옵션들을 써준다.

그러면 끝!

주의
Astyle의 타겟인 소스파일은 디렉토리가 한글일경우 되지 않는다;


참고.
Artistic Style 1.22은 http://astyle.sourceforge.net/  에서도 다운 가능하다. ( exe 파일 단독 실행 가능하다. )
프로그램만 받고 어딘가에 적어둔 인수만 EditPlus에 가져다 써도 된다. ㅋ
| 이 포스트에 대한 이용규약 |
Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시 2.0 라이센스 에 따라 이용하실 수 있습니다.
This work is licensed under a Creative Commons Attribution 2.0 Korea LicenseLink in a new window.

| 이 글과 태그로 연관된 글 |

| 트랙백 |
트랙백 주소 :: https://www.ohyung.net/rserver.php?mode=tb&sl=585