You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could vim have a built-in tojson({value}) and fromjson({json}) helpers to
serialize and deserialize JSON?
JSON is used in lots of vim plugins like
https://github.com/Valloric/YouCompleteMe,
https://github.com/google/vim-maktaba,
https://github.com/MarcWeber/vim-addon-manager, and eventually Vundle
(https://github.com/VundleVim/Vundle.vim/pull/560). These can either use slow
hacks or depend on python support, but it would be best if vim just had native,
performant support for JSON marshalling built in.
Expected behavior
:echo tojson({'a': [1, 'foo'], 'b': 2.1}) ==# '{"a": [1, "foo"], "b": 2.1}'
1
:echo fromjson("[1.0, {}, []]") ==# [1.0, {}, []]
1
:echo tojson(fromjson('[null, true, false]')) ==# '[null, true, false]'
1
Note in the last example there needs to be a way to represent null, true, and
false unambiguously even though vim doesn't have these primitives. Also,
fromjson() could use an option to translate into standard vim equivalents like
'', 1, and 0.
Original issue reported on code.google.com by [email protected] on 13 Jul 2015 at 11:30
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 13 Jul 2015 at 11:30The text was updated successfully, but these errors were encountered: