A tiny tool provides Copy Code Reference inspired by AdamWhittingham/vim-copy-filename.
ccr.mp4
- Neovim >= 0.7.0
Install the plugin with lazy.nvim:
-- Lua
{
"yuchanns/ccr.nvim",
}
Or any package manager you preferred.
Call ccr.nvim api in lua:
local ccr = require("ccr")
ccr.copy_rel_path_and_line() -- the mostly used. Copy the relative file path and line number of the code.
ccr.copy_rel_path() -- just copy the relative file path of the code.
ccr.copy_abs_path_and_line() -- copy the absolute file path and line number of the code.
ccr.copy_abs_path() -- just the absolute file path.
ccr.copy_file_name() -- copy the name of the file.
ccr.copy_dir_path() -- copy the absolute parent path of the file.
Bug reports and feature requests are welcome! Feel free to make PRs!