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

Line Ending Controller

anseanse41 downloads

Control line ending format (LF/CRLF) per file or per folder. Prevent Obsidian from silently converting CRLF to LF.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates1

Control line ending format (LF / CRLF) per file or per folder in Obsidian.

🌐 This plugin supports English and 简体中文 — automatically follows Obsidian's display language.

📖 中文文档


Why?

Obsidian's editor (CodeMirror 6) normalizes all line endings to LF (\n) internally. When you open a file with CRLF (\r\n) line endings — even if you make no edits — and save it, Obsidian silently converts all line endings to LF.

If your project uses CRLF (common on Windows, or enforced by .editorconfig / .gitattributes), this causes:

  • Unexpected Git diffs — every line appears changed
  • CI failures — linting rules like linebreak-style fail
  • Team friction — mixed line endings across the codebase

This plugin fixes line endings automatically after every save (and optionally on file open), so your files always have the line endings you expect.


Features

  • 🔧 Auto-fix on save — line endings are corrected immediately when you save a file
  • 📂 Auto-fix on open — (enabled by default) corrects line endings when you open a file
  • 📋 Per-file / per-folder rules — different line ending strategies for different parts of your vault
  • 📊 Status bar indicator — shows the current file's line ending (LF / CRLF) at a glance
  • ⚡ Manual commands — convert any file to LF or CRLF on demand
  • 🌐 Chinese / English i18n — UI language follows Obsidian's display language

Configuration

Open Settings → Line Ending Controller to configure rules:

Setting Description
Pattern Path prefix to match (e.g. projects/ or docs/spec.md). Empty matches all files as fallback.
Strategy LF (Unix) — force LF line endings
CRLF (Windows) — force CRLF line endings

Rules use longest prefix matching — more specific rules take priority. The rule with an empty pattern acts as the default for all unmatched files.

Example

Pattern Strategy Effect
(empty) CRLF All files → CRLF
linux-scripts/ LF Files under linux-scripts/ → LF
docs/README.md LF Only docs/README.md → LF

Result: docs/README.md and everything under linux-scripts/ uses LF; everything else uses CRLF.


Commands

This plugin adds two commands to the Command Palette (Ctrl+P):

Command Description
Convert current file to LF Immediately converts the active file to LF
Convert current file to CRLF Immediately converts the active file to CRLF

Installation

From Obsidian Community Plugins

  1. Open Obsidian → Settings → Community Plugins
  2. Disable Safe mode
  3. Click Browse and search for "Line Ending Controller"
  4. Install and enable

Manual Installation

  1. Download main.js, manifest.json, styles.css from the latest release
  2. Copy them to <Vault>/.obsidian/plugins/line-ending-controller/
  3. Restart Obsidian and enable the plugin in Settings

From Source

git clone https://github.com/anseyuyin/line-ending-controller.git
cd line-ending-controller
npm install
npm run build
# Then copy main.js, manifest.json, styles.css to your vault

FAQ

Q: Does this plugin modify files without me saving? A: By default, yes — the "Fix on open" option corrects line endings when you open a file. You can disable this in settings.

Q: Will this cause merge conflicts in Git? A: No. The plugin ensures consistent line endings, which prevents merge conflicts caused by mixed line endings.

Q: Does it work on mobile? A: No — desktop only.

Q: Can I exclude certain files? A: Not directly, but you can use path prefix rules to control which files get which strategy. Files not matched by any rule use the empty-pattern fallback.


Development

git clone https://github.com/anseyuyin/line-ending-controller.git
cd line-ending-controller
npm install
npm run dev    # watch mode — auto-rebuilds on changes
npm run build  # production build

Project Structure

├── src/main.ts          # Plugin source
├── main.js              # Bundled output
├── manifest.json        # Plugin metadata
├── styles.css           # Plugin styles
├── esbuild.config.mjs   # Build configuration
├── version-bump.mjs     # Version management
└── versions.json        # Version compatibility map

Releasing

npm version patch   # or minor / major
git push --tags

GitHub Actions will automatically build and create a draft release.


License

MIT

HealthExcellent
ReviewPassed
About
Control line ending format (LF or CRLF) per file or folder and automatically fix endings on save or open to prevent silent conversions and unexpected Git diffs. Show the current file's ending in the status bar, run manual conversions on demand, and apply per-file or per-folder rules to enforce different strategies across your vault.
FormatsFilesStatus bar
Details
Current version
1.0.2
Last updated
2 weeks ago
Created
2 weeks ago
Updates
1 release
Downloads
41
Compatible with
Obsidian 1.8.7+
Platforms
Desktop only
License
MIT
Report bugRequest featureReport plugin
Author
anseanseanseyuyin
GitHubanseyuyin
  1. Community
  2. Plugins
  3. Formats
  4. Line Ending Controller

Related plugins

Better Word Count

Count the words of selected text in the editor.

Importer

Convert your data to Markdown files you can use in Obsidian. Works with Apple Notes, OneNote, Evernote, Notion, Google Keep, and many other formats.

Notebook Navigator

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

Claudian

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

Advanced URI

Control everything with URI.

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.

QuickAdd

Quickly add new notes or content to your vault.