Skip to main content
12 of 16
replaced http://meta.stackoverflow.com/ with https://meta.stackoverflow.com/

<kbd>, Superscript and Subscript, markup shortcuts

###About: This script adds buttons and keyboard shortcuts that make it easy to add <kbd> tags and/or superscripts and subscripts, when editing posts.

###Screenshot:

This script in action

###To use:

Click the button or press AltK on the keyboard and <kbd></kbd> will be inserted at the cursor.
If text is selected, it will be wrapped by the <kbd> tags instead.

Likewise for the Superscript and Subscript tags, the keyboard shortcuts are Alt and Alt (Up arrow and Down arrow).

Tags are wrapped and unwrapped the same way that other markup (Bold, Italic, etc.) is -- including how whitespace and nested tags are handled.

###Download / Install:

Install the script from GitHub: Install

Requires Firefox+Greasemonkey, Chrome+Tampermonkey, or equivalent userscript engine.

###Code:

Find the source on GitHub at: BrockA/SE-misc/Add_kbd_sup_sub_shortcuts.user.js

You may also make bug reports, pull-requests, etc. there.


Inspired by the question, "Markdown syntax for <kbd>foo</kbd>".

Brock Adams
  • 13k
  • 5
  • 39
  • 64