Shortcut to format selected text as code
See original GitHub issueThere 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:
- Created 4 years ago
- Reactions:1
- Comments:16 (14 by maintainers)
Top GitHub Comments
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
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!