6

In MS Teams, it is common to need to share code snippets quickly. Is there a keyboard shortcut that displays the code snippet editor?

IMG:

1
  • 1
    There is no shortcut - and you can't customise them either. Try an autohotkey script.
    – DavidPostill
    Mar 19, 2021 at 17:28

2 Answers 2

10

Use 3 consecutive backticks ```, on the latest MS Teams versions, seems we need a space after these backticks to make it work like ```

Examples:

  • ```
  • ```python
5
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Mar 28, 2022 at 12:33
  • 3
    Triple backticks creates a monospaced paragraph, not a code snippet as is asked in the question.
    – pooya13
    Jan 26, 2023 at 1:32
  • 2
    triple backticks followed by an optional language name and a space do create code snippets. Just tested it now ( 2023-09-13 )
    – gelonida
    Sep 13, 2023 at 14:08
  • doesn't for me 1.6.00.34263 on mac Dec 19, 2023 at 17:17
  • can you change a setting somewhere so you don't need the add the space? it's really annoying and when I paste code from somewhere else it won't convert the ``` to a code snippet
    – Ruben
    Feb 13 at 11:36
1

NB! Following information is only to those people in the world, who use keyboard layouts with dead keys. If you don't have such, then don't read and rate this answer and move on.

I was struggling getting the monospace text box in Teams for years and I ended up in this topic and that's why I'm provising the information for similar people. When backtick is a dead key on your keyboard (Finnish/Swedish/Estonian for example), then you need three backticks (shift+tick - tick is between question mark and backspace key) followed by TWO spaces (the big key in the middle of lower row between Alt and AltGr keys). So you basically need 5 keypresses:

  1. Shift + ´`
  2. Shift + ´`
  3. Shift + ´`
  4. Spacebar
  5. Spacebar
1
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Mar 7 at 13:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .