Small yet powerful project manager for Neovim written in fennel.
use "pluffie/neoproj"
{
"pluffie/neoproj",
cmd = { "ProjectOpen", "ProjectNew" },
}
NOTE: calling setup
is not necessary at all, plugin will work even without it
require "neoproj".setup {
-- Directory which contains all of your projects
project_path = "~/projects",
}
You can add your own templates using register_template
function:
require "neoproj".register_template {
name = "Empty project (Git)",
expand = "git init",
}
More information can be found in the help-file (:h neoproj-templates
).
Neoproj does some session management out-of-box:
project_root/.nvim/session.vim
(if exists):ProjectSaveSession
)But Neoproj doesn't save sessions automatically, so you need to write
:ProjectSaveSession
all time. Let's fix it using autocmd!
vim.api.nvim_create_autocmd({"VimLeavePre"}, {
callback = function()
if vim.g.project_root ~= nil then
require "neoproj".save_session()
end
end,
})
(let [{:save_session save-session} (require :neoproj)
callback #(when (not= nil vim.g.project_root)
(save-session))]
(vim.api.nvim_create_autocmd [:VimLeavePre] {: callback}))