Paste as code block

During my work I find myself copying and pasting parts of code inside notes obsidian. To do this correctly I have to first create a code block and then paste the code inside it. It would be useful to a lot of people the possibility to have an hotkey to “Paste as code block”.

Use case

Create a multiline code block and paste inside it the content of the clipboard.

Proposed solution

Have a configurable hotkey to paste directly in a codeblock

Current workaround

Currently I didn’t found a way to execute the task.

I found just a plugin that enable an hotkey to code block creation (GitHub - dy-sh/obsidian-code-block-from-selection: Obsidian plugin. Adds code block for the selected text.)

There is a plugin that allow that