Tidy CSS for Notepad++

后端 未结 4 1705
终归单人心
终归单人心 2021-02-03 10:34

Is there some kind of CSS tidy available for Notepad++. I have tried what seems to be every menu item in TEXTFX but none seem to do it. I am used to using PSPAD where you just s

4条回答
  •  有刺的猬
    2021-02-03 10:39

    I was looking for this functionality myself, so I wrote this pair of regex search-and-replace based macros for Notepad++. Format CSS formats a CSS document while Minify CSS makes it smaller.

    To install them, locate your shortcuts.xml file, usually at

    C:\Users\%username%\AppData\Roaming\Notepad++\shortcuts.xml

    and paste the whole block into the block.

    You need to use another editor than Notepad++, OR close Notepad++ by killing the process after you edit this file. Otherwise, Notepad++ will overwrite the file on close.

    After installing, you can run those macros from the Macros menu in Notepad++, as well as rename them or assign hotkeys using Edit shortcut/delete macro.

    In case someone finds a css for which this script doesn't work, please make a paste and post the link in the comments so I can look at it.

    Macro source XML

    
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
    
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
    
    

提交回复
热议问题