I currently deal with lots of json files and am quite fond of the bash comand jq, e.g. if I want to format the file I do
jq . ugly.json > formmatedformated.json Now, I don't want to leave vim, but run it directly within my current open file.
How can I do it?
I tried:
:!jq . % ! runs a bash command % means the current file
Yet this only displays the result, yet does not update the content of the file.
While writing this question I stumbled upon a solution yet don't know why it works. It would be great if someone could point out why `:%!jq .` works.