Perhaps you can install jq? Then `:%!jq .` should do it. On Saturday, October 22, 2022 at 10:09:08 PM UTC-4 Prabir Shrestha wrote:
> I have a json http response and need to format so I can inspect it. It > could contain sensitive (customer) data and would like to avoid using > random external tools to inspect it. Inspecting minified JSON is hard. > > I'm looking for an equivalent for this :%!python -m json.tool by > :JsonFormat and JSON.stringify() > <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify> > > by json_format() but without me install python (it is pain to use in > Windows). > > In Javascript this is what one could do. > > var obj = { 'name': 'prabir' };JSON.stringify(obj, null, 4); // Indented 4 > spacesJSON.stringify(obj, null, "\t"); // Indented with tab > > — > Reply to this email directly, view it on GitHub > <https://github.com/vim/vim/issues/11426#issuecomment-1287978465>. > > You are receiving this because you commented.Message ID: > <vim/vim/issues/11426/[email protected]> > -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/768833be-f18b-4eb5-93b4-0a7fd9ee120cn%40googlegroups.com.
