I have this simple json formatting alias defined:
alias json='python -mjson.tool'
I'm not much of a vi/vim/macvim user, but I bet you could pipe an open json document through that command pretty easily right in the editor.