federomero / pretty-json

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

what shortcut used in demo #48

Closed zhugw closed 8 years ago

zhugw commented 8 years ago

hi, I'm not very familiar with Atom, and right now I installed pretty-json. And from README there is a demo. And I want to know which shortcut you used? I have to choose Packages then choose Pretty JSON then choose Prettify using mouse.

lexicalunit commented 8 years ago

You can use cmd-shift-P to pull up the Command Palette in Atom and then start typing "prettify" to zero-in on the pretty-json command that you wish to execute. Use the arrow keys and hit enter on the command you want. This is how it is done in the example gif.

You can also define a keymap to assign a shortcut to any pretty-json command you wish to have quick access to. For example, you could open your keymap.cson file by going to your main Atom menu and selecting Keymap... and then add to the bottom of the file:

'atom-text-editor:not([mini])':
  'ctrl-alt-p': 'pretty-json:prettify'

At that point, you'd be able to activate the Prettify command using ctrl-alt-p.

zhugw commented 8 years ago

Thanks!