Code block from selection

approved

by Dmitry Savosh

Turn the selected text into a code block.

36 stars11,819 downloadsUpdated 4y agoMIT
View on GitHub

Code block from selection

This plugin for Obsidian adds a "Code block from selection" command that turns the selected text into a code block. It just adds ``` before and after the selected text. In the plugin settings you can specify which language to use in the code block. You can add as many languages as you like and assign hotkeys to them.

How to configure

Specify the programming language in the plugin settings (for example "c++"), then add the desired hotkey for the "Code block from selection" command on the Obsidian hotkeys panel.

How to use

Just select the text with code or put the cursor on the desired line and press hotkey.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.