Skip to content

A vscode extension for wrapping shortcut keynames with <kbd> tags in markdown files.

License

Notifications You must be signed in to change notification settings

jjaakko/markdown_kbd

Repository files navigation

VSCode Markdown Kbd

Make keynames and keyname combinations (such as Cmd+R for example) more visible in your markdown document by wrapping key names with <kbd> tags.

Demo

Features

  • Auto-detects key name combination patterns from selected area and wraps them with <kbd> tags.
  • Wraps either each key name separately or the whole key name combination, based on configuration.
  • Replaces keynames, such as ctrl, cmd, opt and shift with icons (^, ⌘, ⌥, ⇧) or vice versa, based on configuration.

Commands

How to use this extension

  • Install the extension & reload window
  • Create new markdown file or open up a markdown file.
  • Insert text with a keyname combination, such as cmd+r.
  • Select text that contains keyname or keyname combination
  • If you created a new file, remember to save it with .md extension.
  • Open command panel by hitting ++P.
  • Type markdown kbd and select Wrap keynames in selected area with <kbd> tags.

Currently supported keynames and respective icons

Keyname Icon
cmd
shift
ctrl ^
opt
ret
pageup
pagedown
backspace
arrRight
arrLeft
arrUp
arrDown
tab
alt
esc
space
F10
F11
F12
F1
F2
F3
F4
F5
F6
F7
F8
F9

Extension Settings

Use settings to adjust how wrapping is done:

Settings

This extension contributes the following settings:

  • markdownKbd.wrapKeyNamesSeparately: control whether to wrap individual key names or the key combination as a whole
  • markdownKbd.addSpacesAroundPlusSign: control whether to use space around the plus sign, Cmd+r vs Cmd + r
  • markdownKbd.replaceKeynamesWithIcons: control whether to replace ctrl, cmd, opt and shift with icons (^, ⌘, ⌥, ⇧).

Note: settings do not affect retroactively. To wrap text with new settings, use the Wrap keynames in selected area with <kbd> tags command again.

Caveats

  • Not all flavours of markdown support <kbd> elements.

About

A vscode extension for wrapping shortcut keynames with <kbd> tags in markdown files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published