Code removal comments Remove Comments, Join Lines, code compression Minify and other vscode functions

1. Remove comments

  1. Extension via vscode store Remove Comments Remove comments.

Just copy-pasted some code from somewhere and it’s obscenely documented with unnecessary comments everywhere? Remove Comments will help you undocument the code and remove all the comments present in the code by doing the job for you.

  • Ansou
    Left side Exhibition: Shop Search inside Remove Comments 并Point击 Anso.
    Insert image description here
  • Use
    to open the specified page, keyboardctrl+shfit+p to open the command line, search a>Remove All Comments and select Enter to remove comments on the specified page.
    Insert image description here
    Note: This function currently supports comment removal in more than 60 languages. Inline comments // and multi-line comments /* */ will be completely deleted.

  1. Delete by regular matching
  • ctrl+h Open the replacement function box, select [.*] For regular matching, enter < /span>^\s*(?=\r?$)\n, when matching comments, can be replaced individually or globally.
    Insert image description here

2. Join Lines

Join Lines is one of the functions provided by vscode, which can directly merge specified codes into one line.

  • Use
    Select the specified area code with the mouse cursor or keyboardctrl+a Select all codes, keyboard ctrl+shfit+p Open the command line, search Join Lines and return You can combine the specified code into one line.
    Insert image description here
    Note: Be sure to remove the inline comments// before merging a line, otherwise the code will be commented! ! !

3. Minify code compression

Extended through vscode store Minify Compress code, support html, css, js compression.

Minify your js, css and html files to save transmit bandwidth.

  • Ansou
    Left side Exhibition: Shop Search inside Minify并Point击Anso.
    Insert image description here
  • use
    Need to reload after installation, select the specified file, keyboard F1 when the command line appears, select Minify and press Enter.
    Insert image description here
    The min.js file will be automatically generated as a result, and you can re-cite it for debugging.
    Insert image description here

Guess you like

Origin blog.csdn.net/wzp20092009/article/details/134877476