Open evanpurkhiser opened 2 years ago
This is not my priority, but until it's implemented, feel free to check out the project_nvim
API.
I did this for fzf-lua to browse projects and their files:
local fzf_lua = require("fzf-lua")
vim.keymap.set('n', '\\p',
function()
local history = require("project_nvim.utils.history")
local results = history.get_recent_projects()
fzf_lua.fzf_exec(results, {
actions = {
['default'] = {
function(selected)
fzf_lua.files({ cwd = selected[1] })
end,
}
}
})
end,
{ noremap = true, silent = true })
here's an extended version with project deletion:
local fzf_lua = require("fzf-lua")
vim.keymap.set('n', '\\p',
function()
local history = require("project_nvim.utils.history")
fzf_lua.fzf_exec(function(cb)
local results = history.get_recent_projects()
for _, e in ipairs(results) do
cb(e)
end
cb()
end,
{
actions = {
['default'] = {
function(selected)
fzf_lua.files({ cwd = selected[1] })
end,
},
['ctrl-d'] = {
function(selected)
history.delete_project({ value = selected[1] })
end,
fzf_lua.actions.resume
}
}
})
end,
opts)
I see there is a Telescope integration. Would be very cool to also have a fzf-lua select last project integration :)