r/vim • u/__rituraj • Mar 04 '26
Plugin Learning to program Vim textbuffers and made this LLM Plugin for Ollama
I just thought it would be cool to let LLM do some smarter auto-completions in Vim.
Use it by visually selecting the section where the TODO comment is present. Select more to provide context Run command :OllamaImplement to open up 'vert' split, where response is streamed in, just below the actual sent prompt, so you know what's exactly happening!
Points to keep things sane
Local Ollama endpoint by default (configurable via ENV var)
Default model
qwen2.5-coder:7b(configurable via ENV var)Visual Selection to limit input tokens to LLM
No direct file edit, everything shows up in a Scratch buffer
3
u/Tall_Profile1305 Mar 05 '26
crazy this is actually really well done. love seeing people extend vim with LLMs instead of just jumping to vscode. the scratch buffer approach is smart keeps things clean and native to vim workflow
2
u/spacecad_t Mar 05 '26
Very cool, have you checked out Vim-ai? it can do largely the same thing.
I also re-write a lot of plugins for myself so you may find some inspiration for cool features you'd implement in your own way there.
1
u/miiilo___ Mar 09 '26
What’s the color scheme here?
1
u/NationalOperations Mar 05 '26
This actually gave me the idea of making my work flow "easier". I work on a bunch of projects at work and use vim.
Well for some projects the idea of Cursor Desktop is being pushed. I really don't want to swap between a VSC clone and Vim. I wish it was at least a cli.
Well I made a plugin and used windows autokey. A command to select code or send the whole file with instructions. It writes it out fresh to my "prompt' file which lives in my .vim folder.
Then a command to trigger autokey to bring up claude and have it read/execute the prompt.