Lightning-fast code block insertion with language selection and smart recents tracking
Stop fumbling with triple backticks and language names! This plugin makes inserting code blocks in Obsidian as easy as pressing two keys.
- Instant search through 200+ programming languages
- Recently used languages automatically pinned to the top (last 5)
- Visual indicators show your favorite languages with ⭐
- Fuzzy search matches both language names and codes
- Alt + L (Mac: Ctrl + L) → Insert code block with Language picker
- Alt + P (Mac: Ctrl + J) → Insert Plain code block (no syntax highlighting)
- Wraps selected text automatically, even when it already contains code fences
- Empty search shows your recent languages first
- Search puts an exact match first, then your recent matches
- Type any language that isn't listed (like
dataview) and pick Use "dataview" - Recent languages are remembered after restarting Obsidian
- Press Alt + L on Windows/Linux or Ctrl + L on Mac (or use Command Palette: "Insert code block")
- Start typing a language name (e.g., "python", "javascript", "rust")
- Hit Enter to insert
Example:
# Before (with "hello world" selected)
hello world
# After selecting "python"
```python
hello world
```
Press Alt + P (Mac: Ctrl + J) for instant plain code blocks - perfect for pseudocode, terminal output, or quick snippets.
```
your code here
```
Put your cursor anywhere inside a code block and run Change code block language from the Command Palette. Pick a language and only the opening fence changes, anything after the language (like title=...) is kept.
Run Remove code block (keep code) with your cursor inside a block. The fences go, the code stays.
Copy some code, run Paste as code block and pick a language. The clipboard contents are inserted inside a new code block.
These three commands have no default hotkey. Assign one under Settings → Hotkeys if you use them often.
First time using the plugin? You'll see all languages alphabetically.
After using Python, JavaScript, and TypeScript a few times:
[Search for a language...]
⭐ Python
⭐ TypeScript
⭐ JavaScript
---
ActionScript
Bash
C
C++
...
Start typing "script"? Recent matches jump to the top:
Search: script
⭐ TypeScript
⭐ JavaScript
---
ActionScript
CoffeeScript
...
- Open Settings → Community Plugins
- Search for "Easy Codeblock"
- Click Install, then Enable
- Download the latest release
- Extract to
.obsidian/plugins/easy-codeblock/ - Reload Obsidian
- Enable in Settings → Community Plugins
- Open a note and tap inside the editing area to show the toolbar.
- Tap the
configure mobile toolbar (wrench icon)button. - Find
Easy Code Block: Insert code blockand/orEasy Code Block: Insert code block (no language)and add it toManage toolbar optionsby clicking the plus icon. - If you can't find it, scroll to the bottom. In the
Add global commandsection, search forEasy Code Block: Insert code blockand/orEasy Code Block: Insert code block (no language).
Don't like the default hotkeys?
- Go to Settings → Hotkeys
- Search for "Easy Codeblock"
- Set your preferred shortcuts
Over 200 languages including:
Popular: JavaScript, TypeScript, Python, Java, C++, Rust, Go, PHP, Ruby, Swift
Web: HTML, CSS, SCSS, Vue, React (JSX/TSX)
Markup: Markdown, YAML, JSON, XML, TOML
Systems: Bash, PowerShell, Dockerfile, SQL
And many more! The full list is powered by Prism.js syntax highlighting.
Found a bug? Have an idea? Contributions welcome!
- Fork the repository
- Create your feature branch
- Submit a pull request
MIT License - feel free to use this in your own projects!
- 🐛 Report bugs
- 💡 Request features
- ⭐ Star on GitHub if you find this useful!
Made with ❤️ for the Obsidian community
Stop typing backticks. Start writing faster.