A tiny Neovim plugin for copying file references to AI agent CLIs.
- Copy the current file as an
@-mention - Include the selected line range in visual mode
- Use paths relative to Neovim's current working directory
- Choose the destination register
- Neovim >= 0.8.0
Install using lazy.nvim:
return {
'chenxin-yan/at.nvim',
opts = {},
}Default Configuration:
{
register = '+',
keys = {
copy = '<leader>at',
},
}| Function | Description |
|---|---|
require('at').setup(opts) |
Initialize the plugin with optional configuration |
require('at').copy() |
Copy an @-mention for the current file |
The default <leader>at mapping works in normal and visual mode. Set it to '' to disable it:
require('at').setup {
keys = {
copy = '',
},
}Set Keymaps Manually
require('at').setup {
keys = {
copy = '',
},
}
vim.keymap.set({ 'n', 'v' }, '<leader>at', require('at').copy, {
desc = 'Copy file @-mention',
})Run require('at').copy() or press <leader>at.
In normal mode:
@lua/at.lua
With lines 10 through 14 selected in visual mode:
@lua/at.lua#L10-14
A single selected line omits the range end:
@lua/at.lua#L10