Plugin: CodeBlock Language Detector

Plugin/Theme Disclaimer

Is this project open source? Yes
Is this project completely free? Yes
Is this project vibe-coded beyond the author’s ability to comprehend how it works? No
Community Directory: Link


Plugin: CodeBlock Language Detector

Hi! I just published CodeBlock Language Detector, a plugin that automatically identifies the programming language of unlabelled code blocks and adds the correct language tag - so you get proper syntax highlighting without having to type it yourself.


The problem

If you paste code into Obsidian without specifying a language, you get a plain, unhighlighted block. Manually adding ```python or ```javascript to every snippet is tedious — especially when you’re pasting from Stack Overflow, a chat, or quickly jotting down a snippet mid-thought.


What it does

The plugin scans your notes for code blocks that are missing a language tag and fills them in automatically. Detection can be triggered manually per-note or vault-wide.

Features:

  • 70+ supported languages: Python, JavaScript, TypeScript, Java, C/C++, Go, Rust, PHP, SQL, Bash, and many more
  • Dual detection engine: combines Highlight.js (battle-tested library, great for common languages) with custom pattern matching (useful for domain-specific or config languages)
  • Configurable detection order: run Highlight.js first, Pattern Matching first, or use either alone
  • Confidence threshold: set a minimum confidence level (0–100%) to control how aggressively the plugin tags blocks; higher = fewer false positives
  • Works on individual notes (command palette) and across the entire vault
  • No internet connection required: all detection runs locally

Install

Search for CodeBlock Language Detector in Settings → Community plugins → Browse.

Or find it here: CodeBlock Language Detector - Obsidian Plugin

GitHub: GitHub - bueckerlars/obsidian-codeblock-language-detector: Automatically detects and adds language tags to code blocks · GitHub


Feedback and bug reports are very welcome — especially for languages that get misidentified. The confidence threshold is your friend there while the detection improves!