llm.vim

Asynchronous Vim plugin for Ollama LLMs.

Features

Installation

Plug 'mitjafelicijan/llm.vim'

Configuration

Override defaults in your .vimrc:

Check for available models https://ollama.com/search.

let g:llm_model = 'granite4.1:3b'
let g:llm_url = 'http://127.0.0.1:11434'

Custom Mappings

To disable default mappings and define your own, set g:llm_disable_mappings and use the following functions:

let g:llm_disable_mappings = 1

" Normal mode question
nnoremap <C-k> :call llm#AskQuestion(0)<CR>
" Visual mode question
xnoremap <C-k> :<C-u>call llm#AskQuestion(1)<CR>
" Visual mode completion
xnoremap <C-l> :<C-u>call llm#RequestCompletion(1)<CR>

Mappings & Commands (Defaults)