Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/windwp/nvim-projectconfig
neovim projectconfig
https://github.com/windwp/nvim-projectconfig
config neovim projects vim
Last synced: 18 days ago
JSON representation
neovim projectconfig
- Host: GitHub
- URL: https://github.com/windwp/nvim-projectconfig
- Owner: windwp
- License: mit
- Created: 2021-02-16T05:38:04.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-07-28T11:39:42.000Z (5 months ago)
- Last Synced: 2024-11-16T19:57:29.062Z (26 days ago)
- Topics: config, neovim, projects, vim
- Language: Lua
- Homepage:
- Size: 10.7 KB
- Stars: 105
- Watchers: 5
- Forks: 9
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-neovim - windwp/nvim-projectconfig - Load Neovim config depend on project directory. (Project / PHP)
README
## nvim-projectconfig
Load config depend on current directory.
### Sample
current directory is `/home/abcde/projects/awesome/`.
you open vim in **awesome** directory.It will load a config file from `~/.config/nvim/projects/awesome.lua` or `~/.config/nvim/projects/awesome.vim`
this config save outside of your git repo and you don't need to check security on that file.
It work perfect if you are working on monorepo.## Install
``` vim
Plug 'windwp/nvim-projectconfig'
```
then add this in your init.lua```lua
require('nvim-projectconfig').setup()
```## FAQ
* A command to open project config fileCommand: **EditProjectConfig**
* I want to change projects-config directory
``` lua
require('nvim-projectconfig').setup({
project_dir = "~/.config/projects-config/",
})```
* I have 2 directory have same name.
``` lua
require('nvim-projectconfig').setup({
project_dir = "~/.config/projects-config/",
project_config={
{
-- full path of your project or a lua regex string
path = "projectconfig",
-- use a function or a path to config file
config = function ()
print("abcde")
end
},
},
silent = false,-- display message after load config file
})
```* I want to change my directory inside neovim and load project config.
``` lua
require('nvim-projectconfig').setup({autocmd=true})```
## Bonus
a function to load and save json file and do whatever you want.
```lua
require('nvim-projectconfig').load_json()
require('nvim-projectconfig').save_json(data)
```