Home  >  Article  >  Development Tools  >  Implement automatic code typesetting in notepad++ (calling Astyle)

Implement automatic code typesetting in notepad++ (calling Astyle)

藏色散人
藏色散人forward
2021-02-24 16:40:045807browse

The following tutorial column of notepad will introduce to you how to realize automatic code typesetting (calling Astyle) in notepad. I hope it will be helpful to friends who need it!

I will first introduce how to call the original astyle in notepad.

In notepad: Run or F5,

##Select the directory where astyle.exe is located in the input box, Why don’t you have astyle? The download address is https://files.cnblogs.com/files/libra13179/AStyle_2.06_windows.zip. For introduction, help and download of Astyle, please refer to its official website: http://astyle.sourceforge.net /. It is recommended that the decompression path should not be in Chinese.

After selecting the path,

My installation path

E:\AStyle_2.06_windows\AStyle\bin\AStyle.exe

Add some parameters to the path of the input box command you just ran:

E:\AStyle_2.06_windows\AStyle\bin\AStyle.exe --style= ansi -S -N -n "$(FULL_CURRENT_PATH)" "$(FULL_CURRENT_PATH)"

[Remarks]

--style=ansi -S -N -nSet the layout format parameters for astyle. You can modify them according to your own situationClick save,

Just give it a name, for example, astyle, and you can also customize the shortcut keys according to your own needs!

If you want to modify it later, you can modify it yourself in the shortcut key management

Finally, "Settings"-> "Preferences"->"Others", check automatic updates, and that's it. You're done.

Okay, let's test it Deliberately messing up the code layout

Run the shortcut you just set

After automatic sorting

The above is the detailed content of Implement automatic code typesetting in notepad++ (calling Astyle). For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete