Skip to content

not-manu/filemention.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation



filemention.nvim

type @ in insert mode.
fuzzy-pick a file.

get a @path/to/file mention — native to nvim.

filemention.nvim demo




install

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, and gitcommit files. trying it in a .lua buffer and seeing nothing? set filetypes = "*" (see config below).

config

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"
})

the [@ trick

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

filemention.nvim + fff.nvim demo

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

under the hood

  • file discovery via fdrg → pure-lua vim.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



...yet another one of manu's creations  •  MIT

Releases

No releases published

Packages

 
 
 

Contributors