AI Code Editor Integration
Local LLMs in Neovim: gen.nvim
Section titled “Local LLMs in Neovim: gen.nvim”Sources:
- Local LLMs in Neovim: gen.nvim - YouTube by David Kunz
- GitHub - David-Kunz/gen.nvim: Neovim plugin to generate text using LLMs with customizable prompts
- Demo of AI Assisted Coding in Neovim - YouTube (12.04 mark with Code Rewriting and Chat)
Summary: Integrate Mistral.ai 7B model, install it locally and use with Ollama, and how to use with Neovim extension gen.nvim created by David Kunz
- Mistral model: Comes in text and instruct, use instruct
- Install and run Ollama
- gen.nvim will invoke Ollama from Neovim
- Call using
:Gen
- Example prompts like:
- Correct grammar and spelling
- Summarize text
- Make concise
- Make list
- Make table for markdown
- Ask question
- Code
- Review code
- Change code
- Create new prompts as needed
- User input as variables
- Can replace text or not with generated output
- Call using
Description | Shortcut |
---|---|
Start | :Gen |
Chat, Follow up in window | :Gen chat |
Response, replace text | C-Enter |
Select model | require(‘gen’).selectmodel() : |
# Run without desktop appollama serve## Default model setting for gen.nvimollama run mistral
## Run nvim and use :Gen