How to format a jason file in vim
:%!python -m json.tool
And you can also set a hot key in ~/.vimrc
Set as space+j
e..g.
let mapleader = " " noremap <leader>j :%!python -m json.tool<cr
好的心态+正确的方法
:%!python -m json.tool
let mapleader = " " noremap <leader>j :%!python -m json.tool<cr