project.nvim
project.nvim copied to clipboard
[Feature] just before changing/opening project execute direnv
I have feature request for this plugin. Not sure if fesible or not, or even should be part of this or not, but it would be great that when one of the project get activated, if any direnv (.envrc) file exisits then allow to excute that.
My lot of project relies on activating the .envrc, which intern enable some extra binaries for the project or dependencies and then LSP or formatter might work. With that this plugin becomes little un-useful. For non-env projects this plugin has been helping me out a lot. Kudos to dev!
I can think of work flow something like below,
- open neovim in home directory
- open project picker and selct project
- if envrc directed and if its allow then load the envrc first. All the path will be reloaded as well (I guess this is the hardest part)
- update the cwd for nvim-tree
- since path is updated, LSP will load happily
- null-ls will find the needed binary tucked inside the envrc paths
- when switching the project, clenup the envrc and start from third step.
@ahmedkhalf While thinking further, I feel that this feature requests is out of the scope of the project.
But It would be great if we have some sort of hook (unless I am missing existing of one), to run certain command, before it trigger some sort of environment changes for telescope or nvim-tree etc.
Yes, something more general, i would like the ability to run a function before and/or after the project opening
a pre-hook and a post-hook
There is a plugin called direnv.vim provided by the direnv team that does this. Work nicely with project.nvim.