Last active
June 10, 2017 17:31
-
-
Save juanpabloaj/23307d7a65135f26a2a5272894a0576f to your computer and use it in GitHub Desktop.
attrToJson.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
" 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