Quickly switch between projects and automate startup tasks
The plugin is straightforward to install, so feel free to use your favorite plugin manager, e.g.:
Packer:
use { 'charludo/projectmgr.nvim' }
Lazy:
{
'charludo/projectmgr.nvim',
lazy = false, -- important!
}
projectmgr default configuration:
{
autogit = {
enabled = false,
command = "git pull --ff-only",
},
reopen = false,
session = { enabled = true, file = "Session.vim" },
shada = { enabled = false, file = "main.shada" },
scripts = {
enabled = true,
file_startup = "startup.sh",
file_shutdown = "shutdown.sh",
},
}
It's a good idea to set up a key mapping to toggle the projectmgr window:
vim.api.nvim_set_keymap("n", "<leader>p", ":ProjectMgr<CR>", {})
telescope.nvim
:ProjectMgr
(or your keybind) toggles a telescope picker with your projects. The telescope preview displays information about your project
and its current git state. (I'm very much open to adding more info here and am happy about suggestions!)
The following actions and keybinds are available:
Key | Action |
---|---|
<CR> |
Open the project under your cursor |
<C-a> |
Add a project. You will be asked for a name, a path, and optionally startup and shutdown commands. |
<C-d> / <C-x> |
Delete project under your cursor |
<C-e> / <C-u> |
Edit the project under your cursor |
<C-q> / <ESC> |
Close the window without doing anything |
telescope.nvim
projectmgr comes with a fallback window in case you aren't using telescope.nvim
. The same actions are available.
The keybinds are slightly different: <C-a>
is replaced by just a
, <C-q>
becomes just q
, and so on.