elzr / vim-json

A better JSON for Vim: distinct highlighting of keywords vs values, JSON-specific (non-JS) warnings, quote concealing. Pathogen-friendly.
Other
1.23k stars 111 forks source link

Add command to convert JSON to YAML (and back again) #62

Closed BigBlueHat closed 8 years ago

BigBlueHat commented 8 years ago

I often find myself with one or the other of these two formats, but it's currently requires copying and pasting the content into (typically) and online conversion thing.

My ideal scenario would be to highlight some JSON (in any type of file...ideally), type a command, and have it update the selection with the YAML (or the other way around).

Insane? Maybe. :stuck_out_tongue_winking_eye:

Awesome? Most definitely! :smile:

jkufner commented 8 years ago

Just install json2yaml tool and then enter :%!json2yaml or :%!yaml2json in Vim.

BigBlueHat commented 8 years ago

@jkufner this worked fabulously, btw. :smiley_cat: Thanks!