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 Emphasis

elfmedyelfmedy296 downloads

Highlight important code and comments in your notes.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates3

中文

Mark the important parts of code in your Obsidian notes, so they are easier to revisit.

Live Preview with highlighted code

Highlight text

  1. Select text inside a code block.
  2. Run Code Emphasis: Highlight selected text from the command palette.
  3. Optionally assign a shortcut in Settings → Hotkeys.

You can also type the markers yourself:

^^// Initialize before starting^^
if (^^status^^ == READY) {
    ^^Start()^^;
}

Selecting multiple lines highlights each nonblank line. To remove a highlight, delete its two ^^ markers, or undo immediately after adding it.

Reading and editing

  • Live Preview: markers stay hidden until you move the cursor into a highlight or select across it. Only that fragment opens for editing.
  • Reading view: shows highlights without markers.
  • Source mode: shows the original markers.
  • Copy code: the Reading view button removes markers and keeps your comments, indentation and backslashes. Normal editor copy keeps the selected source.

Code and comments use the same style. Backslashes stay unchanged: \^^fff^^ displays and copies as \fff. Highlights cannot span line breaks or nest; unmatched markers stay visible. Paired literal ^^ are treated as markers.

Settings

  • Language: Follow Obsidian (default), 中文, or English.
  • Font color: red by default. Switch off to keep the original text colors.
  • Background color: off by default. Enable to choose a color.

Both colors can be switched off independently. Restore defaults resets all settings.

Install

Requires Obsidian 1.13+.

BRAT: add elfmedy/code-emphasis and enable Code Emphasis.

Manual: download main.js, manifest.json, and styles.css from the latest release. Put them in your vault's .obsidian/plugins/code-emphasis/ folder, then enable the plugin.

The highlight command currently works in ordinary top-level fenced code blocks. Special blocks such as Mermaid are excluded.

Upgrading from the old HTML plugin · Development · MIT license

HealthExcellent
ReviewSatisfactory
About
Mark important parts of code inside fenced code blocks using ^^ markers or the command palette. Hide markers while reading and in Live Preview, reveal fragments when editing, and copy clean code without markers from reading view.
CodeEditing
Details
Current version
2.1.0
Last updated
6 days ago
Created
4 years ago
Updates
3 releases
Downloads
296
Compatible with
Obsidian 1.13.0+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Author
elfmedyelfmedy
GitHubelfmedy
  1. Community
  2. Plugins
  3. Code
  4. Code Emphasis

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.

Templater

Create and use dynamic templates.

LanguageTool Integration

Advanced grammar and spell checking, powered by LanguageTool.

Meta Bind

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

Thino

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

Advanced Tables

Improved table navigation, formatting, and manipulation.

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.

Simplified Chinese Word Splitting

Adds Simplified Chinese word splitting support for the editor and Vim mode.