How to display code blocks in Medium

(and other less important formatting things)

To begin a block of text as code in Medium’s editor, press Cmd-6.

You can also highlight a portion of text, then press Cmd-6 to separate it into a code block.

It looks like this:

var string = “hello world!”;

In general, hit Cmd-? to pull up a menu of all available shortcuts.

Like what you read? Give Joey Yang a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.