Skip to content

Instantly share code, notes, and snippets.

@juanpabloaj
Last active June 10, 2017 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juanpabloaj/23307d7a65135f26a2a5272894a0576f to your computer and use it in GitHub Desktop.
Save juanpabloaj/23307d7a65135f26a2a5272894a0576f to your computer and use it in GitHub Desktop.
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