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

 

posted on 2022-08-31 18:22  guolongnv  阅读(21)  评论(0编辑  收藏  举报