telescope-project.nvim
telescope-project.nvim copied to clipboard
Feature Request: auto add project for opened file to list of projects
I'm a vim noob, so I'm not sure how to do this, but I'd like to be able to automatically add the project for an opened file to the list of projects, if it's not already there.
I assume it would be achieved by adding some FileReadPre autocmd.
The workflow would, I guess, be something like:
1 Get file's directory
2. Check if the file has a git root directory (git rev-parse --show-toplevel)
3. If it does, check if that directory doesn't already exist in telescope-projects.txt
4. If it doesn't, add a new project
Does this sound reasonable?
Would this be the recommended approach?
Thanks in advance!
Its much simpler to config the plugin and place the project folders accordingly as to not deal with autocmds etc.
FileReadPre is for :read cmds. You probably want something with Buf.
config the plugin and place the project folders accordingly
Please could you elaborate, and perhaps show an example?
https://github.com/nvim-telescope/telescope-project.nvim#available-setup-settings
gives some examples.
You just place your folders that contain git projects, ie into '~/dev/src3' within for that case 4 levels of nesting.
Ah ok, thanks!