bspckl bspckl - 1 year ago 120
JSON Question

VIM: swap json values within double quotes

I need to swap tag and value in a json file on multiple lines using VIM editor.



needs to be:


I have gotten as far as
(using a temp) for the tag and value, but I need to know how to swap either everything within the 2nd and 4th double quotes or everything before and after the comma.

Answer Source
%norm! f,xdT{f}i,^R"

In above cmd, ^R you press ctrl-v ctrl-r

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download