coc-ai is a custom coc.nvim plugin that integrates AI-powered code assistance into Neovim/Vim.
Warning: This project is in its early stages and may be unstable or incomplete. Use with caution.
- Ask AI for code-related questions and suggestions
- Supports various AI models (e.g., GPT-4, GPT-4-mini, llama3)
- Configurable API endpoint and authorization key
- Code action integration for easy access
- Make sure you have coc.nvim installed.
- Run
:CocInstall coc-ai
Add the following configurations to your coc-settings.json
:
{
"ai.authorizationKey": "<your-api-key-here>",
"ai.model": "gpt-4o",
"ai.apiEndpoint": "<your-api-endpoint-here>"
}
- Use the command
:CocCommand coc-ai.ask
to prompt the AI with a question. - Select a code block in visual mode and run the command to ask about the selected code.
- Use the "Ask AI" code action in supported file types.
To set up the development environment:
- Clone the repository
- Run
pnpm install
to install dependencies - Use
pnpm run build
to compile the TypeScript code - Use
pnpm run watch
for continuous compilation during development
MIT
Contributions are welcome! Please feel free to submit a Pull Request.