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

Custom Syntax Highlights

outsiders17711outsiders177111k downloads

Display files with custom extensions as syntax-highlighted code blocks in reading view with configurable extension-to-language mappings.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates5

An Obsidian plugin that displays files with custom extensions as syntax-highlighted code blocks in reading view, with configurable extension-to-language mappings.

Features

  • Custom Extension Mapping: Configure any file extension to display with specific syntax highlighting
  • Auto-Switch to Reading View: Automatically switch configured file extensions to reading view when opened
  • Flexible Language Support: Map extensions to any supported syntax highlighting language
  • Clean Display: Files are rendered as single, properly formatted code blocks

Demo

On the left is Source Mode, and on the right is Reading Mode. Click either image to enlarge.

Source Mode Reading Mode

Installation

From Community Plugins (Recommended)

You can install the plugin directly from Obsidian's Community Plugins browser:

  1. Open Obsidian and go to Settings > Community plugins
  2. Click on Browse and search for "Custom Syntax Highlights"
  3. Click Install and then Enable the plugin

You can also install the plugin directly from its Community Plugins entry: Custom Syntax Highlights on Obsidian.

Manual Installation

  1. Download the latest release from GitHub Releases
  2. Extract main.js, manifest.json, and styles.css to your vault's .obsidian/plugins/custom-syntax-highlights/ directory
  3. Reload Obsidian and enable the plugin in Settings → Community plugins

Configuration

Extension Mappings

Configure extension-to-language mappings in Settings → Community plugins → Custom File Extensions:

  • Extension: The file extension (without the dot)
  • Language: The syntax highlighting language to use (leave empty to use the extension name)

Example Configurations

Extension Language Result
tex (empty) LaTeX files with TeX syntax highlighting
json (empty) JSON files with JSON syntax highlighting
bib ini Bibliography files with INI-style highlighting
py python Python files with Python syntax highlighting
txt md Text files with normal editing (no highlighting)

Important Notes

  • Markdown files (.md): Not supported - handled natively by Obsidian
  • Normal editing: Set language to md or markdown to disable highlighting and enable normal editing
  • Auto-switch: Toggle whether files automatically open in reading view

Usage

  1. Configure extension mappings in plugin settings
  2. Open any file with a configured extension
  3. File automatically switches to reading view with syntax highlighting

Development

Building

npm install    # install dependencies
npm run dev    # development build with watch mode
npm run build  # production build
npm run test   # update the plugin in the test vault

Release

npm run release        # automated patch release
npm run release:minor  # minor version release  
npm run release:major  # major version release

Requirements: Node.js 16+, Git repository with GitHub origin

Documentation

  • Release Process - Complete guide for maintainers
  • Changelog - Version history and release notes

Inspiration

Built upon the foundation of MeepTech/obsidian-custom-file-extensions-plugin for file extension registration. This plugin now implements a complete 2-in-1 solution with both file extension registration and syntax highlighting.

License

MIT License

HealthExcellent
ReviewCaution
About
Render files with custom extensions as syntax-highlighted code blocks in Reading view. Map extensions to any supported language and auto-switch configured files to Reading view for a clean, single-block display.
SyntaxFilesInterface
Details
Current version
0.5.4
Last updated
9 months ago
Created
11 months ago
Updates
5 releases
Downloads
1k
Compatible with
Obsidian 1.0.0+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Author
outsiders17711outsiders17711
github.com/Outsiders17711
GitHuboutsiders17711
  1. Community
  2. Plugins
  3. Syntax
  4. Custom Syntax Highlights

Related plugins

Notebook Navigator

A better file browser and calendar inspired by Apple Notes, Bear, Evernote and Day One.

Hider

Hide interface elements such as tooltips, status bar, titlebar, and more.

Claudian

Embeds Claude Code/Codex and other local Agents as AI collaborators in your vault.

Advanced URI

Control everything with URI.

Meta Bind

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

Local REST API with MCP

Unlock your automation needs by interacting with your notes over a secure REST API.

Find orphaned files and broken links

Find files that are not linked anywhere and would otherwise be lost in your vault. In other words: files with no backlinks.

Omnisearch

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

Recent Files

Display a list of recently opened files.

Commander

Customize your workspace by adding commands everywhere, create macros and supercharge your mobile toolbar.