https://github.com/sha0coder/nvim-ollama
NeoVim lazy plugin for using offline AI using ollama
https://github.com/sha0coder/nvim-ollama
Last synced: 5 months ago
JSON representation
NeoVim lazy plugin for using offline AI using ollama
- Host: GitHub
- URL: https://github.com/sha0coder/nvim-ollama
- Owner: sha0coder
- Created: 2025-08-02T11:48:36.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2025-08-02T12:53:45.000Z (5 months ago)
- Last Synced: 2025-08-02T13:32:57.556Z (5 months ago)
- Language: Lua
- Size: 5.86 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nvim-ollama NeoVim AI plugin
100% offline NeoVim AI completion using ollama.
By default it's using `qwen3-coder:30b`
Use Lazy plugins to install it.
## Usage
by default is manual mode with the keybind F2.
In manual mode press F2 and wait a moment.
In auto mode (less convinient) is sending every delay time the query to ollama.
## Setup ollama
Note that qwen3 is 16Gb on disk, but is fast, good, offline and don't use much cpu/ram.
```bash
apt install ollama
ollama pull qwen3-coder:30b
```
## Basic working Lazy configuration
```lua
{
"sha0coder/nvim-ollama",
opts = {
model = "qwen3-coder:30b",
trigger = "manual",
keybind = "",
}
}
```
## More customizable configuration
```lua
{
"sha0coder/nvim-ollama",
opts = {
model = "qwen3-coder:30b",
trigger = "auto",
keybind = "",
host = "1.2.3.4" -- default localhost
port = "11111" -- default 11434
delay = 900 -- default 400
context = 20 -- default 15 this is the previous lines to the current line to send to ollama.
system_prompt = [[
something
]]
}
}
```
## Default system prompt
```
You are a strict code autocompletion engine. Your only task is to complete programming code.
Return exactly one valid line of code. Do not explain anything.
Do not wrap code in quotes or markdown.
Return only code. No comments, no explanations, no formatting, no extra words.
```
Its important to use a good prompt for avoiding text or code in markdowns.