⌥+⌃AltPlusCtrl

How to Format Inline Code in Slack (Ctrl+Shift+C)

Windows: Ctrl+Shift+C
Mac: Cmd+Shift+C
Select text in the Slack message box and press Ctrl+Shift+C — Cmd+Shift+C on macOS — to format it as inline code. Wrapping it in single backticks does the same. The text renders in a monospaced font on a tinted background, inside the flow of the sentence. **Inline code is not the same as a code block, and the distinction is worth getting right.** Inline code is for a fragment that belongs in a sentence: a filename, a flag, a variable, a command name. A code block is for something that stands alone across multiple lines. Using a block for a single word breaks the sentence around it; using inline formatting for a ten-line script produces an unreadable run-on. The shortcuts differ accordingly — Ctrl+Shift+C for inline, Ctrl+Alt+Shift+C for a block. **The most valuable thing code formatting does is stop Slack reinterpreting the text.** Inside code formatting, characters are literal. Asterisks stay asterisks rather than becoming bold. Underscores in `some_variable_name` stay underscores rather than italicising the middle. Tildes stay tildes. A URL is not linkified. This is the actual reason to reach for it on anything technical, quite apart from the visual treatment: it is the only reliable way to guarantee that what you paste is what the other person copies. **Monospacing also solves character ambiguity.** In Slack's proportional font, lowercase l and the digit 1 are close, as are capital O and zero, and runs of spaces collapse visually. For a password reset token, a container ID, a file path or a serial number, that ambiguity turns into a support conversation about why the value did not work. Monospace makes each character distinct and preserves spacing exactly. **Backticks are easy to type and easy to leave unclosed.** A message with an opening backtick and no closing one renders the backtick literally and applies no formatting, which looks like Slack ignoring you. The keyboard shortcut cannot make that mistake, because it wraps a selection rather than relying on you to balance delimiters — a reasonable argument for the shortcut on anything longer than a word. **Formatting inside code does not apply, deliberately.** You cannot bold part of an inline code span. If you need to draw attention to one flag within a longer command, the usual answer is to say so in the surrounding prose rather than to fight the formatting — or to break the command into a code block and explain the relevant line beneath it. **A note on Slack's search.** Text in code formatting is still indexed and still findable, so wrapping an error string in backticks does not hide it from a later search. That is worth knowing before deciding to leave an error message unformatted in the hope of making it easier to find again. **Pasting behaviour is worth knowing.** Slack sometimes detects that pasted content looks like code and offers to format it, which is convenient when it guesses right and irritating when it wraps a normal sentence containing a slash. The offer can be declined, and applying the formatting deliberately with the shortcut avoids the guess entirely. For a fragment inside a sentence, selecting it and pressing Ctrl+Shift+C is both faster and more predictable than typing delimiters and hoping they balance.

Related shortcuts