filemention.nvim
type
@ in insert mode.
fuzzy-pick a file.
get a
@path/to/file mention — native to nvim.
with lazy.nvim (the event is optional - just lazy-loads on first insert):
{ "not-manu/filemention.nvim", event = "InsertEnter", opts = {} }then wire it into your completion engine:
nvim-cmp
sources = cmp.config.sources({
{ name = "filemention" },
-- ...your other sources
})blink.cmp
sources = {
default = { "filemention", "lsp", "path", "snippets", "buffer" },
providers = {
filemention = {
name = "filemention",
module = "filemention.sources.blink",
},
},
}heads up: by default filemention only activates in
markdown,text, andgitcommitfiles. trying it in a.luabuffer and seeing nothing? setfiletypes = "*"(see config below).
defaults are sensible. but if you must:
require("filemention").setup({
trigger = "@", -- the magic key
root = "git", -- "git" | "cwd" | function() return path end
respect_gitignore = true, -- don't surface your node_modules sins
include_hidden = false,
format = "bare", -- "bare" | "markdown" | function(path, name)
filetypes = { "markdown", "text", "gitcommit" }, -- or "*" if you live dangerously
max_items = 500,
finder = "auto", -- "auto" | "fd" | "rg" | "vim" | "fff"
})type [@ instead of @ and you get a real markdown link:
[@README.md](README.md)
handy when you're writing actual prose and the bare @path looks ugly.
optional: fff.nvim
frecency ranking. typo resistance. recents on top. costs you one line:
{
"not-manu/filemention.nvim",
event = "InsertEnter",
dependencies = { "dmtrKovalenko/fff.nvim" },
opts = { finder = "fff" },
}no fff? no problem. silently falls back to fd → rg → vim.
- file discovery via
fd→rg→ pure-luavim.fs.dir(whichever it finds first) - git root by default, falls back to cwd
- only activates in text-ish filetypes so it doesn't pop up while you're writing real code
- no dependencies beyond your completion engine

