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

LineRef Copier

neves007neves007117 downloads

Copy AI-friendly Markdown location indexes as file path plus line number.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates1

LineRef Copier is a local Obsidian plugin for copying precise Markdown note references from the cursor line, a selected phrase on one line, or a selected range across multiple lines.

Its main purpose is to help you interact with AI agents more precisely. Instead of describing "the sentence inside the long paragraph near the middle of this note", you can copy an exact index and paste it into an AI conversation, task, issue, or prompt. This gives the agent a concrete location to inspect or discuss.

LineRef Copier supports three reference levels:

  • Cursor line: Projects/Research/idea.md:25
  • Single-line selection: Projects/Research/idea.md:25:8-42
  • Multi-line selection: Projects/Research/idea.md:25:8-27:19

Features

  • Copy the current cursor line as an AI-friendly location index, such as path/to/file.md:25.
  • Copy a single selected phrase with line and column positions.
  • Copy a multi-line selection with start and end line-column positions.
  • Choose between relative vault paths and absolute local file paths.
  • Run the command from the command palette or record a custom shortcut in the plugin settings.
  • Optionally show a notification after copying, including the copied reference.

Usage

Open a Markdown note, then run Copy line reference from the command palette in one of these situations:

  • Place the cursor on a line to copy that line reference.
  • Select text within one line to copy the line and column range.
  • Select text across multiple lines to copy the start and end line-column range.

Paste the copied reference into your AI agent chat when you want the agent to locate a specific note position.

When Copy notice is enabled, Obsidian shows a notice like:

LineRef Copier: copied Projects/Research/idea.md:25:8-27:19

Output format

Cursor line:

filePath:lineNumber

Example:

Projects/Research/idea.md:25

Single-line selection:

filePath:lineNumber:startColumn-endColumn

Example:

Projects/Research/idea.md:25:8-42

Multi-line selection:

filePath:startLine:startColumn-endLine:endColumn

Example:

Projects/Research/idea.md:25:8-27:19

Line and column numbers are 1-based, matching what people usually expect when discussing files. For selections, the copied range points from the first selected character to the selection end position.

Settings

Open Settings -> Community plugins -> LineRef Copier.

  • Path mode controls whether copied references use a relative vault path or an absolute local file path.
  • Copy notice controls whether successful copies show a notice with the copied reference.
  • Custom shortcut records a plugin-level shortcut. Select Clear to remove it.

If absolute paths are unavailable in the current Obsidian environment, the plugin falls back to the relative path and shows a notice.

Development

Install dependencies:

npm install

Build the plugin:

npm run build

Run lint checks:

npm run lint

During local testing, reload the plugin in Obsidian after rebuilding so the latest main.js is loaded.

Release with GitHub Actions

This repository includes a release workflow at .github/workflows/release.yml.

It runs when you push a Git tag, builds the plugin, then creates a draft GitHub Release and uploads:

  • main.js
  • manifest.json
  • styles.css

Recommended release steps:

  1. Make sure manifest.json version and versions.json are updated (for example 1.0.1).
  2. Commit your changes.
  3. Create a tag that exactly matches the plugin version (no v prefix), such as 1.0.1.
  4. Push commit and tag to GitHub.
  5. Open GitHub Releases, review the generated draft release, then publish it.

Privacy

LineRef Copier works locally. It does not make network requests, collect analytics, upload vault content, or send file paths outside Obsidian.

HealthExcellent
ReviewPassed
About
Copy the current cursor line or a selected range as a file path plus line number (e.g., Projects/Research/idea.md:25 or Projects/Research/idea.md:25-27) for precise location references. Choose relative or absolute paths and optionally show a copy notification to paste exact note locations into AI chats, issues, or tasks.
AILinks
Details
Current version
1.0.2
Last updated
3 months ago
Created
3 months ago
Updates
1 release
Downloads
117
Compatible with
Obsidian 1.12.7+
Platforms
Desktop, Mobile
License
0BSD
Report bugRequest featureReport plugin
Author
neves007neves007
GitHubneves007
  1. Community
  2. Plugins
  3. AI
  4. LineRef Copier

Related plugins

Smart Connections

Find related notes and excerpts while writing. Your AI link building copilot displays relevant content in graph + list view. A local embedding model powers semantic search. Zero setup. No API key.

Excalidraw

Visual PKM powerhouse. Create and edit Excalidraw drawings.

Claudian

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

Advanced URI

Control everything with URI.

Copilot

Your AI Copilot: Chat with Your Second Brain, Learn Faster, Work Smarter.

Fast Note Sync

Real-time sync of your vaults across server, mobile, and web; shareable with anyone; supports REST and MCP integrations to build your personal AI knowledge base.

Breadcrumbs

Visualise the hierarchy of your vault using a breadcrumb trail or matrix view.

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.

Agent Client

Chat with Claude Code, Codex, Gemini CLI, and more via the Agent Client Protocol — right from your vault.

Text Generator

Generate text content using GPT-3 (OpenAI).