# llama.vim

A Vim plugin for local LLM-assisted code completion, using fill-in-the-middle suggestions and instruction-based editing against a llama.cpp server, with configurable context scope and named server profiles.

llama.vim adds local, LLM-assisted text completion to Vim. It auto-suggests fill-in-the-middle completions as the cursor moves in insert mode, which can be accepted in full with Tab or one line at a time with Shift+Tab, and also supports instruction-based editing where a selection is rewritten according to a typed instruction.

Context is built from a configurable scope around the cursor plus a ring of chunks from other open and recently edited files and yanked text, with smart reuse that keeps large contexts workable even on low-end hardware; generation time and the completion keymaps are all configurable through a single settings variable. Multiple named llama.cpp server profiles can be defined and switched between at runtime with a command, and the plugin displays performance statistics for the active completion.

It installs through vim-plug, Vundle or lazy.nvim, is written in Vim Script, and is released under the MIT license.

Website: https://github.com/ggml-org/llama.vim
