1. vi ~/.vimrc

添加

command! Json :execute '%!python2 -m json.tool'
\ | :execute '%!python2 -c "import re,sys;sys.stdout.write(re.sub(r\"\\\u[0-9a-f]{4}\", lambda m:m.group().decode(\"unicode_escape\").encode(\"utf-8\"), sys.stdin.read()))"'

使用,与:q!相同,命令为:Json

引用

https://blog.csdn.net/zh515858237/article/details/117619889