fzf-lua-projections.nvim will help you restoring any project session in a breeze
by facilitating my favorite plugin ibhagwan/fzf-lua
and the new star project GnikDroy/projections.nvim
.
btw, this repo was built with the help of projections.nvim and fzf-lua :)
github_demo_fzf-lua-projection.nvim.mov
- You will need to add this line to your init.lua
vim.opt.ssop:append({ 'localoptions' })
- For
ibhagwan/fzf-lua
: you don't need to add anything for this plugin. :) - For
GnikDroy/projections.nvim
: you just need to read the following note.- if you use neovim as the editor for terminal interactive
git
commands, e.ggit commit
without any argument, you have to ensure that you did add the guardian checkvim.fn.argc() == 0
as indicated in README.md ofGnikDroy/projections.nvim
:-- auto-restore on start. vim.api.nvim_create_autocmd({ 'VimEnter' }, { -- group = 'YOUR_GROUP', -- it's recommended to use augroup. pattern = '*', callback = function () if -- neovim is not start by `nvim some_arg` or `git commit`. vim.fn.argc() == 0 then require('projections.session').restore(vim.loop.cwd()) end end })
- if you use neovim as the editor for terminal interactive
- The dependencies of
ibhagwan/fzf-lua
: https://github.com/ibhagwan/fzf-lua#dependencies - The dependencies of
GnikDroy/projections.nvim
: (not provided.)
note: Actually, it's fzf-lua-projections
requires GnikDroy/projections.nvim
use {
'GnikDroy/projections.nvim',
requires = {
-- add these two lines
'ibhagwan/fzf-lua', -- Customize the menu UI yourself from fzf-lua's setup.
'nyngwang/fzf-lua-projections.nvim', -- actually, it's that fzf-lua-projections requires projections,
-- I just want to make it compact :)
},
config = function ()
require('projections').setup {
-- ...
store_hooks = {
pre = function ()
-- if you use neo-tree.nvim, add these two lines to the `pre` of `store_hooks`.
vim.cmd('tabd Neotree close')
vim.cmd('tabn')
-- ...
end,
-- ...
},
}
-- just setup your `autocmd`s for projections.
-- ...
end
}
-- the only keymap
vim.keymap.set('n', '<Leader>cp', function () require('fzf-lua-p').projects() end, NOREF_NOERR_TRUNC)