Plugin

Code block from selection

Turn the selected text into a code block.

  • Overview
  • Updates
  • Privacy
Turn selected text into a code block with a simple command. Add triple backticks before and after your selection and specify the programming language in settings. Assign hotkeys for quick access and streamline your coding notes.

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.

Created
Mar 10, 2021
Last updated
Jan 26, 2022
Updates
7 releases
Downloads
11.4k
Compatible with
0.9.12+
License
MIT