question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Shortcut to format selected text as code

See original GitHub issue

There are already shortcuts for making text bold, italicized and linked in comment boxes. One formatting style that I use all the time (perhaps even more than bold and italics) is code, using backticks (`...`).

As someone who uses a keyboard layout where <kbd>`</kbd> is a dead key (so it allows typing accented letters like à, etc.), I find myself wanting a shortcut pretty often.

Even for those using keyboards where it works as a normal key, I can imagine that selecting some text and pressing a shortcut would be more convenient than moving the cursor to the start of the intended selection, typing <kbd>`</kbd>, then moving it to the end of the selection and typing <kbd>`</kbd> again.

(The same could be done for quoting selections with ' or ", by the way, but that’s a separate request.)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:16 (14 by maintainers)

github_iconTop GitHub Comments

6reactions
lumaxiscommented, Mar 28, 2021

Hello! 👋🏼 Just letting you know that this is now available directly on GitHub.com via <kbd>Ctrl</kbd>/<kbd>Cmd</kbd>+<kbd>e</kbd> 😊

https://twitter.com/natfriedman/status/1375188490393022465?s=21

2reactions
waldyriouscommented, Mar 28, 2021

Yeah, @lumaxis is right that the functionality now introduced by github is what I had in mind when I opened this bug. Unfortunately, the conversation got tangled with the one-key-formatting feature, which is a different (arguably more convenient) way to obtain the same effect, but unlike the keyboard shortcut approach, it doesn’t work with characters that are dead keys in certain keyboard layouts. Either way, I’m happy this is now available!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Shortcut to format selected text as code · Issue #2032 - GitHub
PS: Just discovered that GitHub lets you use Ctrl + I and Ctrl + B for wrapping and even unwrapping text (works with...
Read more >
21 Microsoft Word Shortcuts for Faster Formatting
Select the text and press Ctrl + B to apply bold. 14. Apply underline. Select the text and press Ctrl + U to...
Read more >
How do you auto format code in Visual Studio? - Stack Overflow
To format a selection: Ctrl + K , Ctrl + F. To format a document: Ctrl + K , Ctrl + D. See...
Read more >
Basic Editing in Visual Studio Code
Format Selection (Ctrl+K Ctrl+F) - Format the selected text. You can invoke these from the Command Palette (Ctrl+Shift+P) or the editor context menu....
Read more >
Keyboard shortcuts in Word - Microsoft Support
Use your keyboard to navigate your document, ribbon, or menus, and also select, format, and edit text and graphics in your documents.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found