# Keyboard Formatter [![License](https://img.shields.io/badge/License-0BSD-blue?style=for-the-badge&labelColor=555555)](LICENSE) [![Ko-fi](https://img.shields.io/badge/Support-Ko--fi-FF5E5B?style=for-the-badge&logo=ko-fi&logoColor=white)](https://ko-fi.com/lauloque) **Formats keyboard text (kbd) in your Obsidian notes quickly and consistently.** This Obsidian plugin allows you to select text within your notes and, with a simple keyboard shortcut of your choosing , automatically format common keyboard keys and mouse buttons using HTML `` tags. This provides a visually distinct and semantic way to represent user input instructions in your writing. ## Features - **Effortless Formatting:** Select text containing keyboard key names and press a keyboard shortcut of your choosing to format them. For example`ctrl shift a` will become ⌘ Ctrl ⇧ Shift A. - **Special Keys Recognition:** - Common modifier keys: ⎈ Ctrl ⇧ Shift ⎇ Alt ⌘ Cmd Win etc. - Function keys: F1-F12 - Command keys ⇥ Tab, ⌫ Delete ⏎ Enter - Directions like `up` and `left` become ↑ Up ← Left to mimic arrow keys - Numpad keys such as `numpad .` or `numpad 5` will be formatted as Numpad • or Numpad 5 - **Mouse Button Formatting:** "lmb" as Left 🖱️, "rmb" as Right 🖱️, "mmb" as Middle 🖱️, and "wheel" or "scrollwheel" as Wheel 🖱️. - **Case-Insensitive Matching:** Key names are recognized regardless of their capitalization (e.g., "Ctrl", "ctrl", and "CTRL" all become ⌘ Ctrl). - **Single Letter Capitalization:** Capitalizes single-letter words (useful for individual key presses), like "a" becoming A. - **Light and Dark themes** for everyone to enjoy! ## How to Use 1. **Install the plugin:** - Open Obsidian. - Go to **Settings** -> **Community plugins**. - Make sure **Safe mode** is off. - Click **Browse** and search for "Keyboard Formatter". - Click **Install** and then **Enable** the plugin. - Alternatively, you can manually install it by copying the contents of [the latest GitHub release](https://github.com/Lauloque/Obsidian-Keyboard-Formatter/releases/latest) from this repository into your Obsidian vault's plugins folder (`/.obsidian/plugins/keyboard-formatter`), then enable the plugin from your Obsidian's Community plugins list. - From the Community Plugins section, click the ➕ icon to set up your keyboard shortcut for this plugin, or click the ⚙️ icon to customize the text and background colors used for the KBD elements: ![image](https://github.com/user-attachments/assets/e0c26038-0619-404e-a0b4-62f5ded66ff8) 2. **Format text:** - Open a Markdown note in Obsidian. - Select the text you want to format (e.g., `ctrl shift a`). - Press the keyboard shortcut to run the tool - The selected text will be transformed into: `⌘ Ctrl ⇧ Shift A` which looks like this: ⌘ Ctrl ⇧ Shift A. ## Support My Work [![Support me on Ko-fi](https://img.shields.io/badge/Support-Ko--fi-FF5E5B?style=for-the-badge&logo=ko-fi&logoColor=white)](https://ko-fi.com/lauloque) If you find this plugin helpful and would like to support its development, you can buy me a coffee on Ko-fi! Your support is greatly appreciated. --- Thank you for using Obsidian Keyboard Formatter! If you have any issues or suggestions, please feel free to open an issue on this repository.