neovim integration for https://github.com/camdencheek/fre
- Lua 100%
| lua | (try to) gracefully shutdown spawning thread | |
| .editorconfig | .editorconfig | |
| .stylua.toml | add stylua config | |
| README.md | async queue to ensure single fre process | |
neovim integration for https://github.com/camdencheek/fre
Prerequisites
You need to have the fre command available
Setup and usage
Once set up, neovim will call fre behind the scenes to track the files you frequent.
Using https://github.com/folke/lazy.nvim
-- barebones config, will record paths on save
{
"https://codeberg.org/FelipeLema/fre.nvim.git",
dependencies={"nvim-lua/plenary.nvim"},
opts = {},
main="fre",
},
You can pick recorded files with require("fre").fzf_lua(), having https://github.com/ibhagwan/fzf-lua installed
-- with some customizations
{
"https://codeberg.org/FelipeLema/fre.nvim.git",
dependencies={"nvim-lua/plenary.nvim"},
opts = {
-- special location for `fre`
fre_cmd = "/home/felipe/dev/fre/target/release/fre",
-- can use other events to trigger recording a file
events = { "BufEnter" }
},
config = function(_, opts)
local fre = require "fre"
fre.setup(opts)
vim.keymap.set("n", "<leader>sr", function()
-- fzf_lua() forwards options to FzfLua
require("fre").fzf_lua { prompt = "FRC>",
fzf_opts = {
-- these options: a) prioritize the basename when you type b) preserve original order when narrowing
["--scheme"] = false,
["--tiebreak"] = "pathname,index",
},
}
end, { silent = true, desc = "[R]ecent files" })
end,
},