Local driven AI assistent plugin written in the cutting-edge Vim9 script and powered by ollama and codellama
vim9_ollama_demo.mp4
This plugin supports Vim version 9.0+.
You need install ollama and test it with following commands
ollama serve
ollama pull codellama:latest
ollama pull codellama:7b-code
ollama run codellama:latest
Add to your .vimrc
Plug 'greeschenko/vim9-ollama'
- type in vim console
:OllamaAsk Tell me a joke
return a random joke or another ansver for your question in the cursor position line
- select text or code and type in vim console
:OllamaChange Modify the following text to improve grammar and spelling, just output the final text without additional quotes around it
this command replace text with correct text with improved gramma and spelling
- select code and type in vim console
:OllamaChangeCode Add extra logging in this function
this command replace you code with updated
- prepere not completite code with in midle
func fibanachi(a, b){
<FILL>
}
select whis code and type
:OllamaFill
this command replace you code with complete function
- select text or code and type in vim console
:OllamaRead what I can change in this
this command write after selection text a LLM comments about this
You can use this experimental function some kind like copilot
start write a code and pres <C-l>
you can see a completion candidat press <C-l>
again and you get new candidat
when you get correct variant press <C-f>
to paste code in the buffer
If you run multiple Vim instances and Ollama does not respond, try running the command :OllamaReStart
.
This will restart the Ollama server and fix any connection issues."