federomero / pretty-json

Atom plugin. Format JSON documents.
MIT License
93 stars 23 forks source link

Feature Request: Prettify on opening a JSON file #70

Open frederic-adda opened 7 years ago

frederic-adda commented 7 years ago

Hi! I love your extension, which is my most often used one in Atom. I deal with a lot of JSON files, and I'd love it if there was an option to prettify directly JSON files upon opening. Today, I use a lot the shortcut command+shift+p and then prettify, but I have to do that dozens of times per day ...

Thanks Fred

lexicalunit commented 7 years ago

Thank you for the kind words! The best solution for now would probably be to install a keyboard shortcut to make the command more accessible. See this comment from a previous issue. I've also just released v1.6.4 of pretty-json which provides additional documentation on keymaps.

I will also look into adding a config setting to automatically prettify .json files whenever they are initially opened if the above isn't sufficient. 👍

wbt commented 5 years ago

+1 to Fred's request above, including the thanks! I came to post something similar but more specific.

I would like to see an option somewhere in the package that when the option is true AND the user is opening a file with a .json extension AND the file has a single non-empty line, run the 'prettify' command.
I've got the keyboard shortcut installed (command+shift+j as command+shift+p is taken by default) but would enjoy this option to automatically prettify files in this case.