Skip to content

KaySum/nvim-agent-path-ref

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nvim-agent-path-ref

The nvim-agent-path-ref plugin provides

  1. a command for yanking @-style file references — the syntax understood by AI coding agents such as Claude Code — straight from Neovim to your system clipboard;
  2. support for line ranges, yanked from a visual selection or an explicit command range;
  3. a <Plug> mapping for binding all of this to a single key.
@lua/config/options.lua     whole file
@src/app.js#L12             single line
@src/app.js#L12-15          line range

Note

References are resolved against Neovim's current working directory, so they work when pasted into an agent session started from the same directory. Files outside it fall back to their absolute path.

Quickstart

Requirements

  • Neovim 0.10 or later

Installation

You can install nvim-agent-path-ref with your favorite package manager (or using the native package feature of vim, see :h packages); e.g., using the following spec with lazy.nvim:

{
  "KaySum/nvim-agent-path-ref",
  keys = {
    { "<leader>ay", "<Plug>(AgentPathRef)", mode = { "n", "x" }, desc = "Yank @file reference" },
  },
}

or with vim-plug:

Plug 'KaySum/nvim-agent-path-ref'

Setup

nvim-agent-path-ref needs no configuration and has no setup function. No mappings are created by default; bind <Plug>(AgentPathRef) to a key of your choice — it works in both normal and visual mode:

vim.keymap.set({ "n", "x" }, "<leader>ay", "<Plug>(AgentPathRef)", { desc = "Yank @file reference" })

Usage

Trigger Copies
:AgentPathRef @path/to/file.lua
:AgentPathRef on a visual selection @path/to/file.lua#L12-15
:12,15AgentPathRef @path/to/file.lua#L12-15

The reference is written to the + (system clipboard) register.

Check :h nvim-agent-path-ref for the full documentation.

About

Neovim plugin to yank @-style file references (with line ranges) for AI coding agents like Claude Code

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages