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

neves007neves00724 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.

98%
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
2 weeks ago
Created
2 weeks ago
Updates
1 release
Downloads
24
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

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.

Copilot

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

Claudian

Embeds Claude Code/Codex as an AI collaborator in your vault. Your vault becomes agent's working directory, giving it full agentic capabilities: file read/write, search, bash commands, and multi-step workflows.

Excalidraw

Visual PKM powerhouse. Create and edit Excalidraw drawings.

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).

Smart Composer

AI chat with note context, smart writing assistance, and one-click edits for your vault.

Link Favicons

See the favicon for a linked website.

HiNote

Add comments to highlighted notes, use AI for thinking, and flashcards for memory.

Advanced URI

Control everything with URI.