Created
April 30, 2015 16:39
-
-
Save timtyrrell/0640d02bd08cd54f739a to your computer and use it in GitHub Desktop.
Simple re-format for minified Javascript for VIM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Simple re-format for minified Javascript | |
command! UnMinify call UnMinify() | |
function! UnMinify() | |
%s/{\ze[^\r\n]/{\r/g | |
%s/){/) {/g | |
%s/};\?\ze[^\r\n]/\0\r/g | |
%s/;\ze[^\r\n]/;\r/g | |
%s/[^\s]\zs[=&|]\+\ze[^\s]/ \0 /g | |
normal ggVG= | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fantastic!! Thanks