standard JSON library of vim script
Copy jsoncodes.vim to vimfiles/autoload of your Vim installation
It provide the following functions
-
jsoncodecs#dump_string
This functions take a list contains lines as input, output is a valid JSON string
-
jsoncodecs#dump_lines
A utility function print out the result from jsoncodecs#dump_string
:1,$call b:json_dumplines()