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
  • Join the community
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Dynamic Highlights

nothingislostnothingislost3k downloads

Dynamically highlight text based on cursor selection or search query with full regex, mobile, and live preview support.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates21

An Obsidian plugin that dynamically highlights text based on selection or search query.

This plugin currently only works in the Source or Live Preview editor modes. For now it will not affect Reading mode or the Legacy Editor.

Selection Highlights

If there is no active selection, all occurences of the word underneath the current cursor position will be highlighted

  • Word matching is case insensitive
  • The word currently under the cursor will be marked with .cm-current-word
  • Occurences of the current word found elsewhere in the document will be marked with cm-matched-word
  • All occurences will recieve the data-contents data attribute which will hold the current word value

If there is an active selection, all occurences of the text inside the selection will be highlighted.

  • String matching is case insensitive
  • The currently selected string will be marked by default with .cm-selection
  • Occurences of the currently selected string found elsewhere in the document will be marked with cm-matched-string
  • All matches will recieve the data-contents data attribute which will hold the selected string value

Persistent Highlights

Persistent highlights are created by defining a search query and associating a CSS class name and color. Once defined, any string that matches the search query will be marked with the associated CSS class and will receive background color that matches the chosen color.

Search queries can be written using regular expressions as long as you toggle the regex option for the query.

You can define as many unique highlighters as you'd like as long as the class names are unique. Performance may be impacted when creating a large number of complex regex queries so be mindful of your regex complexity.

Examples

You can import the examples with the Import Button at the top right of the plugin's settings.

Visual Linting

Highlights double spaces, empty list markers, double list markers, preceding spaces, and trailing spaces.

{
  "Mini-Linting": {
    "class": "Mini-Linting",
    "color": "#A70F0F38",
    "regex": true,
    "query": " {2,}(?!\\|| |$)|- - |^\\s*- \\n|^ +(?![0-9-`])",
    "mark": [
      "match"
    ],
    "css": ".cm-line .Mini-Linting {\n  background: none;\n}\n\n.cm-line:not(.cm-active) .Mini-Linting {\n  outline: 1px solid var(--text-error);\n}"
  },
}
Strike Out Filler Words to avoid in Writing
{
  "Filler-Words": {
    "class": "Filler-Words",
    "color": "#2D801838",
    "regex": true,
    "query": "\\b([Aa] bit|[Aa]bsolutely|[Aa]ctually|[Aa]nd all that|[Aa]nd so forth|[Aa]nyway|[Bb]asically|[Cc]ertainly|[Cc]learly|[Cc]ompletely|[Dd]efinitely|[Ee]ffectively|[Ee]ntirely|[Ee]ssentially|[Ee]vidently|[Ee]xtremely|[Ff]airly|[Ff]rankly|[Ff]requently|[Gg]enerally|[Hh]opefully|[Kk]ind of|[Ll]argely|[Ll]iterally|[Mm]ore or less|[Mm]ostly|[Oo]ccasionally|[Oo]ften|[Oo]verall|[Pp]articularly|[Pp]erhaps|[Pp]ossibly|[Pp]ractically|[Pp]recisely|[Pp]resumably|[Pp]retty|[Pp]rimarily|[Pp]robably|[Pp]urely|[Qq]uite|[Rr]arely|[Rr]ather|[Rr]eally|[Rr]elatively|[Ss]eriously|[Ss]ignificantly|[Ss]imply|[Ss]lightly|[Ss]omehow|[Ss]ort of|[Ss]pecifically|[Ss]trongly|[Ss]upposedly|[Ss]urely|[Tt]he fact that|[Tt]otally|[Tt]ruly|[Tt]ypically|[Uu]ltimately|[Uu]sually|[Vv]ery|[Vv]irtually|[Ww]idely)\\b",
    "mark": [
      "match"
    ],
    "css": ".cm-line .Filler-Words{\n\ttext-decoration: line-through;\n\tbackground: none;\n\tcolor: var(--text-muted);\n}\n\n/* where to disable */\n.HyperMD-quote.cm-line .Filler-Words,\n.pdf-annotations .cm-line .Filler-Words {\n\ttext-decoration: none;\n\tcolor: unset;\n}"
  }
}
Highlight Custom Styles in Pandoc Exports (:::)
{
  "Pandoc-Syntax": {
    "class": "Pandoc-Syntax",
    "color": "#77787C4A",
    "regex": true,
    "query": "::: \\{.*?\\}[\\s\\S]*?:::",
    "mark": [
      "match",
      "group"
    ],
    "css": ""
  }
}

Settings

Delay

The delay before highlighting is applied after moving the cursor

Ignored Words

A comma delimited list of words that will not be highlighted

The default list can be found here: https://gist.github.com/sebleier/554280

Limitations

  • There is currently no support for dynamic highlights in reading/preview mode.
  • Only strings with 3 or more characters will be highlighted in selection highlight mode

Acknowledgments

Thanks to @chrisgrieser aka @pseudometa for the plugin idea and feedback. Thanks to @chetachiezikeuzor for the plugin settings UI code which was inspired by https://github.com/chetachiezikeuzor/highlightr-Plugin/

HealthFair
ReviewNot scanned
About
Highlight text dynamically based on cursor position or selection, marking the active word/selection and other matches with distinct CSS classes. Create persistent regex or string-based highlighters with unique class names and custom background colors to mark recurring patterns across your notes; limited to Source and Live Preview modes.
AnnotationSearchCSS
Details
Current version
0.2.5
Last updated
4 years ago
Created
4 years ago
Updates
21 releases
Downloads
3k
Compatible with
Obsidian 0.15.0+
License
MIT
Report bugRequest featureReport plugin
Author
nothingislostnothingislost
github.com/nothingislost
GitHubnothingislost
  1. Community
  2. Plugins
  3. Annotation
  4. Dynamic Highlights

Related plugins

Admonition

Admonition block-styled content.

Highlightr

A minimal and aesthetically pleasing highlighting menu that makes color-coded highlighting much easier with a configurable assortment of highlight colors.

Smart Connections

AI link discovery copilot. See related notes as you write. Lookup using semantic (vector) search across your vault. Zero-setup local model for embeddings, no API keys, private.

Style Settings

Adjust theme, plugin, and snippet CSS variables.

Omnisearch

Intelligent search for your notes, PDFs, and OCR for images.

Lapel

Show the heading levels in the gutter of the editor.

MCP Tools

Securely connect Claude Desktop to your vault with semantic search, templates, and file management capabilities.

Custom Frames

Turn web apps into panes using iframes with custom styling. Also comes with presets for Google Keep, Todoist and more.

Kindle Highlights

Sync your Kindle book highlights using your Amazon login or uploading your My Clippings file.

Citations

Automatically search and insert citations from a Zotero library.