Formatting code in Notepad++

后端 未结 14 1702
无人及你
无人及你 2020-11-29 17:05

Is there a keyboard shortcut to format code in Notepad++ ?
I\'m mainly working with HTML, CSS and Python code.

For example:



        
相关标签:
14条回答
  • 2020-11-29 17:41

    For JavaScript Formatting I use Notepad ++ JSMin Plugin.Quite Handy

    0 讨论(0)
  • 2020-11-29 17:43

    In Plugins > Plugin Admin > Search 'XML Tools' > Install.

    The window will restart and install XML Tools under plugins.

    Open your file and click Ctrl + Alt + Shift + B

    0 讨论(0)
  • 2020-11-29 17:45

    NPP+ v7.9.1 with the latest version of XMLTools can't format exported VBA code from Office 2016/2019 Word. It puts all the code on the same line since it strips the CRLF out. Moreover, when you enable "auto validation" it errors out on the first VBA line that is, Attribute VB_Name = "The VBA module name". So any of the xml tool validations apparently can't be used for VBA validation.

    0 讨论(0)
  • 2020-11-29 17:46

    No. Notepad++ can't format by itself. Formatting can easily be accomplished in many IDEs like Eclipse, NetBeans, Visual Studio [Code].

    0 讨论(0)
  • 2020-11-29 17:48

    If all you need is alignment, try the plugin called Code Alignment.

    You can get it from the built-in plugin manager in Notepad++.

    0 讨论(0)
  • 2020-11-29 17:52

    The latest plugin is tidy2, which can be installed through Plugins>Plugin Manager>Show Plugin Manager.

    I suggest editing config 1 and setting quote-marks: no, especially if you have script that makes use of quotes.

    Also, tidying more than once can result in inserting ampersands the first time and then replacing the ampersands the second time. You may want to play with the config to get it to where you need it.

    0 讨论(0)
提交回复
热议问题