Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pluffie/neoproj
🔥 Small yet powerful project manager for Neovim
https://github.com/pluffie/neoproj
Last synced: about 2 months ago
JSON representation
🔥 Small yet powerful project manager for Neovim
- Host: GitHub
- URL: https://github.com/pluffie/neoproj
- Owner: pluffie
- License: mpl-2.0
- Created: 2022-12-29T17:29:50.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-02T12:45:11.000Z (over 1 year ago)
- Last Synced: 2024-07-31T20:45:31.293Z (4 months ago)
- Language: Lua
- Size: 13.7 KB
- Stars: 62
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-neovim - pluffie/neoproj - Small yet powerful project (and session) manager. (Project / PHP)
README
# Neoproj
Small yet powerful project manager for Neovim written in fennel.
## Features
- Open projects
- Manage sessions (see [Sessions](#sessions))
- Create projects from templates
- Add custom templates## Installation
- Packer
```lua
use "pluffie/neoproj"
```
- [lazy.nvim](https://github.com/folke/lazy.nvim)
```lua
{
"pluffie/neoproj",
cmd = { "ProjectOpen", "ProjectNew" },
}
```## Configuration
NOTE: calling `setup` is not necessary at all, plugin will work even without it
```lua
require "neoproj".setup {
-- Directory which contains all of your projects
project_path = "~/projects",
}
```### Adding templates
You can add your own templates using `register_template` function:
```lua
require "neoproj".register_template {
name = "Empty project (Git)",
expand = "git init",
}
```More information can be found in the help-file (`:h neoproj-templates`).
### Sessions
Neoproj does some session management out-of-box:
- automatically loads file `project_root/.nvim/session.vim` (if exists)
- has command for saving sessions (`:ProjectSaveSession`)But Neoproj doesn't save sessions automatically, so you need to write
`:ProjectSaveSession` all time. Let's fix it using autocmd!- Lua
```lua
vim.api.nvim_create_autocmd({"VimLeavePre"}, {
callback = function()
if vim.g.project_root ~= nil then
require "neoproj".save_session()
end
end,
})
```
- Fennel
```fennel
(let [{:save_session save-session} (require :neoproj)
callback #(when (not= nil vim.g.project_root)
(save-session))]
(vim.api.nvim_create_autocmd [:VimLeavePre] {: callback}))
```