Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple re-format for minified Javascript for VIM
" 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
@barry1955

This comment has been minimized.

Show comment
Hide comment
@barry1955

barry1955 Nov 3, 2016

Fantastic!! Thanks

Fantastic!! Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment