Vim calls Python format JSON data November,gnu/linuxpython3, vimopenwares
Python has a standard module called JSON, for encoding/decoding, serializing/serializing JSON format data.
The JSON data returned by the server is unformatted, the program uses no problem, if need to read Alexander.
You can use VIM to invoke the command-line tool provided by the Python JSON module json/tool.py format the JSON text.
Vim opens JSON data in command line mode
:%!python3-m Json.tool
% for all line ranges, use! Calling external commands
The-m option for Python3 specifies the name of the module and runs the corresponding. py file as a script. The script that runs here is json/tool.py
json/tool.py is a command-line tool that uses JSON modules to validate and format JSON data.
JSON is a python3 built-in module that is available in package libpython3.3-stdlib.
You can add shortcut keys in ~/.VIMRC
Map <F4> <esc>:%!python-m json.tool<cr>
Vim calls Python to format JSON data