jackMort / jackMort/ChatGPT.nvim
Add option for project-specific context files
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 4k
- Forks
- 317
- PR merge metrics
- No merged PRs in 30d
Description
### General idea
I would love to see a feature similar to what Robitx/gp.nvim#50 has with their `:GpContext` command, namely being able to add a file like `.chatgpt.md` to the git root directory, the content of which would then be prepended to new chats - either as a system message, or actually prepended to the first user message.
### Usecase
I find myself re-typing the same context quite often, e.g.:
```
I am working on a django project. I have models A, B, and C. B has a foreign key to C. I also have a modelform AForm, BForm, CForm for each of those models.
```
before getting to my actual question.
Another usecase would be something like:
```
Only use python, typescript, tailwind CSS, and django templates (depending on what is necessary) to accomplish the following task:
```
Obviously this context is highly project dependant, but it is also very much a constant within each project.
### Proposed solution
Add two new options, e.g. `project_context_file` and `project_context_type`. If the `project_context_file` exists in the git root, set its content as the system message if `project_context_type == "system"` or prepend it to the first message of each new chat if `project_context_type == "prepend"` (or something along those lines).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the plugin's configuration handling and the code that constructs messages for a new chat. Determine how the git root can be identified and how system messages differ from the first user message. Done means a project context file is optionally read and applied according to the selected mode, with both options documented and covered by tests if the project has relevant test coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua, neovim
- Domain
- ai, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100