First you have to install a editplus, and then download the Xxxformatter.js file you want to format, which is what the internet says Edtools
1. Found in your tool--Configure the Customization tool in the following ways:
5th Step command: Cscript/nologo "D:\Editplus5\editplus-tools\jsFormatter.js"
The red part is the format file address
2 Test (CTRL+1)
Issue record 1:
Ctrl+1 When the time came scripting engine with no file extension "JS"
There are two kinds of problem situations:
1. Modify the Registration Form
Method One: Open the Registry Editor and locate "HKEY_CLASSES_ROOT" > ". js", double-click the default value to change the value data to "Jsfile".
Method Two: Create a reg file prompt without the. js engine problem. Reg Content save Run as follows:
Windows Registry Editor Version5.00[hkey_classes_root\.js]@="Jsfile""Content Type"="Text/plain""PerceivedType"="text"[Hkey_classes_root\.js\openwithprogids]"VisualStudio.js.b2b43195"=""
2. Incorrect configuration tool or incorrect format file will also prompt no file extension JS
Issue record 2:
After formatting the Chinese garbled Check tool after the encoding format is UTF-8 or garbled solution is as follows:
//Author:smoker//Initialization OptionsvarIndent_size =1;//indent the number of spaces, 1 when using tab indentvarIndent_char =' ';//Indent charactersvarPreserve_newlines =false;//whether to leave blank lines, not reserved by default//program Startvarinput ="";/*While (! WScript.StdIn.AtEndOfStream) {input + = WScript.StdIn.ReadAll ();} if (indent_size = = 1) {Indent_char = ' \ t ';} var js_source = input.replace (/^\s+/, '); var formated_code= '; if (Js_source && js_source[0]!== ' < ') { Formated_code =js_beautify (Js_source, {indent_size:indent_size, Indent_char:indent_char, Preserve_newlines: Preserve_newlines}); }if (!formated_code.length==0) WScript.Echo (Formated_code); else WScript.Echo (' Was you sure your input is JavaScript s Ource file? ');*///unregisters the original read-in mode (ASCII read-in). Set UTF-8 encoding via ADODB.stream.varargs =wscript.arguments;varfilepath = args (0);//Resolving whitespace issuesif(args!=NULL&&args.length>1){ varFileelments = []; for(varI=0; i<args.length;i++) {Fileelments.push (args (i)); } filepath= Fileelments.join (" ");}//WScript.Echo (filepath);if(filepath!=NULL&&filepath!=""){ varstream =NewActiveXObject ("ADODB. Stream"); Stream. Mode=3;//Common values 1: Read, 2: Write, 3: Read and writeStream. Type =2;//1: Binary, 2: text (default)Stream. Charset ='UTF-8';//specifying the encoding UTF-8Stream. Open (); Stream. LoadFromFile (filepath); Input= Stream. ReadText (-1);//Read all contentStream. Close (); if(Indent_size = =1) {Indent_char='\ t'; } varJs_source = Input.replace (/^\s+/,"'); varFormated_code ="'; if(Js_source && js_source[0] !=='<') {Formated_code=js_beautify (Js_source, {indent_size:indent_size, Indent_char:indent_char, Preserve_newlines:preserve_newlines }); } formated_code.length? WScript.Echo (Formated_code): WScript.Echo ('sure your input is JS source file?');} .................................... To omit ... or to be a "."
The main thing is to unregister the original read-in mode (ASCII code read). Set UTF-8 encoding by ADODB.stream. The read-in method calls the js_beautify format code.
The above is the JS format example, Html, CSS and so on are the same way
EditPlus formatting HTML JS CSS