Fix Line Endings on Copy

approved

by KiwiJanus

Change line endings to CRLF when copying text on Windows (add carriage return).

β˜… 3 stars↓ 148 downloadsUpdated 5mo agoMIT
View on GitHub

Obsidian Line Ending CopyFix

An Obsidian plugin that ensures content copied from your notes uses platform-appropriate line endings. Currently, it targets Windows users, replacing Unix-style line feeds (\n) with Windows-style carriage return + line feed (\r\n) only when copying text. Your markdown files remain untouched.


✨ Features

  • πŸ” Automatically replaces \n with \r\n on copy if your OS is Windows
  • 🧠 Works with:
    • Manual text selections (Ctrl + C)
    • Code block β€œcopy” buttons
    • Retains obsidian's behaviour where copying without text selected copies the current line
    • Pop-out windows
  • πŸ”’ Does not modify your stored .md files
  • πŸ’» Windows-only by default (future support for more platforms is planned)

πŸ“¦ Installation

From Obsidian: Community Plugins (Recommended)

This plugin is now published to the Obsidian Community Plugins directory. Install it directly from Obsidian:

  • Open Settings β†’ Community Plugins β†’ Browse and search for Fix Line Endings on Copy, then install and enable it.
  • Or open the plugin directly in Obsidian using this link: obsidian://show-plugin?id=line-ending-copyfix.

From GitHub: Manual Installation (Fallback)

  1. Download the latest release from the Releases page
  2. Extract the archive into your vault’s plugins folder <your-vault>/.obsidian/plugins. The folder structure should look like this:
    <your-vault>/.obsidian/plugins/obsidian-line-ending-copyfix/
    β”œβ”€β”€ main.js
    └── manifest.json
    
  3. Restart Obsidian or reload plugins from Settings β†’ Community Plugins
  4. In Obsidian, open Settings β†’ Community Plugins
  5. In the list of installed plugins, find Fix Line Endings on Copy and enable it.

🧠 Why?

Obsidian uses LF (\n) line endings across all platforms, which is great for consistency.
However, many older Windows applications expect CRLF (\r\n) line endings. Without this, copied content may appear "squished" into a single line.

This plugin solves that by converting line endings only at the time of copying, so your notes stay clean and portable.


βš™οΈ Future Plans

  • Submit to Obsidian's community plugin directory (approval pending)
  • Add command palette support for manual line-ending conversion
  • Make line-ending style configurable (LF, CRLF, CR)
  • Toggle plugin behavior with a settings UI
  • Add support for various platforms and their line-ending conventions if someone needs it

πŸ’¬ Feedback / Contributing

Bug reports, feature requests, and pull requests are welcome on the GitHub Repository

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.