Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
attrToJson.vim
" usage:
" :AttrToJson
fun! AttrToJson()
execute '%s:\t: :'
execute '%s:;:,:'
execute '%s: =:\::'
execute '%s:\([A-z]\+\) {:\1\: {:'
execute '%s:\([A-z]\+\)\::"\1"\::'
execute '%s:,\(\n\s*\)}:\1},:'
execute '%s:},\(\n\s*\)}:}\1}:'
execute '%s:}\(\n\s*"[A-z]\):},\1:'
execute '%s:TV-\([0-9]\+\)\/\([0-9]\+\)\/\([0-9]\+\)_\([0-9]\+\)\:\([0-9]\+\)\:\([0-9]\+\):"\1-\2-\3T\4\:\5\:\6.000Z"'
endf
command! -nargs=0 AttrToJson call AttrToJson()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment