Skip to content

sha0coder/nvim-ollama

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 

Repository files navigation

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.

apt install ollama
ollama pull qwen3-coder:30b

Basic working Lazy configuration

{
  "sha0coder/nvim-ollama",
    opts = {
        model = "qwen3-coder:30b",
        trigger = "manual",
        keybind = "<F2>",
    }
}

More customizable configuration

{
  "sha0coder/nvim-ollama",
    opts = {
        model = "qwen3-coder:30b",
        trigger = "auto",
        keybind = "<F2>",
        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.

About

NeoVim lazy plugin for using offline AI using ollama

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages