vuciv / vim-bujo

A minimalist task manager for vim.
201 stars 15 forks source link

Project specific tasklists #7

Closed ThePrimeagen closed 4 years ago

ThePrimeagen commented 4 years ago

It would be nice if there was a way to have a todo list that is project specific instead of shared amoungst all.

Thoughts?

vuciv commented 4 years ago

Absolutely. You're the second person to ask for this, and I was thinking about it.

What I'm currently thinking is that if you're working in foo/ it will make a ~/.cache/bujo/foo/todo.md

How does that sound?

vuciv commented 4 years ago

Hmm, I'd also need to figure out how to note which folder is the master folder so that if you're in foo/bar it will still go to ~/.cache/bujo/foo/todo.md and not ...bar/todo.md

I'll start looking around and thinking but if anyone knows how to handle such cases, I'd be happy to know

sumpygump commented 4 years ago

One idea of how you could find the root of a given project directory (while in its child directories) is probably similar to how git the command line tool does it. Notice how you can run git commands in a subfolder of your git project. I think what it does is search up directories until it finds the .git directory. You could do the same thing: look up parent directories from the current directory to find the .git directory and then use the parent of that directory to be the project root. Basically I am advocating that a .git directory would be a good candidate for indicating this is a project to which to attach todo items.

Another idea is you could have a Bujo plugin command to set a root directory and then save it to a project manifest file (say, stored in ~/.cache/bujo/projects.txt or something), storing that path as a project root and so if the user is in that directory or a child of it then you would be considered in that project.

vuciv commented 4 years ago

I have integrated this feature. Please take a look at the updated README.md and let me know if you have any questions. Thank you for your suggestion @ThePrimeagen. I hope you enjoy.

@sumpygump Thanks for your idea. I ended using git-rev-parse which pretty conveniently gives us info about git repositories

ThePrimeagen commented 4 years ago

I'll give it a try on tonights stream my friend!!!