Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Code Block Char Count

wblwbl16 downloads

在代码块右下角显示字符数量统计,支持阅读视图与实时预览。

Add to Obsidian
  • Overview
  • Scorecard
  • Updates1

Display a character count badge at the bottom-right corner of every code block in Obsidian.

在 Obsidian 中每个代码块的右下角显示字符数量统计。

Features / 功能

  • Live update / 实时更新 — the badge updates as you type / 输入时数字实时刷新
  • Works everywhere / 全场景支持 — reading view, live preview, and embedded renders (embeds, canvas) / 阅读视图、实时预览、嵌入渲染均支持
  • Visible characters only / 只统计可见字符 — spaces, tabs and newlines are excluded / 空格、制表符与换行不计入
  • Zero config / 零配置 — no settings, just enable and go / 无需任何设置,启用即用

Install / 安装

BRAT (recommended / 推荐)

  1. Install and enable BRAT
  2. Run BRAT: Add a beta plugin for testing
  3. Enter power-ioi/code-block-char-count

Manual / 手动安装

  1. Download main.js, manifest.json, styles.css from the latest release
  2. Put them into <vault>/.obsidian/plugins/code-block-char-count/
  3. Restart Obsidian, then enable Code Block Char Count in Settings → Community plugins

Usage / 使用

No configuration needed. Open any note with a code block and you will see a small badge like 32 字符 at its bottom-right corner.

无需配置。打开任意包含代码块的笔记,右下角即可看到如 32 字符 的小角标。

How it works / 实现原理

  • Live preview: a CodeMirror 6 ViewPlugin scans the editor syntax tree (HyperMD-codeblock line groups) and attaches a line decoration to the last line of each code block.
  • Reading view: a registerMarkdownPostProcessor hook appends the badge to each rendered <pre> element.

License / 许可

MIT

HealthExcellent
ReviewSatisfactory
About
Display a character-count badge at the bottom-right of every code block and update it live as you type. Show counts in reading view, live preview, and embedded renders while counting only visible characters (excluding spaces, tabs, and newlines); no configuration needed.
CodeEditing
Details
Current version
1.0.0
Last updated
Last week
Created
Last week
Updates
1 release
Downloads
16
Compatible with
Obsidian 1.4.0+
Platforms
Desktop, Mobile
Report bugRequest featureReport plugin
Author
wblwblpower-ioi
GitHubpower-ioi
  1. Community
  2. Plugins
  3. Code
  4. Code Block Char Count

Related plugins

Code Space

Professional code file management with visual dashboard, syntax highlighting editor, Markdown embedding, external folder mounts, and terminal integration.

VSCode Editor

Edit Code Files like VSCode.

LanguageTool Integration

Advanced grammar and spell checking, powered by LanguageTool.

Meta Bind

Make your notes interactive with inline input fields, metadata displays, and buttons.

Advanced Tables

Improved table navigation, formatting, and manipulation.

Thino

Quickly capture memos and display them in the sidebar with a heatmap. (Closed source)

Mermaid Tools

Improved Mermaid.js experience: visual toolbar with common elements and more.

Editing Toolbar

The Editing Toolbar is modified from cMenu, which provides more powerful customization settings and has many built-in editing commands to be a MS Word-like toolbar editing experience.

Outliner

Work with your lists like in Workflowy or Roam Research.

Hover Editor

Transform the Page Preview hover popover into a fully working editor instance.